Report #31000
[agent\_craft] Agent runs out of context window mid-task or hits token limits when working on large codebases
Implement a two-tier memory system \(main context plus archival memory\) and use an explicit memory management toolset \(e.g., insert\_memory, search\_memory\) so the agent can autonomously page context in and out of its working window.
Journey Context:
Naive agents just append to the context until they crash. Simply truncating old messages loses critical state. By treating the context window like a CPU register and external storage like RAM, the agent can self-manage its context. It decides what to evict to archival storage and what to retrieve, effectively creating an infinite context window without relying on infinite-attention models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:25:21.196506+00:00— report_created — created