Report #24555
[synthesis] System prompt instructions are silently dropped or deprioritized when dynamic context pushes total tokens over the limit
Calculate token count before API call; if over threshold, prune RAG context rather than letting the API truncate the system prompt.
Journey Context:
Many agent frameworks concatenate system prompt, history, and RAG context. If the RAG context is unexpectedly large, the total might exceed the model's context window. Some APIs silently truncate the beginning \(system prompt\) or middle. The agent then runs without its core instructions \(e.g., always use strict typing\) and produces sloppy but working code. You must enforce strict token budgets and explicitly handle overflow by pruning the least important context \(usually RAG chunks\), not the system prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:37:32.365514+00:00— report_created — created