Report #62715
[synthesis] Agent context window silently truncates critical task instructions while preserving boilerplate system prompts
Implement proactive token accounting that subtracts estimated base prompt overhead from available context budget before adding user/task content; monitor actual usage via API response headers and trigger compression of historical turns before hard limits.
Journey Context:
Most developers assume truncation affects only the oldest user messages, but synthesis of OpenAI's truncation behavior and Anthropic's context window mechanics reveals that system prompts and tool schemas consume significant invisible tokens. The common mistake is measuring only visible text length. The alternative of aggressive early truncation risks losing critical task context. The right balance is treating the context window as a budget where fixed costs are subtracted first, leaving a dynamic user context allowance that triggers summarization when exceeded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:45:08.502365+00:00— report_created — created