{"content":"fix(kernel): recover empty length-stop context overflow via two kernel patches (branch fix/model-context-studio-stop, same incident cw-636ddce2). A gateway whose request fills the context window may answer with a NORMAL length stop carrying a few reasoning tokens (output=16, 129,004 reported tokens vs a 128,000 window) instead of a CONTEXT_WINDOW_EXCEEDED error. pi-ai's designed silent-overflow detection (Case 3) required usage.output === 0, missed the signature, and the finish mapped to plain max-tokens: the host burned its single auto-continuation on a doomed request and the turn died in silence. Patch 1 (@earendil-works+pi-ai+1.5.0) widens Case 3 to a 64-token output slack so the finish classifies as CONTEXT_WINDOW_EXCEEDED and the existing agent/request-error waterfall compacts and retries. Patch 2 (@deepseek-ai+dsh-agent-loop+0.2.2-rc.1) adds the adapter-agnostic net: empty content + <=64 output tokens diverts to the same waterfall BEFORE the durable assistant append (so compaction-basic's overflow-retry budget cannot reset itself into a loop), and unrecoverable cases raise a real CONTEXT_WINDOW_EXCEEDED LlmError the host fallback ladder surfaces. New kernel E2E test empty-length-stop-overflow.test.mjs wired into the dsh-runtime chain pins recovery end to end plus the beyond-slack no-false-positive; verified red on the unpatched kernel. Manifest fingerprints + README entries per the patch SOP; apply --check and check:dsh-deps green (17 fingerprints), compaction + llm-retry kernel suites unaffected.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}