Repository navigation
Conversation
The codex clamp already applies effective_context_window_percent, which codex defines as the input share after reserving model output. Reserving bili's default 25% on top walled sessions below codex's own auto-compact point, so long sessions hit an unrecoverable 413 futile round. Skip the default reservation when the window came from codex-catalog or codex-models-cache. An explicit operator outputHeadroomMaxPct, a proven completion share and every raw-window source still reserve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复. Searched open+closed issues and PRs (mirror + GitHub full-text for 标签: Review in progress — preliminary state, full verdict to follow in a second comment:
|
|
ework |
…ew nit for ranxianglei#6165) The ranxianglei#6165 change re-ran resolveCompress with identical arguments to read outputHeadroomMaxPct, duplicating the resolution already done at the headroomCap site whose comment says it is resolved once so the side-request guard and the main-path reservation measure against the SAME capped window. Capture the resolved config once and reuse it; behavior unchanged. Reviewed by agent (ai: vllm-qwen/qwen3.8-27b).
…kips the reservation (review nit for ranxianglei#6165) The 'although protocol X is exempt' clause is now also reachable via the new codex-netted skip path, where the protocol is NOT exempt — the default reservation was skipped because the codex-aligned window already nets out codex's own output headroom. Make the clause conditional so incident logs attribute the right cause; old-path wording byte-identical. Reviewed by agent (ai: vllm-qwen/qwen3.8-27b).
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review complete — full verdict below (your ping arrived mid-work; this is the promised second comment). Verdict: correct root-cause fix, high quality, mergeable after human gate. Two small review nits were fixed directly as labeled commits on the PR branch (pushed, now part of the PR head What I verified independently
Nits fixed in-place (additive labeled commits on the contributor's branch):
Behavior change (disclosed, old → new + why): on the codex lane with a live-table-clamped window and no explicit operator cap, the default 25% output reservation is no longer applied — effective judging window 193800 → 258400 (the fix itself: codex's own 95% already nets out its output headroom, reserving again double-counted it and wall'd sessions below codex's own compact point). Side effect to be aware of: an explicit per-request budget field would also be ignored on such windows (real codex sends none — openai/codex#36180 — so no practical impact today). No config/wire/persistence change; non-codex traffic unaffected. Merge path: §7.4 auto-merge does NOT apply (default-value change = product decision → human gate). Suggested order: approve the external PR (unskips CI) → author rebases onto master (verified clean) → merge after green test lanes. 八问(中文结论)
收工判定:代码与测试质量达标,方向正确,两处小瑕疵已就地修掉并推上分支;等 owner 批准外部 PR 触发 CI 全量测试 + 作者 rebase 后即可合并。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Status check (re-wake): nothing new on the thread since the full verdict above — live-verified just now. Work is complete; the ball is with you:
PR head |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Closing summary (full verdict above): review of PR #6165 is done.
Remaining (yours): approve the external PR (unskips CI) → author rebases → merge after green test lanes. §7.4 keeps this human-gated (default-value change). Nothing further pending agent-side. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Restart notice acknowledged — nothing was actually stuck: the review finished before this and all deliverables are in the thread (full verdict + closing summary above). Live re-check just now: PR #6165 still open, unmerged, head |
|
Landed via batch PR #6464 (merged) — closing as superseded. |
…ew nit for ranxianglei#6165) The ranxianglei#6165 change re-ran resolveCompress with identical arguments to read outputHeadroomMaxPct, duplicating the resolution already done at the headroomCap site whose comment says it is resolved once so the side-request guard and the main-path reservation measure against the SAME capped window. Capture the resolved config once and reuse it; behavior unchanged. Reviewed by agent (ai: vllm-qwen/qwen3.8-27b). (cherry picked from commit 0252702)
…kips the reservation (review nit for ranxianglei#6165) The 'although protocol X is exempt' clause is now also reachable via the new codex-netted skip path, where the protocol is NOT exempt — the default reservation was skipped because the codex-aligned window already nets out codex's own output headroom. Make the clause conditional so incident logs attribute the right cause; old-path wording byte-identical. Reviewed by agent (ai: vllm-qwen/qwen3.8-27b). (cherry picked from commit 03af668)
Fixes #6164
Problem
On the codex lane the window is clamped to codex's live table value,
context_window x effective_context_window_percent(272000 x 95% = 258400). Codex defines that percent as the input share after reserving model output. bili then reserved its default 25% output headroom again (258400 -> 193800), which puts the preflight wall below codex's own auto-compact point (90% of 272000 = 244800). Sessions between those two numbers fail with an unrecoverable413 ... futile roundthat codex retries forever. Details and logs in the linked issue.Fix
src/codex-models.ts: newcodexWindowNetsOutputHeadroom(source), true only forcodex-catalogandcodex-models-cache(the sources that apply the percent).src/server/handle.ts: when the codex clamp came from one of those sources, the default output reservation is skipped, with a one-time[headroom] ... no output reservationinfo line naming the knob.compress.outputHeadroomMaxPct(any level), a proven completion share ([Bug][dsh native] preflight fold target sits ABOVE the engine's own denominator (1048576 vs 1000000) and the upstream-stated window from a 400 never feeds it — 'deficit 0' forwards an over-window payload → context_length_exceeded kills the turn #3450 path unchanged), and every raw-window source (client metadata,config.tomlwindow, bundled snapshot, 272K fallback, non-codex clients).max_tokensclamp against the native window is untouched.Test
New
tests/codex-window-no-double-headroom.test.tsdrives a real proxy with a codex user agent and a tempCODEX_HOME/models_cache.json(272000, default 95%):no second output reservation on a codex-netted window (pre-fix: 258400 -> 193800);outputHeadroomMaxPct: 0.1still reserves (258400 -> 232560);Related existing tests (codex window align, live window, #5243 catalog, #2096 headroom, #5191, fork nudge dead zone and others matching codex/headroom): 923 pass, 15 fail, 1 skipped across 44 files; the same 15 (tests/host-usage-postfold.test.ts and one in tests/launcher.test.ts, mostly 9.6 s timeouts) fail identically on unmodified master on this machine, so they are local-environment failures, not this change.
npm run typecheck: clean. Local runs on Windows 11 / Node 24.19.0 only; the full-suite verdict is the CItestlanes.Scope
Two source files plus one test. No config, wire or persistence change. Non-codex traffic is unaffected.
🤖 Generated with Claude Code