context-compaction
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContext Compaction
上下文压缩
Preserve essential state when context window fills up.
当上下文窗口耗尽时,保留关键状态。
Always Preserve
始终保留
| Item | Why |
|---|---|
| Test names + output (pass/fail) | Regression detection, reproducibility |
| Build status (success/error + msg) | Know if in broken state |
| Files modified (path + why) | Track changes, enable rollback |
| Open TODOs with state | Prevents losing WIP |
| Env vars set this session | Re-establish environment |
| Decisions made (WHY) | Enables contextual future decisions |
| 项 | 原因 |
|---|---|
| 测试名称 + 输出(通过/失败) | 回归检测、可复现性 |
| 构建状态(成功/错误 + 消息) | 了解是否处于故障状态 |
| 修改的文件(路径 + 原因) | 跟踪变更、支持回滚 |
| 带状态的未完成任务(TODO) | 避免丢失进行中的工作(WIP) |
| 本次会话设置的环境变量 | 重建环境 |
| 已做出的决策(原因) | 支持基于上下文的未来决策 |
DO NOT Compress
请勿压缩
- Exact file paths
- Error messages (verbatim)
- Test names
- Numeric results (counts, sizes, checksums)
- 确切的文件路径
- 错误消息(原文)
- 测试名称
- 数值结果(计数、大小、校验和)
Example Output
示例输出
Tests: 2 fail (test_embed_vector, test_turso_insert)
Build: error - "missing trait impl Write for &str"
Files: memory-core/src/embed.rs (added async embed)
TODOs: [in_progress] refactor embed.rs - 60% done
Env: TURSO_DATABASE_URL=libsql://...
Decision: switched to async embed to fix blocking in hot pathTests: 2 fail (test_embed_vector, test_turso_insert)
Build: error - "missing trait impl Write for &str"
Files: memory-core/src/embed.rs (added async embed)
TODOs: [in_progress] refactor embed.rs - 60% done
Env: TURSO_DATABASE_URL=libsql://...
Decision: switched to async embed to fix blocking in hot pathSee Also
另请参阅
- Session State Preservation - Full guidelines
- Token Efficiency - Tool selection priority
- 会话状态保留 - 完整指南
- 令牌效率 - 工具选择优先级