Part 13 of 16 · 2 min read
Mistakes that leave the wrong thing in the window
- Sending everything and calling it safe. Symptom: the request eventually gets refused, or costs climb without anyone noticing. Cause: no budget was ever written down as a number. Fix: pick a budget below the window limit and build every context against it.
- Forgetting the wrapper and the question cost tokens too. Symptom: a context that is supposed to be under budget comes in over it. Cause: the budget check only counted item bodies. Fix: pay for the wrapper and the question before choosing anything else, as the example's
buildfunction does. - Letting a correction sit beside the fact it corrected. Symptom: the model sometimes answers with a stale value even though the right one is also present. Cause: no supersede step, so both versions compete for the model's attention. Fix: give corrected facts a shared key and drop every item but the newest.
- Trusting word overlap on a vague question. Symptom: presence collapses on real-world phrasing that never says the exact words in the source. Cause: lexical selection has no notion of meaning, only shared words. Fix: expand the query, or move to retrieval that ranks by meaning (module 4).
- Treating a rule like any other candidate. Symptom: the agent breaks its own rule precisely when the context is most crowded. Cause: the rule was never pinned, so it competed for space with everything else. Fix: pin every rule and pay for it first, unconditionally.
- Inserting tool text into the context unescaped. Symptom: a tool result containing wrapper-like characters is read as a second, forged system block. Cause: no escape step before fencing. Fix: escape every item's own text before wrapping it in the real header.
- Confusing presence with use. Symptom: a failure gets blamed on "the model ignored the context" when the answer was never shown to it at all. Cause: no log of what was actually assembled and sent. Fix: log the rendered context on every failure, so the two causes can be told apart.