Skip to content

[PR] gate: add a one-time warmup round to the opencode lane to absorb the v1 CLI sqlite storage migration (guaranteed to trig | gate: opencode 车道加一次性 warmup 回合,吸收 v1 CLI 的 sqlite 存储迁移(容器每跑必中) - #3497

Open
ranxianglei wants to merge 8 commits into
masterfrom
fix/gate-opencode-warmup

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

ai: zhipuai-lb/glm-5.3

两个 gate 车道修复,一个方向纠正(撤销自己上一版里的坑):

1. opencode 车道加一次性 warmup 回合(887ab70)
opencode v1 CLI 在全新存储目录上首跑要先建自己的 sqlite 会话库("Performing one time database migration…"),把第一个计时回合的预算整个吃光(容器里全灭、0 上游请求;宿主机绿是因为存储复用)。现在正式计时前先跑一个丢弃成绩的热身回合(600s 上限、失败非致命),实测 63s 吸收完毕。

2. dsh 车道撤销 npm-install 改回裸拷(1a9e8cd,撤销 8a772ac)
上一版曾把 dsh setup 从裸 cpSync 改成 npm install 带依赖,理由是 #3425(jimp)让 dist/index.js 模块加载即 import zod、裸拷的自起代理起不来。owner 指正:这不是修复是埋坑。裸拷就是真实 dsh 插件安装的形状(包旁边没有依赖树),gate 车道就该红——dist 破了车道红 = gate 在干活。装上依赖把症状吸收掉,产品级 P0(dist 静态依赖 zod,违反「dist 零外部依赖」)就被藏住了。已改回,等产品侧修复(jimp 运行时动态 import + dist 禁静态 zod 断言,见 #3511 P0)落地后,这条车道正好当回归证明。

影响面:只动 scripts/gate/(gate 测试装置),不碰产品代码。

…storage migration

Fresh hermetic XDG (every container run) makes opencode v1 print
'Performing one time database migration, may take a few minutes...'
inside the first timed turn — r5 lost the whole lane to it (13/13 red,
zero upstream requests) while host calibration stayed green only because
its storage dir was reused across runs. A disposable long-timeout turn
before t1 absorbs the migration; failure is logged, non-fatal.
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: fix/gate-opencode-warmup (75d97f3)

Latest build — install this exact version

npm install -g billion-context@0.0.6200-pr.3497.e499995

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
75d97f3 billion-context@0.0.6200-pr.3497.e499995 build
88b1702 billion-context@0.0.6112-pr.3497.3ecd6d7 build
fa29724 billion-context@0.0.6020-pr.3497.ae7b8ad build

Download artifact

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

Install instructions are refreshed on each push.

…lout)

Bare cpSync of the billion-context package left zod unresolved once
#3425's jimp made dist/index.js import it at module load: the lane's
self-spawned proxy exited code 1 on every attempt and traffic silently
went direct (uncompressed), failing 8 assertions. npm install --no-save
of the tarball installs the candidate and its deps while keeping the
dsh profile manifest untouched.
…ist-level P0s

