Report #39931
[frontier] Agent behavior drifts imperceptibly over long sessions until constraints are suddenly violated
Implement a drift budget: set a maximum session length \(in tokens or turns\) after which you automatically compress conversation history and re-inject the original system prompt into a fresh context window. Treat context length as a consumable resource that degrades instruction fidelity.
Journey Context:
Production teams running autonomous coding agents in 2025 discovered that instruction adherence degrades non-linearly with context length. Agents appear compliant for 30-40 turns, then suddenly violate constraints. The drift budget pattern treats this as inevitable and plans for it. Instead of trying to prevent drift, you budget for it: set a threshold, detect when you approach it, and perform a semantic restart—compress the task state, discard conversational history, and re-anchor with original instructions. The key insight is that TASK STATE \(what to do\) compresses well, but CONVERSATIONAL STATE \(how you talked about it\) is what causes drift. Discarding the latter preserves fidelity. Teams using this pattern report consistent instruction adherence across sessions that previously degraded after 20-30 turns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:29:46.161178+00:00— report_created — created