Skip to content

[PR] fix(codex): Codex lane minor fixes roundup #3 — WS error object + marketplace containment + Google part ordering | fix(codex): codex 车道小修合集第三辑 —— WS 错误对象 + marketplace 收容 + google part 序 - #5971

Merged
ranxianglei merged 5 commits into
masterfrom
2026-11-09_codex-lane-small-fixes-batch
Nov 9, 2026

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

三个已评审小修合并送审(一 PR 一合)

来源 PR 内容 关闭 issue
#4624 codex WS 车道:升级/超限失败回对象错误帧(含 verbatim 透传超限时"图 shed 不适用"提示),不再裸字符串 #4601
#5586 codex 插件:marketplace Git 仓库放进 overlay tmp 收容区,过 "Codex home" 收容检查 #5584
#5397 google wire:Claude-through-Google 目标保持 tool_result 首序(内核 codec model-aware) #5392

kernel-change 声明(#5397 携带,原文)

kernel-change: make normalizeGoogleUserPartOrder/coreToGoogle model-aware so Claude-through-Google targets keep tool_result-first part order. The host side cannot solve this: the offending reorder happens INSIDE the kernel codec (coreToGoogle's flushUser), and the stable text-first partition is non-invertible (an interleaved [fr,text,fr,text] collapses to [text,text,fr,fr]), so no host-only workaround exists. Owner approval via decision request #5393 (option A).

冲突处理(合入 master 848f59b 时)

  • src/server/relay.ts:master 已在 5 处 continuation-retry 调用加 model: throttleModel(KeyRing 隔离),[PR] fix: keep tool_result-first google part order for Claude targets (#5392) #5397 在同批调用加 model: prepared.model ?? prepared.google?.model(nudge 保序)。取并集:model: throttleModel ?? prepared.google?.model(p 变体同式),单键;throttleModel 已含 prepared.model/body 派生,google 兜底垫底,两个消费方都满足。
  • kernel/package.json:本 PR 基线是 0.0.175→0.0.176,master 已到 0.0.188 → 按纪律 bump 到 0.0.189。

预检(本地,2026-11-09)

  • npm run build OK,tsc --noEmit 0 错
  • 三 PR 自带套件 27/27(issue4601-ws-failure-frame / codex-overlay-tmp-containment / issue5390-claude-google-part-order / kernel wire-google)
  • 相邻消费方 88/88(wire-contract / plugin-empty-turn-retry / issue4743-degenerate-refetch-429 / fake-completion / issue1815 / issue3159-vertex-nudge-order)

Closes #4601
Closes #5584
Closes #5392

…gle targets (for #5397, closes #5392)

kernel-change: make normalizeGoogleUserPartOrder/coreToGoogle model-aware so Claude-through-Google targets keep tool_result-first part order. The host side cannot solve this: the offending reorder happens INSIDE the kernel codec (coreToGoogle's flushUser), and the stable text-first partition is non-invertible, so no host-only workaround exists. Owner approval via decision request #5393 (option A). Kernel version 0.0.188 -> 0.0.189 (master was already at 0.0.188 past this PR's 0.0.175->0.0.176 base bump).
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-09_codex-lane-small-fixes-batch (54ce2be)

Latest build — install this exact version

npm install -g billion-context@0.0.8690-pr.5971.59b6df5

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
54ce2be billion-context@0.0.8690-pr.5971.59b6df5 build
50e4cdc billion-context@0.0.8683-pr.5971.be71a81 build
86aae0d billion-context@0.0.8680-pr.5971.4cf7e04 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5971.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(codex): codex 车道小修合集第三辑 —— WS 错误对象 + marketplace 收容 + google part 序 [PR] fix(codex): Codex lane minor fixes roundup #3 — WS error object + marketplace containment + Google part ordering | fix(codex): codex 车道小修合集第三辑 —— WS 错误对象 + marketplace 收容 + google part 序 Nov 8, 2026
The PR bumps kernel/package.json 0.0.188 -> 0.0.189 (required by the
Kernel Boundary for the kernel/src/wire/google.ts change) but left both
lockfiles at 0.0.188. Regenerated with npm install --package-lock-only
(matching the lock-sync CI job) so the embedded kernel entry in the root
lock and the kernel lock's own version line agree. Mechanical lockfile
sync only — no dependency or source change.

Fixes #5971
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Fixed the lock-sync failure on this PR.

Root cause: the PR bumps kernel/package.json 0.0.188 → 0.0.189 (required by the Kernel Boundary for its kernel/src/wire/google.ts change) but left both lockfiles at 0.0.188. The lock-sync job regenerates both lockfiles with npm install --package-lock-only and fails on any diff — so it caught the two stale version lines.

Fix: regenerated both lockfiles with the exact command the job uses (npm install --package-lock-only --ignore-scripts) and committed the result. The diff is purely 3 version-string updates:

  • root package-lock.json: embedded kernel entry 0.0.188 → 0.0.189
  • kernel/package-lock.json: top-level + root-package version 0.0.188 → 0.0.189

No dependency, source, or behavior change — pure lockfile sync. Pushed to 2026-11-09_codex-lane-small-fixes-batch (commit 50e4cdc3ad). Remote head was unchanged so no rebase was needed; no force-push.

Verification: reproduced locally first (ran the job's exact commands → identical 3-line drift), then confirmed live: on head 50e4cdc3ad, lock-sync reports success. Note: the mirror check cache was lagging (~5 min stale and not surfacing the new lock-sync row), so I confirmed via a single direct check-runs pull rather than looping. The remaining matrix lanes (test / static-gates) were still in progress and are unaffected by a lockfile-only change.

审查结论(结构化)

  1. 是什么问题:PR 把 kernel/package.json 从 0.0.188 升到 0.0.189,但两个 lockfile 还停在 0.0.188,lock-sync 检出漂移而红。
  2. 什么原因导致的:内核版本按 Kernel Boundary 规则随 kernel/src/wire/google.ts 的改动正确升级了,但配套的 package-lock.json / kernel/package-lock.json 没有重新生成,版本行没跟上。
  3. 影响范围与严重程度:仅 CI 门禁红,不影响任何运行时行为或用户;属纯构建卫生问题。
  4. 怎么修复的:用 lock-sync 任务本身用的命令(npm install --package-lock-only)重新生成两个 lockfile,提交这 3 处版本行更新——对齐而非手改。
  5. 是否有回归问题:无。改动只动 lockfile 的版本字符串(0.0.188→0.0.189),不碰依赖、源码、wire、默认值或时序;其余矩阵腿不受锁文件变更影响。
  6. 是否破坏缓存:不涉及——无缓存/重试/增量游标/去重键相关改动。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:lock-sync 已转绿,机械性修复完成,可继续等全量矩阵跑完后合并。

…ile name

#5392 is an unrelated open DSH pruner bug and #5585 an unrelated compaction-leak
issue; the real source threads are #5390 (Claude-through-Google tool_result-first
part order) and #5584 (codex marketplace .tmp containment). Comments and the
test file now cite the verified GitHub numbers.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

[PR] #5971 审核结论:代码与行为均通过,已就地修复 2 处引用错误;剩 CI 重跑 + owner 人工合并(kernel-change = human-only 档)。

查重

不重复 —— 本 PR 是该批工作的唯一 open PR;三个来源 PR(#4624 / #5586 / #5397)均已 closed-not-merged,被本合集 superseded(正常)。

独立审核过程(未复用 issue/来源 PR 侧结论)

  • diff 全量通读:17 files / +656−59,分支 0 behind master,无 stale-base。
  • CI live 核查(镜像缓存为空,单次 API 拉取):head 86aae0d 45 checks 仅 lock-sync 红(kernel bump 后 lockfile 版本行不同步)→ 审核期间分支被推入 50e4cdc(恰好只修这 3 行版本)→ 复核 50e4cdc 全绿:56 runs,40 success / 16 skipped / 0 fail。
  • Kernel Boundary 逐项:kernel-change 声明在正文 ✓;version 0.0.188→0.0.189 合规 ✓;golden pin tests/golden/wire-contract/kernel.json 未动(签名均为 additive optional 参数,默认路径字节不变)✓;kernel 回归测试双向有牙(claude 返回同一引用 / 非 claude 重排为 [text,fr])✓;WC-018 ledger 条目是扩展不是收缩 ✓。
  • relay.ts 并集式必要性命证:google wire 请求不设 Prepared.model(prepare-google.ts:414 只给 prepared.google.model),故 throttleModel 回落到 body 派生(google body 无 model → undefined)——throttleModel ?? prepared.google?.model 同时满足 KeyRing 隔离(优先)与 nudge 保序(兜底),与正文描述一致 ✓。
  • 测试有效性:3 个新套件都是真测试 —— WS 套件走真 server+WS fixture 断言帧内容且含 2 个负向门(HTTP 车道 string 契约不变、admission 帧形状不变);overlay 套件含复现旧逃逸行为的负向对照;e2e part-order 断言转发字节流首个 part 为 functionResponse,第二例钉死非 Claude 目标仍走 text-first(WC-018 保留)。

发现并已就地修复的问题(不只报告)

  1. PR 正文 Closes #5392 指向错误 issue(高危):GitHub [Bug] Host-side tool-result pruner mutates folded messages → permanent fold residual (614 ids) re-reported every turn, v0.1.210 plugin lane #5392 是一个无关的 open bug(DSH pruner fold residual 614 ids)。合并会误关它。真实来源 issue 是 Compatibility update for calling Claude APIs via Antigravity *cough cough* #5390(外部用户报的 Claude-through-Antigravity 兼容问题)。已 PATCH 正文 Closes → Compatibility update for calling Claude APIs via Antigravity *cough cough* #5390。
  2. kernel-change 声明引用 "blog:frequent-compression — Comment Section | blog:frequent-compression — 评论区 #5393":该编号实际是一个 blog comment section(closed);真实 decision request 是 decision request: model-aware Google-wire part order for Claude-via-Antigravity (kernel change, #5392) #5391。已 PATCH 正文。
  3. 代码注释/测试名共 21 处错误引用(12×[Bug] Host-side tool-result pruner mutates folded messages → permanent fold residual (614 ids) re-reported every turn, v0.1.210 plugin lane #5392→Compatibility update for calling Claude APIs via Antigravity *cough cough* #5390、9×Compaction-based reclamation is still very limited. It looks like there are still leaks. | 压缩回收依然很少 貌似还有泄露 #5585→[Bug][Codex Launcher] Marketplace Git repositories escape CODEX_HOME through Bili .tmp symlinks #5584,Compaction-based reclamation is still very limited. It looks like there are still leaks. | 压缩回收依然很少 貌似还有泄露 #5585 亦为无关 issue)+ 测试文件改名 issue5392-… → issue5390-claude-google-part-order.test.ts:独立 commit 54ce2be 已推送(纯注释+改名,零逻辑变更)。
  4. PR 零标签:已按本 PR 自身 diff 打上 bug / p1 / scope/kernel / codex / antigravity(p1 = claude-through-Google tool turn 400 属可用性硬断)。

行为变更清单(old → new,全部有意,Deliverables 第 4 条披露)

  1. Claude 家族目标经 Google wire:user parts 不再被无条件 text-first 归一化 → 保持 tool_result-first(原路径 400 坏;非 Claude 目标字节相同,负向测试钉住)。
  2. codex overlay .tmp:不再从 real home symlink 进 overlay、退出时不再 merge-back → bili 下装的 marketplace repo 留在 overlay .tmp,直接(非 bili)codex 启动不可见需重新 clone。这是收容的固有代价(共享 .tmp = 逃逸 = Codex 拒更新),正文未写,此处补披露。
  3. WS lane 错误帧:error 字段由裸字符串改为对象 {code,message}(仅 WS 车道;HTTP 车道 string 契约保留,测试钉住)。
  4. 1009 oversize 诊断:verbatim passthrough body 现在报真实字节数 + 诚实原因(原 "0.0 MiB" + 虚假 "no sheddable images")。

八问

  1. 是什么问题:三个独立小缺陷 —— codex WS 车道升级/超限失败回字符串错误帧(客户端干等 idle timeout);marketplace git 仓库经 bili 的 .tmp symlink 逃出 CODEX_HOME(Codex 拒更新);Claude-through-Google tool turn 因 part 序错而 400。
  2. 什么原因导致的:WS 车道直接复用 HTTP proxy-failure body(string error)未按 codex 反序列化的对象契约转换;overlay 对共享条目无差别从 real home symlink,.tmp 不在例外表里;kernel codec 的 WC-018 text-first 归一化是无条件写的,而 Anthropic-behind-Google 需要相反顺序。
  3. 影响范围与严重程度:p1 面 = 经 Antigravity/Google-v1internal 调 Claude 的用户(tool turn 完全不可用);p2 面 = codex WS 车道失败体验 + bili 下 codex marketplace git 源更新被拒。
  4. 怎么修复的:WS 单一转换点转对象帧 + Buffer body 诚实计量;overlay 把 .tmp 列为 local-only entry(不 link 进、不 merge 回、清理旧逃逸 symlink);kernel codec 加 model-aware 可选参数,命中 /claude/i 跳过归一化,host 各 google-wire 边界透传目标 model。
  5. 是否有回归问题:逐项审过既有行为 —— 非 Claude google 目标 part 序字节相同(WC-018 保留+负向测试);HTTP 车道错误契约不变(测试钉住);admission 帧形状不变(测试钉住);非 .tmp 条目 overlay link/merge-back 行为不变(负向对照验证旧路径仍工作);relay model 并集不改 KeyRing 隔离语义(throttleModel 优先,google 仅兜底)。未发现回归。
  6. 是否破坏缓存:不涉及 —— 前缀缓存锚点(head system / byte-stable prefix)未动;唯一字节变化在原本就 400 的 Claude-through-Google 路径上。
  7. 是否改了设计方向:否。kernel codec 增加 model-aware 维度(additive optional param),与 host 侧 model 透传惯例一致;方向由 decision request decision request: model-aware Google-wire part order for Claude-via-Antigravity (kernel change, #5392) #5391 option A 定。
  8. 是否引入新配置:不涉及。

合并判定

代码层面 ready,剩两件事:① CI 在新 head 54ce2be 重跑(纯注释/改名,预期绿,现 pending);② kernel-change 属 human-only 档,请 owner 确认 #5391 option A 批准(GitHub 上未见 owner 明确文字,只有创建 4 分钟内的 close 动作 + 两条 agent 记录称「拍板」)后人工合并。合并将自动关闭 #4601 / #5584 / #5390。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 更新(实时核查):head 54ce2be 全部 workflow 绿 —— 主 CI(含 lock-sync / kernel-guard / static-gates)、全部 e2e 车道、Theorem Lane、Windows codex overlay 均 success。期间出现的 52 个 cancelled 是同批触发被并发组自动取消的重复 run,每个 workflow 恰好留一个幸存的绿 run,无遗漏。

PR 现态:open / mergeable,只等 owner 人工合并(kernel-change = human-only 档;合并前请顺带确认 #5391 option A 批准)。

@ranxianglei
ranxianglei merged commit ec4b9f7 into master Nov 9, 2026
100 of 144 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1098-master.ec4b9f7 (rolling master tag).

npm install -g billion-context@0.0.1098-master.ec4b9f7  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 9, 2026
…sis, ranxianglei#5949 relocated fold summaries, ranxianglei#5971 codex lane fixes, ranxianglei#5961 compress-burst loop fix

Advances the base from 848f59b to 33d4951 (20 commits, 43 files). The only
overlap with this lane is src/pipe-free relay.ts; upstream touched the WS
oversize diagnosis, outbound stamping and continuation refetch paths, while the
lane's non-streaming compact egress sits at src/server/relay.ts:2103. Both
survive — the auto-merge needed no manual resolution.

Notable upstream commits adopted:
 - cc1e240 kernel: relocate-compress v2 — summary text moves to the fold point
 - e03cc4b Stop the compress-burst loop: ack fold-point pointer echoes
 - 725084b feat: context analysis — init size, nudge cadence, harvest acceptance
 - 3fcf41e fix(codex): answer WS-lane failures with object error frames (ranxianglei#4601)
 - 86aae0d fix(google): keep tool_result-first part order for Claude-through-Google
 - d3fab0d fix(codex): keep marketplace Git repos inside the codex overlay tmp
 - 50e4cdc fix(ci): sync root + kernel lockfiles to acp-kernel 0.0.189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment