Repository navigation
[PR] fix(#4521): codex local auto-compaction rebase on the OpenAI wire lane - #4542
Conversation
d8384ff to
62df243
Compare
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6178-pr.4542.d8f4825This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4542.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) PR #4542 审核完成。结论:代码与方案通过,等 rebase + 远程 CI 绿即可合。 当前状态:head 仍是原提交 结构化八问:
本地验证(定向,全量留给远程 CI):
判定:代码质量、门禁双向性、无双记、命名风格均达标,无需返工;conflict-worker 的 rebase 落地且远程 CI 绿后即可合并。我不碰 merge/close。 标签: bug / codex / scope/wiring / p2(OpenAI wire lane 检测缺口,~1 分钟自愈、无数据丢失 → p2;pr 标签沿用)。 |
(ai: vllm-qwen/qwen3.8-27b) 接力追平:分支此前 behind master,已 merge origin/master(无冲突)并推送( 背景:家族报告在持续新增——#4648(10-25 早)、#4688(10-25 午,v0.1.207 = 当前最新,纯 orphan-reap、clients 未解析)。本 PR 是「codex 走 OpenAI 车道时本地自动压缩不被识别」的根因修复,只要它不发版,这类事件就会一直落到 unannounced-rewrite/orphan-reap。与 #4650(报告证据覆盖)一起,这两个 PR 是收敛本家族的在途工作,都在等合并拍板。 |
master window commits 293ae65/de5e03659 bumped kernel/package.json to 0.0.165 without regenerating the lockfiles; lock-sync re-resolution then rewrites the stale recorded versions (root 0.0.163, kernel 0.0.164) and fails. Pure recorded-version sync via npm install --package-lock-only; no dependency or semantic change.
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1042-master.b947a03 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…anxianglei#4542/etc (conflict resolution for ranxianglei#5743) # Conflicts: # tests/opencode-rolling-cache-marks.test.ts
Closes #4521
What
codex configured for chat completions (
wire_api = "chat", or a declaredproviders[].protocol: openaioutranking the URL heuristics per #1909) rides bili's OpenAI wire lane — it never transits/v1/responses. The codex local auto-compaction detector (#2372) exists only in the responses lane, so its landings fell into the generic unannounced-rewrite path:unannounced-rewrite(unconfirmed-signal tier — banner wording "cause not identified") instead ofnative-compaction(handled tier);Field evidence (#4521 diagnostics dump, bili v0.1.205, win32): a codex session with
unannounced-rewrite+orphan-reap: reaped 8 zombie fold block(s), plus thenative compaction boundary: archived 0 … pruned ref maps to 17 live raw id(s)log line that only the openai-lane generic path produces.Fix
Port the #2372 detector to
src/server/prepare-openai.ts, same gates as the responses lane: codex host identity (isCodexHost, #3686) + active fold blocks + decimated fold coverage (foldCoverage) + the codex summary template prefix in resent history (carriesCodexLocalCompactionSummary) + the threshold constants (CODEX_LOCAL_COMPACTION_MIN_MISSING,missing*2 >= expected). On hit: recordnative-compaction, thenmarkNativeCompactionBoundary+reconcileNativeCompactionBoundaryback-to-back (the same immediate reset the responses/dsh lanes perform), and skip the generic rewrite path so nothing is double-recorded (same discipline as #1001/#2432). The block sits AFTER the dsh block, so a profile matching both keeps the responses-lane precedence (dsh wins there).Behavior change (flagged per owner policy)
For codex sessions riding the OpenAI wire whose local auto-compaction lands:
unannounced-rewriteledger event (unconfirmed tier), no state reset; orphan blocks cleaned ~1 min later by the zombie reap;native-compactionledger event (handled tier) + immediate same-request state reset (ref re-seed + ref-floor pinning).Both paths converge to the same healthy end state; the new path reaches it within ONE request instead of three drift passes, and the banner/ledger framing becomes accurate ("already rebased" instead of "cause not identified"). No change for any other client or lane.
Tests
New
tests/issue4521-codex-openai-local-compact.test.tsmirrorstests/codex-local-compaction.test.tson the chat-completions wire: positive e2e (rebase + ledger-kind pin + no double-record + post-compaction turn keeps working) plus three negatives (non-codex UA, decimated coverage without the template, template pasted with intact history). Verified the positive case FAILS on the unfixed source (repro) and passes with the fix. Existing suites green locally:codex-local-compaction.test.ts+codex-compact.test.ts(22/22); typecheck + build clean. Full-suite verdict: remote CI.查重: 不重复 — nearest relative is closed #2372 (the responses-lane fix); this PR covers the same mechanism missing on the OpenAI wire lane.