Skip to content

fix(launcher): exec-resume 尾部 -c 吞掉用户 -c model + 真codex persona e2e×2通道(URL/launcher) - #2282

Merged
ranxianglei merged 3 commits into
masterfrom
2026-10-07_e2e-codex-persona-ci
Oct 7, 2026
Merged

ranxianglei merged 3 commits into
masterfrom
2026-10-07_e2e-codex-persona-ci

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #2281

内容

1. 修复 launcher -c model= 被吞(src/launcher.ts)

codexRewriteInsertionIndex:provider rewrites 插入点从"prompt 之前"改为"resume 子命令之前"。直连真 codex 0.147.0 二分实证(见 issue 表格):任何出现在 resume 之后的 -c 都会让更早的 -c model=… 静默失效;rewrite 全部放在 resume 之前即规避。fresh exec 路径不变(无 resume → 旧的 prompt 前插入规则);-- 分隔符规则(#2260(D))不变。

2. 真 codex 二进制 persona e2e ×2 通道(tests/e2e/e2e-codex-persona.test.ts)

3. fake-upstream.mjs:oracle 行增 insLen(additive,既有 8 测试不依赖)。

4. .github/workflows/ci-e2e-codex-persona.yml:独立 lane,15min,ACP_TEST_E2E_FAKE=1,失败 artifacts。

验证

codex 实测事实(0.147.0,进测试注释)

…-c model fix

- tests/e2e/e2e-codex-persona.test.ts: two lanes against the REAL codex
  binary (pinned 0.147.0, fake upstream, zero tokens):
  * URL lane (/bili/ prefix routing): grow+fold, then AGENTS.md edit +
    gpt-5-codex switch, then a PURE gpt-5.1 switch — asserts fold state
    survives both drifts on one session, persona carrier byte-stable per
    model, switched model actually on the wire.
  * launcher lane (bili codex overlay, #2197): same shape; pins the
    exec-resume argv contract.
- src/launcher.ts codexRewriteInsertionIndex: insert the provider rewrites
  BEFORE the resume subcommand — any -c after resume makes codex-cli
  0.147.0 silently drop the user's earlier -c model=… (bisected against the
  real binary; launcher drift turns used to revert to the config default
  model without this).
- tests/e2e/fake-upstream.mjs: oracle rows gain insLen (additive).
- .github/workflows/ci-e2e-codex-persona.yml: dedicated lane, 15min,
  ACP_TEST_E2E_FAKE=1, failure artifacts.
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-07_e2e-codex-persona-ci (126f03c)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2406-pr.2282.b9821fd

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

Option B — Download artifact

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

Install instructions are refreshed on each push.

The launcher -c insertion fix and its tests cited #2289, which does not
exist; the bug is tracked under #2281 (the issue this PR closes). Comment-
and-test-name-only change, no behavior delta.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

已按 [PR] 流程核对完成的工作(未重做):拉取分支 2026-10-07_e2e-codex-persona-ci 审代码+测试,确认原 commit CI 22/22 全绿,并本地定向跑 launcher.test.ts(装依赖+构建 kernel 后)282 全绿。审中顺手修掉一个 traceability 小缺陷,已作为独立标注 commit 推到分支。

结构化七问

  1. 是什么问题:launcher bili codex exec resume … <prompt> 下,用户在同条命令行前部传的 -c model=… 被 codex-cli 0.147.0 静默丢弃(模型回退 config 默认);另真 codex 二进制两条通道(URL 改写 / bili 启动器)此前没有「切模型 + 改 AGENTS.md」的 e2e CI 覆盖。
  2. 什么原因导致的:codex-cli 0.147.0 的解析缺陷——同一条命令行上任何出现在 resume 子命令之后的 -c,都会让更早的 -c model=… 失效(issue launcher: bili codex exec-resume 尾部 -c 触发 codex-cli 0.147.0 解析怪癖,用户 -c model= 被静默丢弃 + 真二进制 persona CI 空缺 #2281 有直连真二进制的二分复现表)。bili 此前把 provider rewrites 追加在命令行末尾,恰好落在 resume 之后踩中该缺陷;URL 模式无尾部 -c 故不受影响。
  3. 怎么修复的:把 rewrites 插入点(codexRewriteInsertionIndex)从「prompt 之前 / 末尾」改为「resume 子命令之前」——所有 -c 都置于 resume 前即规避;fresh exec(无 resume)走安全插入(仅在末 token 确证为自由 positional 时插到它前面,绝不拆 value-taking flag 与其值,未知 flag 尾部保持 legacy append);补真 codex ×2 通道 persona e2e + 独立 CI lane(钉 0.147.0,零 token)。
  4. 是否有回归问题:审了 buildCodexArgs 触碰的全部既有行为——① -- 分隔符规则([v0.1.186 review] 汇总:#2187 子进程累积 / #2090 升级影响 / 发布小修 / codex×2 / 杂项(合并自 #2252–#2257) #2260(D))原样保留(仍返回 sep);② 新增「永不拆 value-taking flag 与其值」保护,未知/flags-only 尾部仍 append(= 现状兜底);③ 唯一行为面变化:fresh exec 首轮 argv 顺序由「rewrites 在 prompt 之后」变为「在 prompt 之前」(旧→新)。二者在 fresh exec 均有效(fresh 不触发怪癖),且新位置恰是已知正确的 exec -c … <prompt> 形状,功能零 delta —— 特此披露。CI 22/22 绿,共享 fixture 的 e2e-codex-fake 8/8 无回归。
  5. 是否破坏缓存:不涉及。改动仅是 spawn codex 时的 argv 构造,不碰 bili 的 session/prefix 缓存、折叠状态或去重键;e2e 显式断言折叠状态在两轮漂移后存活(summary 在 wire、哨兵值留存、payload ≤220k 无裸重放)。
  6. 是否改了设计方向:不涉及。仍在 launcher 既有 rewrite-insertion 机制内,只重定位插入索引,无架构/边界/数据流转向。
  7. 是否引入新的配置:不涉及。无新 env / config / 默认值。

测试有效性:e2e 有牙——drift 轮 wire 模型断言(URL:deepEqual([MODEL_B, MODEL_C]);launcher:== MODEL_B)就是 -c 修复的回归牙齿,override 若被忽略立刻红;单测断言精确 argv 序。非恒真/非 mock-only。

diff 整洁度:干净,5 文件全部服务于本 PR 目的(+679/-3);我追加的第 2 commit 为纯注释/测试名修正。

本次处置(小问题直接修):代码注释与 5 个测试名引用的 #2289 不存在(404),而本 bug 正是 #2281(本 PR Closes 的 issue)所描述。已将 6 处 #2289→#2281(commit cdcc1fb60,docs-only,零行为变更),本地定向验证通过后推至 PR 分支。

判定:可合(需人工合并)。说明:本 PR 含新增 e2e + CI workflow(capability surface)及上述 fresh-exec argv 顺序变化,非纯 fix:,按 §7.4 不走 auto-merge。当前 state=blocked 是我新 commit 触发的 CI 重跑,属正常,等其转绿即可合。

…ispatches (#2281)

The new persona lane's upload-artifact step declared 'if-no-files-found' as a
STEP-level key (sibling of uses/with) instead of an input under with/. That is
not a valid Actions step property, so the workflow failed schema validation on
every push and dispatched ZERO jobs (conclusion=failure, no steps ran) — the
lane never actually executed even though it was green-absent from required
checks. Move it under with/ (a documented upload-artifact input). No test or
code change.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.90-master.cb239d3 (rolling master tag).

npm install -g billion-context@0.0.90-master.cb239d3  # 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

launcher: bili codex exec-resume 尾部 -c 触发 codex-cli 0.147.0 解析怪癖,用户 -c model= 被静默丢弃 + 真二进制 persona CI 空缺

1 participant