Report #21385
[synthesis] Agent ignores critical system instructions mid-task without throwing errors
Explicitly check token count against model limit before each step; implement a 'critical instruction checksum' that verifies core constraints are still present in the context window.
Journey Context:
Most agents assume context window overflow throws an error, but OpenAI and Anthropic APIs silently truncate from the middle or end depending on implementation. The common mistake is putting instructions at the beginning of a long conversation—when truncation hits, the system prompt is preserved but the middle turns containing the actual task constraints get dropped. Alternative approaches like 'summarize and continue' often lose negations \('do NOT delete X'\). The right call is to maintain a running token count and hard-stop before the limit, or use the 'middle-out' truncation awareness to keep recent turns plus original system instructions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:17:51.415236+00:00— report_created — created