8a772ac made the dsh setup npm-install the candidate tarball so its runtime deps (zod, pulled into dist by #3425's jimp) resolve. That is not a gate fix, it is burying the defect: the bare cpSync deliberately reproduces the real thin-install shape (no dependency tree beside the package), which is exactly how production dsh plugin installs ship. If dist/index.js requires an external package at module load, the lane must go red (self-spawned proxy dies, fold/nudge assertions fail) — that is the gate doing its job, not a lane bug to be absorbed. Reverting to the bare copy until the product-side fix (runtime dynamic import of jimp + dist "no static zod" build assertion) lands; after that, this lane doubles as the regression proof.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。 检索了 open+closed issue 与 PR(opencode 车道 / warmup / sqlite 迁移 / gate 矩阵等关键词):无其他条目修同一问题。相关但不同:#3416(车道矩阵跟踪 issue,本 PR 是它的修复项)、#3425/#3511(产品侧 dist 静态依赖 zod 的 P0——本 PR 里 dsh 裸拷 revert 指向它们,机制不同)。

开始审核 PR #3497(branch fix/gate-opencode-warmup,3 commits,net diff 仅 scripts/gate/plugin-lanes.mjs +22/-0;head 上 CI 全绿;与当前 master test-merge 无冲突——master 领先的 39 个提交均未触碰该文件)。完整结论随后给出。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

审核完成。查重结论见上一条(不重复)。以下是结构化结论。

1. 是什么问题:opencode v1 车道在容器里每次全红(13 条断言全灭、上游 0 请求)——全新 XDG 存储目录上,v1 CLI 首个回合前要跑一次它自己的 sqlite 一次性迁移("Performing one time database migration"),把 t1 的整个计时预算吃光。宿主机标定一直绿,是因为宿机存储目录跨次复用、迁移早就跑过。

2. 什么原因导致的:迁移开销是宿主 CLI 自己的启动成本,与 bili 无关;gate harness 隐含假设「第一个回合 = 纯净计时回合」,这个假设在全新容器里不成立(宿主机场景才成立)。修的是 harness 的假设,不是产品——层次正确。

3. 影响范围与严重程度:只动 scripts/gate/plugin-lanes.mjs(gate 测试装置),不碰产品代码;无用户面影响。严重度 = #3416 车道矩阵里 opencode 一格失效(r5 实测全红),dsh/pi/codex/claude 不受影响。

4. 怎么修复的:runLane 加通用 recipe.warmup 钩子——计时回合前跑一个丢弃回合(600s 上限,失败只记日志非致命);opencode 车道接上:opencode run … "Reply with the single word READY.",与计时回合同 env/同 cwd,迁移落在同一个 hermetic XDG 里被吸收。非致命是对的:warmup 因无关原因失败时 t1 仍可能成功,可用性优先。另:分支里 dsh npm-install→裸拷的 add+revert 提交对(net zero)是方向纠正,commit message 已把「裸拷红 = gate 在干活,装依赖会藏住 dist 静态依赖 zod 的 P0(#3511)」的决策写清,保留在历史里合理。

5. 是否有回归问题:无。逐项审过既有行为:①其他五个车道都不定义 warmup → 钩子不触发,零变化;②opencode 车道下游消费点逐一核对——sid 捕获取 storage 里最新 ses_*.json(warmup 会话早于 t1 会话,mtime 不会错选)、p1wire 取最大请求体(warmup 请求极小,不影响 mid-window 自校准)、p1idle 取最后一条匹配(t1 在 warmup 之后)、pluginAgent 断言(warmup 会话值同为 opencode)、nudge/tools 断言(some/union 语义不受多一个请求影响)。高危模式(语义漂移/fail-fast 变吞错/阈值时序漂移)均未触碰。

6. 是否破坏缓存:不涉及(纯测试装置变更,不碰缓存/重试/游标/去重键逻辑)。

7. 是否改了设计方向:不涉及。

8. 是否引入了新的配置:没有。复用既有 GATE_OC1_BIN;600s 是 harness 内部常量,不进配置面。

有意的行为变更(披露):opencode 车道旧行为 = t1 即宿主首回合(容器里必被迁移吃光预算、车道恒红);新行为 = t1 之前多一个丢弃回合 → 车道恢复有效,代价是多 1 个上游请求 + 墙钟时间增加(实测 ~63s,最坏 ≤600s)。这是本 PR 的目的所在,PR 描述已披露。

审核中顺手修掉的小缺陷(独立 commit adbf54537,已推到 PR 分支):原 warmup 用 sh() 但没看退出码——sh() 吞退出码,warmup 进程实际挂掉时日志会打 "warmup ok"。已改为非零退出即 throw,走 runLane 既有的 "warmup failed (non-fatal)" 路径,输出与事实一致。

状态备注:head 上标准 CI 全绿(test×5 shard、static-gates、各 guard、build-artifact、12 个 gate e2e workflow);plugin-lanes 矩阵本身是 workflow_dispatch-only(ci-gate-plugins.yml 无 push/PR 触发),最终验证 = 下次容器全量跑 opencode 车道转绿。分支落后 master 39 个提交但与当前 master test-merge 干净(master 侧未触碰该文件);注意 #3500 也改 scripts/gate/plugin-lanes.mjs,两个 PR 谁后合谁 rebase 一下即可。

判定:可合(等 GitHub 算完 mergeable 状态;建议 owner 直接合并,CI 与本次审核均通过)。

@ranxianglei ranxianglei changed the title gate: opencode 车道加一次性 warmup 回合,吸收 v1 CLI 的 sqlite 存储迁移(容器每跑必中) [PR] gate: add a one-time warmup round to the opencode lane to absorb the v1 CLI sqlite storage migration (guaranteed to trig | gate: opencode 车道加一次性 warmup 回合,吸收 v1 CLI 的 sqlite 存储迁移(容器每跑必中) Oct 17, 2026
ci-check added 4 commits October 26, 2026 10:20
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.
Louie0806 pushed a commit to Louie0806/billion-context that referenced this pull request Nov 8, 2026
Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 8, 2026
…TS.md and the ranxianglei#5904 first-byte budget

Upstream delta 48ee6a7..3ac3e95 (83 files, 20 commits). The substantive ones:
- e3434a3 fix(ranxianglei#5904): phase-1 first-byte budget for upstream summary calls + watchdog/preflight logging
- b4a4026 docs(ranxianglei#5904): regenerate config artifacts for upstreamFirstByteMs + ledger entry
- 9492212 docs(ranxianglei#5904): align first-byte-knob comments and docs with shipped values
- c7db020 fix(opencode): route host console chatter to bili.log and teach the config key (PR ranxianglei#5710, closes ranxianglei#5706)
- 984d3dc fix(gate): opencode lane one-time warmup round for fresh storage dirs (PR ranxianglei#3497)
- 8f1fca8 docs: live architecture hub + module pages + file-map CI guard
- 2a15b5a docs: all 8 architecture module pages live
- 44faff0 docs: slim AGENTS.md (KDD text to reference/design-decisions.md, triage table to reference/triage.md)
- 6f4f248 docs: add docs/README navigation landing page, en+zh
- 3ac3e95 Merge pull request ranxianglei#5917

Conflict surface: only the four generated artifacts, all auto-merged. The lane's chat
row is still in the regenerated docs/configuration.md (line 294) after
`node tools/gen-config-docs.mjs generate`, and the docs fixed point holds.

kernel stayed at 0.0.187 and was rebuilt before measuring. Lane anchors intact:
src/server/relay.ts:2070 still calls `pipePluginJson(toClient, res, undefined,
prepared.protocol, ...)`, src/storage/mysql.ts:77 still exports MYSQL_SCHEMA_VERSION,
symbols unchanged (stripDriftResidue 6, isDraftDump 6, containsRenderTagText 21,
mayStartDegenerateRenderTag 6, DRIFT_BARE_MISMATCH 3, DRAFT_CLOSE_TAIL 3).

Gates: tsc 0, four guards 0, gen-config-docs fixed point.
Tests: issue5175 58/0, tag-echo 79/0, issue2190-degen-close 32/0, golden-storage-render 5/0,
storage-engine-proofs 12/0, native-compact-terminal 1/0, issue4666 2/0, and the three
new upstream suites: issue5904-upstream-first-byte 4/0,
issue5706-opencode-host-console 2/0, issue1815-unknown-top-level-keys 5/0.
@github-actions github-actions Bot mentioned this pull request Nov 13, 2026

This branch has not been deployed

No deployments
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.

1 participant