From 15cb154a19cabb5c3c66491a61f215ef104d5280 Mon Sep 17 00:00:00 2001
From: TevinClaw <510129976@qq.com>
Date: Sat, 14 Mar 2026 13:03:06 +0800
Subject: [PATCH] feat(早报): 增加昨日总结模块
---
workspace/skills/memory-management/scripts/check_size.py | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/workspace/skills/memory-management/scripts/check_size.py b/workspace/skills/memory-management/scripts/check_size.py
new file mode 100755
index 0000000..f5b40c0
--- /dev/null
+++ b/workspace/skills/memory-management/scripts/check_size.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+"""
+检查MEMORY.md文件大小
+"""
+
+import sys
+from pathlib import Path
+
+
+def main():
+ workspace = Path.home() / ".openclaw" / "workspace"
+ memory_file = workspace / "MEMORY.md"
+
+ if not memory_file.exists():
+ print("❌ MEMORY.md 不存在")
+ return 1
+
+ size = memory_file.stat().st_size
+ kb = size / 1024
+
+ print(f"📊 MEMORY.md (L0层) 大小检查")
+ print(f" 当前: {kb:.1f}KB / 4KB")
+
+ if size > 4096:
+ print(" 🚨 状态: 超过红线!需要立即归档")
+ return 2
+ elif size > 3500:
+ print(" ⚠️ 状态: 接近限制,建议准备归档")
+ return 1
+ else:
+ print(" ✅ 状态: 正常")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
--
Gitblit v1.9.1