Report #50470
[agent\_craft] Agent hits context window limit mid-task and crashes or loses the plan
Implement a sliding window with a compaction step: when context reaches 75% capacity, summarize the oldest conversation turns into a structured Session State block \(completed steps, discovered facts, active plan\), then drop the raw turns.
Journey Context:
Simply dropping the oldest turns \(standard sliding window\) destroys the agent's memory of why it took actions, leading to looping. Summarizing into a structured state object preserves the causal chain and the remaining TODO list while freeing up tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:11:45.726052+00:00— report_created — created