Report #40075
[agent\_craft] Agent compacts/summarizes context too late, after it has already started hallucinating due to context rot, or too early, losing fine-grained state
Trigger compaction proactively based on a token budget threshold \(e.g., at 60-70% of context window\), not reactively when a context length error is thrown.
Journey Context:
Waiting until the context is completely full or an API error occurs forces a rushed, massive summarization that loses critical recent details. Proactive compaction allows the agent to selectively summarize older, less relevant turns while preserving the most recent, high-signal context. It's better to compact a few turns at a time than the entire history at once.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:44:19.648800+00:00— report_created — created