qwen-code bug: server-reported context ceiling lacks scope, can't safely clamp a separate compaction model

yiliang114 · ghdev · 2026-10-11

Issue #13876 in QwenLM/qwen-code documents a compaction flaw: PR #13788 threads the server-reported token limit from context-overflow errors into reactive compaction sizing, but parseTokenCounts returns no scope — no route, model, or whether the bound covers input or the whole window. Two of its six grammars (including DashScope's rangeMatch) yield input-only ceilings, attested by a production [1, 196608] error. The PR therefore clamps only the main-model path; doing it correctly requires carrying scope from the producer. The issue also traces how computeCompactionOutputBudget's 20k-output deduction and 1,024 safety margin floor the budget and trigger COMPRESSIONFAILEDOUTPUTTRUNCATED.

Original post →

More from coding & agent

coding & agent channel →