Repository navigation
[PR] fix(preflight): use calibrated estimate in the no-compression fits check (#6395) - #6460
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9642-pr.6460.3f5f91bThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6460.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(bot) 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 本线程对应的在途 [PR] 只有 #6460 自己(已核对镜像 open [PR] 清单);同失败域的相关项是 PR #5899(fixes #5880),修的是 (A) overflow-arm evidence demotion + (B) anthropic egress clamp,与本 PR 的 (C) preflight fits-check 口径不一致是不同机制,不重复。 Live status (verified just now):
Review in progress: diff is 2 files ( |
…6395) The no-compression branch of the preflight fits check judged fit on the uncalibrated estimateCoreMessages while the trigger used the calibrated estimate (k̂-scaled). When k̂ > 1 the trigger fires (calibrated ≥ limit) but the fits check says the payload fits (uncalibrated < limit) → forwards a guaranteed-400. The if-branch (compression happened) already uses rebuiltCalibrated; the else-branch now uses calibratedPayload for the same reason. Fixes #6395
Review: PR #6460 is superseded by master — recommend closing rather than merging. I reviewed the PR against current master ( 1. The fix is already on master (identical).
2. Master's regression test is a strict superset of the PR's.
3. The PR's CI failure is already fixed on master.
Recommendation: close PR #6460 as superseded. The identical fix ( 八问
判定:不建议合并 — 修复、更全面的回归测试、CI 修复三者均已在 master;合并只会叠加一个冗余测试文件。建议以"已被 master 取代"关闭本 PR。 |
Status: the review is complete and already posted (the full 8-question review is the comment above) — nothing is pending or blocked. The session had actually finished: the review landed at 09:24Z and the run was marked completed at 09:26Z. The "stuck" alarm appears to have fired after completion (the process idled during final cleanup once the reply was already posted). No work was lost and no reply is missing. Conclusion (unchanged): PR #6460 is superseded by master — recommend closing.
Next step is yours: close the PR as superseded, or tell me to strip the redundant src hunk and keep only the #6395-named test. No blockers on my side. |
[ework] auto-fix stalled: test (windows-latest, 22, 4), test (ubuntu-latest, 24, 1), test (ubuntu-latest, 22, 1) — stopping for human review |
1 similar comment
[ework] auto-fix stalled: test (windows-latest, 22, 4), test (ubuntu-latest, 24, 1), test (ubuntu-latest, 22, 1) — stopping for human review |
b84a52f to
6855f65
Compare
(ai: vllm-qwen/qwen3.8-27b) Resolved the merge conflict on PR #6460 and pushed the rebased head. What happened
Result: PR merge state is now 八问
判定: 冲突已解决,PR 可合并( |
What breaks
When preflight compression triggers (calibrated payload >= limit) but finds 0 viable ranges to compress, the fits check in the no-compression branch used the uncalibrated
estimateCoreMessages+ overhead + imageTokens, while the trigger decision used the calibrated payload. When the calibration factor k̂ > 1, calibrated > uncalibrated, so the trigger fires (calibrated >= limit) but the fits check says the payload is under the limit → bili forwards a request that is guaranteed to be rejected with a 400 CONTEXT_WINDOW_EXCEEDED.This is defect (C) in the same failure domain as PR #5899 (fixes #5880): anthropic-wire + wrapper provider + near-wall → 400. PR #5899 fixes (A) overflow-arm evidence demotion and (B) missing anthropic egress clamp. This PR fixes (C) the preflight fits-check caliber inconsistency.
Root cause
src/server.ts:4400-4403(the else-branch, no compression happened):The if-branch (line 4381, compression happened) uses
rebuiltCalibrated < limit(calibrated). The else-branch used the uncalibrated estimate. The trigger at line 4093 usescalibratedPayload < limit. When k̂ > 1, calibrated > uncalibrated, so trigger fires but fits says under → forwards guaranteed-400.Fix
Use the same calibrated estimate in the fits check as the trigger uses:
Behavior change (disclosed)
Dup check
Fixes #6395