From 887ab702ed7e6e7c1bf26cc15bdd44017a19e5ec Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Sat, 17 Oct 2026 14:00:11 +0800 Subject: [PATCH 1/5] gate: opencode lane one-time warmup turn absorbs the v1 CLI's sqlite storage migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- scripts/gate/plugin-lanes.mjs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/gate/plugin-lanes.mjs b/scripts/gate/plugin-lanes.mjs index dd564bb088..a73860ad27 100644 --- a/scripts/gate/plugin-lanes.mjs +++ b/scripts/gate/plugin-lanes.mjs @@ -267,6 +267,21 @@ async function runLane(agent, recipe) { try { await recipe.setup(ctx); + // One-time host warmup BEFORE timed turns: opencode v1 runs a one-time + // sqlite storage migration on fresh XDG ("Performing one time database + // migration, may take a few minutes...") — in hermetic containers that + // eats the whole t1 turn budget and wipes the lane (r5: every turn red, + // 0 upstream requests). A disposable long-timeout turn absorbs it; + // output discarded, failure logged but non-fatal. + if (recipe.warmup) { + const t0 = Date.now(); + try { + await recipe.warmup(ctx); + console.log(`-- lane ${agent}: warmup ok in ${Math.round((Date.now() - t0) / 1000)}s`); + } catch (e) { + console.log(`-- lane ${agent}: warmup failed (non-fatal): ${String(e).slice(0, 140)}`); + } + } const sid = { v: null }; const t1 = await recipe.turn(ctx, `Read corpus.md in your cwd fully (~1300 lines). Your read tool may truncate or ELIDE the middle of a long file (e.g. claude-code's Read shows head+tail with "... N lines elided ...") — read in sequential chunks (offset 1, 201, 401, …, ~200 lines each, or equivalent line-range calls) until you have seen EVERY line including the middle; do not stop at a truncation or elision. Then reply with ONLY the TITLE line of section S40. Do not run any other tool or command.`, sid, "t1"); fs.writeFileSync(path.join(ctx.laneDir, `turn-t1.txt`), t1.out || ""); @@ -628,6 +643,13 @@ const RECIPES = { ocFor(BIG_WINDOW); ctx.env = { ...ctx.baseEnv, BILLION_CONTEXT_NODE: process.execPath }; }, + // see runLane: absorbs the v1 CLI's one-time storage migration + async warmup(ctx) { + const model = MODEL1.model.split(",")[0]; + sh((process.env.GATE_OC1_BIN || "opencode").trim(), + ["run", "-m", `gate/${model}`, "--dangerously-skip-permissions", "Reply with the single word READY."], + { cwd: ctx.workDir, env: ctx.env, timeout: 600_000 }); + }, setWindow(ctx, w) { const file = path.join(ctx.laneDir, "xdg/config/opencode/opencode.json"); const cfg = JSON.parse(fs.readFileSync(file, "utf8")); From 8a772ac09332fa043290c75564259b22b0101e53 Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Sat, 17 Oct 2026 15:16:11 +0800 Subject: [PATCH 2/5] gate: dsh profile installs the candidate with runtime deps (#3425 fallout) 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. --- scripts/gate/plugin-lanes.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/gate/plugin-lanes.mjs b/scripts/gate/plugin-lanes.mjs index a73860ad27..971b1cb57b 100644 --- a/scripts/gate/plugin-lanes.mjs +++ b/scripts/gate/plugin-lanes.mjs @@ -490,9 +490,13 @@ const RECIPES = { const dshHome = path.join(ctx.laneDir, "dsh-home"); const profile = path.join(dshHome, "profiles", "headless"); fs.mkdirSync(path.join(profile, "node_modules"), { recursive: true }); - // candidate as a REAL copy in the profile (e2e-native-dsh.test.ts shape; - // bundles @deepseek-ai/dsh-base/-headless resolve from the dsh install) - fs.cpSync(ctx.cand, path.join(profile, "node_modules", "billion-context"), { recursive: true }); + // Install the candidate WITH its runtime deps — NOT a bare copy. Since + // #3425 (jimp image downscale) dist/index.js imports "zod" at module + // load, so a bare cpSync of the package alone leaves the self-spawned + // proxy dying with ERR_MODULE_NOT_FOUND and the lane silently goes + // direct (uncompressed) — caught as 8 red assertions in the 94e0fe04 + // run. --no-save keeps the dsh profile manifest pristine. + must("npm", ["install", "--prefix", profile, "--no-audit", "--no-fund", "--no-save", TGZ], { timeout: 300_000 }); const pkg = { name: "dsh-profile-plugin-gate", private: true, dependencies: { "billion-context": ctx.candV }, From 1a9e8cdce8d538448d765eff470278bd855a0df6 Mon Sep 17 00:00:00 2001 From: ranxianglei Date: Sat, 17 Oct 2026 16:00:26 +0800 Subject: [PATCH 3/5] =?UTF-8?q?gate:=20keep=20the=20dsh=20profile=20a=20BA?= =?UTF-8?q?RE=20copy=20=E2=80=94=20installing=20deps=20would=20mask=20dist?= =?UTF-8?q?-level=20P0s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8a772ac0 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. --- scripts/gate/plugin-lanes.mjs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/gate/plugin-lanes.mjs b/scripts/gate/plugin-lanes.mjs index 971b1cb57b..a73860ad27 100644 --- a/scripts/gate/plugin-lanes.mjs +++ b/scripts/gate/plugin-lanes.mjs @@ -490,13 +490,9 @@ const RECIPES = { const dshHome = path.join(ctx.laneDir, "dsh-home"); const profile = path.join(dshHome, "profiles", "headless"); fs.mkdirSync(path.join(profile, "node_modules"), { recursive: true }); - // Install the candidate WITH its runtime deps — NOT a bare copy. Since - // #3425 (jimp image downscale) dist/index.js imports "zod" at module - // load, so a bare cpSync of the package alone leaves the self-spawned - // proxy dying with ERR_MODULE_NOT_FOUND and the lane silently goes - // direct (uncompressed) — caught as 8 red assertions in the 94e0fe04 - // run. --no-save keeps the dsh profile manifest pristine. - must("npm", ["install", "--prefix", profile, "--no-audit", "--no-fund", "--no-save", TGZ], { timeout: 300_000 }); + // candidate as a REAL copy in the profile (e2e-native-dsh.test.ts shape; + // bundles @deepseek-ai/dsh-base/-headless resolve from the dsh install) + fs.cpSync(ctx.cand, path.join(profile, "node_modules", "billion-context"), { recursive: true }); const pkg = { name: "dsh-profile-plugin-gate", private: true, dependencies: { "billion-context": ctx.candV }, From adbf545372aa9370afac2395b22e92190d94fedd Mon Sep 17 00:00:00 2001 From: awork Date: Sat, 17 Oct 2026 17:16:06 +0800 Subject: [PATCH 4/5] gate: log opencode warmup as failed when the turn exits non-zero (honest output) --- scripts/gate/plugin-lanes.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/gate/plugin-lanes.mjs b/scripts/gate/plugin-lanes.mjs index a73860ad27..bfafcff5cc 100644 --- a/scripts/gate/plugin-lanes.mjs +++ b/scripts/gate/plugin-lanes.mjs @@ -646,9 +646,12 @@ const RECIPES = { // see runLane: absorbs the v1 CLI's one-time storage migration async warmup(ctx) { const model = MODEL1.model.split(",")[0]; - sh((process.env.GATE_OC1_BIN || "opencode").trim(), + const r = sh((process.env.GATE_OC1_BIN || "opencode").trim(), ["run", "-m", `gate/${model}`, "--dangerously-skip-permissions", "Reply with the single word READY."], { cwd: ctx.workDir, env: ctx.env, timeout: 600_000 }); + // sh() swallows exit codes — throw so runLane logs "warmup failed" + // instead of a misleading "warmup ok" when the turn actually died. + if (r.status !== 0) throw new Error(`opencode warmup exited ${r.status ?? "timeout"}\n${(r.stderr || "").slice(-300)}`); }, setWindow(ctx, w) { const file = path.join(ctx.laneDir, "xdg/config/opencode/opencode.json"); From dfadc21b339bfa45c6ec03b2f13e723ce6bf0507 Mon Sep 17 00:00:00 2001 From: ci-check Date: Mon, 26 Oct 2026 15:22:50 +0800 Subject: [PATCH 5/5] fix(ci): sync lockfile recorded versions with acp-kernel 0.0.165 (#4599) master window commits 293ae6542/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. --- kernel/package-lock.json | 4 ++-- package-lock.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/package-lock.json b/kernel/package-lock.json index da011d94e1..4c5e2d79e9 100644 --- a/kernel/package-lock.json +++ b/kernel/package-lock.json @@ -1,12 +1,12 @@ { "name": "acp-kernel", - "version": "0.0.164", + "version": "0.0.165", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "acp-kernel", - "version": "0.0.164", + "version": "0.0.165", "license": "MIT", "devDependencies": { "@types/node": "^22.0.0", diff --git a/package-lock.json b/package-lock.json index 380212c96e..15a6e3f4e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ }, "kernel": { "name": "acp-kernel", - "version": "0.0.163", + "version": "0.0.165", "dev": true, "license": "MIT", "devDependencies": {