Repository navigation
Over-limit exits: structurally doomed preflight answers 413, emergency nudge backs off per session - #3467
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4137-pr.3467.76bbae7This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3467.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。本 PR 对应 #3461 的问题 2a/2b;正文已声明问题一与在途 PR #3447 重复(同一机制、共享 开始独立审核:已拉取 |
21a30b5 to
9cda2c7
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复(与首条回复一致)。另核实了与在途 PR #3447 的关系:#3447 只动 审核方式:独立通读全部 16 个文件 diff(prpreflight/server/budget/handle/session-self-heal/4×prepare + 7 个测试),未照抄 PR 描述结论;在 PR head 本地重跑 typecheck 与定向测试;逐条对照代码验证行为变更披露。 审核中发现并已闭环的一个问题:最初推送的 commit 八问
行为变更清单(独立对照代码核验,与 PR 描述一致)
测试有效性新测试断言有牙:单测钉死 验证证据
收工判定:未发现阻塞问题,CI 在 |
|
冲突 |
9cda2c7 to
9802547
Compare
…ergency nudge backs off per session (#3461) Problem 2a (host-side): when preflight exhausts every foldable range and the gap cannot close by construction (futility math with no unusable draws, nothing-compressible exits, zero-dispatch exits), the final fail-fast now answers 413 non-retryable instead of 502. Relay-dependent exhaustion (empty/truncated/incomplete summaries, budget draws, pool saturation, sticky verdicts) deliberately stays 502 — retry/canary machinery owns that class. PreflightFailure gains an optional deterministic marker set only at the structurally doomed sites. Problem 2b: the emergency tier-1 nudge arm was a pure function of contextUsage >= 0.7, so a headless client retrying an over-window turn re-injected the EMERGENCY prompt on EVERY request (measured 7 injections in 1 second). emergencyNudgeArmed() now gates the arm per session: first pressure round injects, then re-arms only when a reduction landed (reductionKeyOf changed), a full flat growth step (default 50K, KDD#8) of tokens accumulated, or the 10-minute valve elapsed. Pressure admitted by every standing gate but held by the backoff reports nudgeOutcome 'gated' so self-heal streaks (#2155/#3004) keep crediting active rounds instead of starving. Test updates follow the status mapping: structurally doomed byte-relay/image lanes (issue1841 A, issue496 r2/r3, issue767, issue857) now assert 413; issue1841 B (fixture relay always returns empty summaries) reverts to 502 as relay-dependent; issue2155 idle-loop arithmetic pins the gated-round credit.
9802547 to
e54cabd
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.525-master.63556d8 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Follows #3461 (fixes problem 2b + problem 2a host-side; problems 1 and 3 await owner decisions)
What & why
Real-model load testing (qwen3.8-27b @ sglang) found that an over-limit turn dead-ends in a 502 loop with no exit while EMERGENCY-tier nudge prompts get re-injected on every client retry (measured 7 injections in 1 second). Two independent fixes:
Problem 2a (host-side): structurally doomed preflight now answers 413 instead of 502. When preflight exhausts every foldable range and the gap cannot close by construction — futility math fired without any unusable draw, nothing-compressible exits, zero-dispatch exits — the final fail-fast answers 413 non-retryable (the #2847/#2921 convention: the content cannot fit, retrying cannot change the verdict). Relay-dependent exhaustion (empty/truncated/incomplete summaries, budget draws, pool saturation, sticky verdicts) deliberately stays 502 — that class is owned by retry/canary machinery.
PreflightFailuregains an optionaldeterministicmarker set only at the structurally doomed sites.Problem 2b: per-session backoff on the emergency nudge arm. The EMERGENCY tier-1 arm was a pure function of
contextUsage >= 0.7, so a headless client retrying an over-window turn re-injected the EMERGENCY prompt on EVERY request.emergencyNudgeArmed()gates the arm per session: the first pressure round injects, then re-arms only when a reduction landed (reductionKeyOfchanged), a full flat growth step (default 50K, KDD#8) of tokens accumulated, or the 10-minute valve elapsed. Pressure admitted by every standing gate but held by the backoff reportsnudgeOutcome: "gated", so self-heal streaks (#2155/#3004) keep crediting active rounds instead of starving — without this, zombie-lane D2 degrade would never arm under the new backoff.Behavior changes (old → new)
gated) — D1 suppression and zombie-lane degrade still arm exactly as before; they would have starved under the new backoff otherwise.Not covered here (owner decision needed, tracked in #3461)
ResponsesWsUpstreamegress covers both codex and opencode lanes. Recommend merging WS client lane: fall back to HTTP/SSE egress when the upstream refuses the upgrade #3447 rather than a parallel fix.compress.promptPack: "lean",compress.injectTool: false).Verification
tests/issue3461-overlimit-exits.test.ts: unit pins for the gate (storm 7→[true,false×6]; re-arm on landed reduction / growth step / wall-clock valve; no stamp below the escalation line; shouldInject bypasses without consuming the gate) + real-proxy e2e (anthropic lane, window 4000): over-window turn → 413 + "NOT forwarded", identical retry → 413 replayed via the [Bug] Codex 额度中断后恢复长会话,preflight SSE 摘要为空并持续 502 #726 cooldown with zero upstream calls.testlanes).查重: 问题一与在途 PR #3447 重复(同一机制,共享 egress 覆盖两条 WS lane),不另开修复;问题二/三无重复项(检索 open+closed issue/PR:超限死锁与紧急提示风暴、surface 成本均无既有条目,#2438/#3452 同家族但生产端不同)。