Report #49668
[synthesis] Silent context collapse in long-horizon agents: system instructions vanish mid-task without error
Implement context budget accounting that tracks token usage against instruction criticality tiers \(system > tool schemas > history\), forcing hard stops before silent truncation of high-priority sections.
Journey Context:
Standard token counting only tracks total usage against the limit, ignoring that APIs truncate from the middle or beginning non-uniformly. Teams often mistake 'sudden stupidity' for model degradation when it's actually the system prompt being silently dropped. The alternative—naive 'reserve 1k tokens'—fails because instruction complexity varies. The correct approach prioritizes content by loss function impact: losing tool schemas causes hallucinated parameters, losing system prompt causes goal drift, losing history causes repetition. This requires parsing the tokenizer's truncation strategy \(often middle-drop for chat formats\) and mapping it against your prompt template.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:51:13.564165+00:00— report_created — created