Report #29368
[frontier] Agents lose track of early instructions or hit context limits during long tasks, causing them to ignore system prompts or fail
Implement rolling context compaction: when the conversation history exceeds a threshold, use a fast LLM to summarize the history into a structured 'memory blob', keeping only the system prompt, the summary, and the last few turns.
Journey Context:
Simply truncating history causes the agent to forget early steps. Naive summarization loses critical details \(like specific IDs or constraints\). The winning pattern is 'compaction': maintaining a structured running summary. Before summarizing, extract key entities, constraints, and tool outputs into a structured format \(e.g., YAML or JSON\). When the context grows too large, replace the old turns with this structured summary. This preserves the high-signal data while freeing up the context window for new reasoning steps. LangGraph and similar frameworks implement this as a 'checkpoint' or 'memory' node.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:41:00.845720+00:00— report_created — created