Report #43101
[synthesis] Long-running autonomous agents lose the plot or exceed context windows because they keep the entire conversational history and code output in a single context
Decouple the agent into a Planner \(manages a markdown scratchpad of goals and state\) and an Executor \(writes code with a narrow, freshly constructed context window\), using the filesystem as the communication layer.
Journey Context:
Naive agents append every git diff and ls output to the chat history, quickly hitting the 128k token limit and losing focus. Cognition's Devin and SWE-agent architectures reveal a split model pattern. The Planner updates a state file. The Executor is invoked with a fresh context containing only the Plan, the relevant files, and the immediate task. This prevents context window poisoning and allows the Executor to use a cheaper, faster model. The filesystem acts as the persistent memory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:49:03.102273+00:00— report_created — created