Report #31131
[agent\_craft] Long-Running Agent Session Degrades as Early Instructions and Goals are Pushed Out of Context
Implement periodic 'context crystallization' by summarizing the current state, completed steps, and remaining goals into a structured scratchpad, then resetting the context window with the original system prompt plus the crystallized summary.
Journey Context:
In long agentic tasks, the context window acts as a FIFO queue. As tool outputs accumulate, the original system prompt and initial goal slide out of the active attention window, leading to goal drift. Simply appending more context doesn't work. Crystallization \(or context sliding/compaction\) trades the granularity of past steps for the preservation of the core objective. It requires a reliable summarization step, but prevents the agent from forgetting its original constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:38:31.409579+00:00— report_created — created