Repository navigation
[PR] fix: judge codex compaction gate against the request's own view - #4040
ranxianglei wants to merge 1 commit into
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重: 本 PR 是 #4036 的修复交付(Closes #4036),与 #3844/#3845(zombie reap)、#398(短请求路由隔离)、#335(gate-before-prepare 约束)、#3008/#3018(estimate-grade 幻影基线)机制均不同——不重复。PR 自身无重复在途条目。 标签: pr / bug / codex / scope/wiring / p2 —— codex 宿主车道 compaction gate 误判;能用,特定时序下超大原始请求被静默直转上游。 这是上一会话处理 #4036 时开的 PR,按规范我不重做工作,而是做独立审核:拉分支通读全部 diff → 触碰路径的既有行为逐项回归审计 → 测试有效性(断言是否有牙、回归时抓得住吗)→ CI 状态核查。结论按结构化八问回复。 |
0f425b6 to
8217164
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4861-pr.4040.0347013This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4040.tgz
npm install -g packageInstall instructions are refreshed on each push. |
b63092a to
b436fd0
Compare
(ai: vllm-qwen/qwen3.8-27b) PR #4040 审核结论(独立重审 + rebase 冲突解决 + CI 事件处置) 八问
过程事实
判定:无阻断发现,主 CI 车道转绿即可合并。标签:pr/bug/codex/scope/wiring/p2(首条回复已打)。 |
(ai: vllm-qwen/qwen3.8-27b) 主 CI 红项定性完成:全部属于已知 master flake 家族,非本 PR 引入。 八问(本轮 CI triage)
查重声明:CI 红项未新开 issue——已存在 #4063/#4049/#4051/#4039/#4041 一族跟踪条目与 #4058/#4067 两个在途修复 PR,按 master 红风暴防线只在 #4063 下补证据,不重复立项、也不并行开修。 判定更新:代码面结论不变(可合并);绿 CI 取决于 #4058 或 #4067 落地。不建议现在逐轮 rerun(#4061 先例:rerun 后同签名再红,纯耗算力)——flake 修复合入后重跑一次即可。若 owner 想现在就盖绿章,手动 re-run failed jobs 一次也可,我这边不再自动触发。 |
b436fd0 to
814a2cd
Compare
(ai: vllm-qwen/qwen3.8-27b) CI 处置结论(head 先说结论:这轮 CI 红不是本 PR 代码的问题。5 个失败 shard 挂的全是仓库里既有的、与本 PR 无关的抖动测试(#3769 存储模式 + #2399 v2 fork),而它们已经在 master 上被修好了( 八问
判定:无阻断发现。分支已对齐当前 master,之前红 shard 的根因(存储模式抖动)由继承的 master 修复解决;待新 head |
Closes #4036
What
The Codex compaction gate (
codexCompactGatePre) decided whether to intercept acompaction_triggerfrom the session's stored block state — but that state was last written by the previous request's view. Field sequence from #4036: a short side request (2 msgs) ransyncBlockson a view carrying no fold carriers → all blocks retained but setactive=false→ ~12s later a trigger carrying the full 3580-message history arrived; itsgatePrewas computed before any prepare/sync could re-activate the blocks → gate false → the 18.5 MiB trigger forwarded verbatim → upstream 400Unsupported parameter: generate.Fix (decision-point judgment, not deactivation isolation)
codexCompactGatePrenow takes an optional third argument — the trigger request's own message view (projected to core messages). When present, fold activity is judged on a pure probe:syncBlocks(viewMessages, session.state)(kernel function, already public; it deep-clones its input state and mutates nothing) instead of the stored flags. When absent (unparseable view) it falls back to the legacy stored-flag check — byte-for-byte old behavior.src/codex-compact.ts— optionalviewMessages?: CoreMessage[]parameter; doc comment cites [Suspected][Codex] After the short view deactivates blocks, the immediately following compaction trigger may be erroneou | [Suspected][Codex] 短视图失活 blocks 后,紧接着的 compaction trigger 可能被 gate 误放行 #4036 + the fix: detect codex compaction requests before preflight; verbatim passthrough when not intercepted (#332) #335 purity invariant.src/server/handle.ts(trigger form) — projects the parsed trigger body once through the existing host projection (responsesToCoreWithToolImages; same content-derived ids the kernel uses) and passes it to the gate.src/server/prepare-responses.ts(endpoint form/responses/compact) — same treatment; the projection is hoisted so the transform stage reuses one conversion.[limit=… baseline=…(source) active=N/M@view|@stored inboundMsgs=N]so this class of event is diagnosable without a second incident (prior view cardinality is the immediately precedingprocessTurn: N msgstee-log line).Deliberately NOT done (per the issue's warning):
runPrepare()is still not run before the gate — the non-intercept path stays byte-identical passthrough with zero session mutation (#335). The probe is read-only.Behavior changes (old → new)
No config surface change. No kernel change. No wire-shape change (intercepted requests were forged identically before; passthrough bytes unchanged).
Tests
tests/codex-compact.test.ts— new 4-row matrix oncodexCompactGatePre: stored-inactive + carrier in view → forge; stored-active + carrier absent → honest passthrough; no view → legacy judgment; view does not loosen the 90% wall.tests/codex-compact-e2e.test.ts— two pipeline tests implementing the issue's recommended real-pipeline regression exactly: (a) seed compressed main session → short side request on the same session id (asserts blocks retained but all inactive) → immediate full-history trigger → asserts forged SSE, zero upstream calls, blocks re-activated; (b) negative: trigger whose own view carries no fold is forwarded byte-identical AND leaves session state JSON-identical (no prepare ran). Both RED on pre-fix master (verified), green post-fix.Out of scope (noted in #4036 thread)
Why the 2-message side request entered the MAIN session at all is the #398 routing-isolation domain — separate mechanism, separate fix.