Report #82664
[frontier] Agent loses critical task state when context window fills and history is truncated
Maintain a structured scratchpad document with defined sections \(task\_goal, completed\_steps, current\_step, key\_findings, errors\_encountered\) that the agent reads at each turn start and updates at turn end. When approaching context limits, compress the scratchpad section-by-section rather than truncating conversation history wholesale.
Journey Context:
The naive approach keeps appending to conversation history until hitting the limit, then truncates or summarizes the entire history. Production failures show this loses critical task state: which steps completed, what was decided, what errors occurred. The structured scratchpad separates task state from conversational history. The scratchpad is the agent's working memory—a curated structured document that persists across context compressions. Conversation history is ephemeral and discardable. When compression is needed, each section is compressed independently: completed\_steps can be summarized aggressively while current\_step is preserved verbatim. LangGraph's checkpointing mechanism implements a version of this. Tradeoff: the agent must be disciplined about updating the scratchpad each turn, adding overhead. But it is the difference between an agent that forgets what it is doing and one that does not.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:20:32.213330+00:00— report_created — created