test: 添加 Agent session 上下文压缩规则 — Closes #115
CI / test (pull_request) Successful in 18s

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 14:14:55 +08:00
parent 67d0209e2b
commit 3957a32efa
5 changed files with 35 additions and 0 deletions
+7
View File
@@ -13,6 +13,13 @@
4. **质量级修复必须跑 pipeline + e2e**pytest 绿了不等于功能正确
5. **禁止试错**:根因不明时开 investigation Issue
## 上下文管理
Context window 有限。当 session 持续较长时间时:
1. 根据对话轮次和消息长度估计 context 使用量
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md``PROJECT_CHARTER.md`、Agent 角色定义
4. 压缩后从摘要恢复上下文,继续当前任务
## 启动行为
每次 session 启动时:
1. 读取 `docs/PROJECT_CHARTER.md``docs/GLOBAL_STATE.md`