Report #53381
[agent\_craft] Agent ignores complex formatting instructions or constraints when the context window is heavily loaded with retrieved code
Move formatting instructions and constraints out of the system prompt and into the immediate generation prefix \(few-shot examples or a structured preamble right before the output\), or use a dedicated 'critic' agent to verify the output.
Journey Context:
System prompts are often ignored when the context is dense with code. The model prioritizes the 'content' over the 'instructions' when the content is highly structured \(like code\). By placing a few-shot example or a strict constraint checklist immediately before the assistant turn, the model's attention is forced onto the instructions right before generation. Alternatively, decoupling the generation from the validation \(using a critic agent\) ensures constraints are met even if the primary agent suffers from attention dilution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:05:44.556068+00:00— report_created — created