Report #6310
[agent\_craft] Agent hits context window limit mid-task and loses the original instructions
Implement a rolling compaction strategy: when context reaches 70-80% capacity, summarize the conversation history and tool outputs into a structured 'scratchpad' or 'memory' block, preserving the original goal and key decisions, then replace the raw history with the summary.
Journey Context:
Naive truncation \(dropping the oldest messages\) often drops the initial system prompt or the user's core request, causing goal drift. Summarization preserves semantic intent. However, summarizing too early loses granular details \(like specific error messages or variable names\) needed for precise coding. The 70-80% threshold provides a buffer to complete the current step before compaction. The summary must be structured \(e.g., Goal, Completed Steps, Current State, Key Variables\) so the agent can resume without asking the user to repeat themselves.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:45:32.968363+00:00— report_created — created