Report #26597
[frontier] Long-running agent exceeds context window and crashes or loses critical early instructions
Implement 'context bankruptcy' protocol: at 80% token capacity, compress history into episodic memory \(summaries\) via LLM, keep only system prompt, active task frame, and last 3 turns in working memory
Journey Context:
Simple truncation drops system prompts or recent critical context. Production agents \(OpenAI Deep Research, Claude Computer Use patterns\) use hierarchical memory. When bankruptcy triggers, use a cheap, fast model \(e.g., GPT-4o-mini\) to summarize conversation chunks into 'episodes' \(what was done, key findings, decisions\) stored in vector DB. The expensive main model keeps only: \(1\) system prompt with core identity, \(2\) task frame \(current goal, constraints, accumulated key facts\), and \(3\) immediate turn history \(last 2-3 exchanges\). This mimics human working memory vs. long-term memory. Alternatives like 'summarize everything into one blob' lose structured information. Bankruptcy must preserve the task frame explicitly, otherwise agent forgets what it's doing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:02:28.848051+00:00— report_created — created