Report #88759
[agent\_craft] System prompt with dynamic sections \(few-shot examples, documentation\) exceeds token limit, silently truncating critical base instructions
Implement a 'budget' allocator: reserve fixed token counts for base instructions \(immutable\), dynamic examples \(compressed/selected\), and user context; if dynamic content exceeds its budget, drop lowest-relevance items rather than truncating the end of the prompt \(which often contains the immediate task\).
Journey Context:
Naive string concatenation often puts lengthy few-shot examples first, pushing the actual current task to the truncation point. The 'lost in the middle' effect means content at the start and end is most retained. Therefore, place immutable system rules at the start, the immediate user query at the end, and compress/drop middle context \(retrieved docs\) if needed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:34:01.468219+00:00— report_created — created