Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions scripts/gate/plugin-lanes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ if (!TGZ || !REPO || !MODEL1.base || !MODEL1.model) {
}

const results = [];
// Recorder spawned for the in-flight lane; killed from main()'s catch when a
// lane aborts before its own teardown (2026-11-14 leak fix).
let activeRec = null;
// #3475: lanes whose upstream lacks the protocol door — degraded verdict,
// excluded from the failure tally (see runLane's env-blocked rule).
const BLOCKED = new Map(); // lane -> { kind: "env" | "client", reason }
Expand Down Expand Up @@ -280,8 +283,13 @@ async function runLane(agent, recipe) {
console.log(`-- lane ${agent}: recorder :${recPort} -> ${MODEL1.base}`);
const rec = spawn("node", [path.join(HERE, "upstream-recorder.mjs")], {
env: { ...process.env, RECORDER_PORT: String(recPort), RECORDER_TARGET: MODEL1.base, RECORDER_OUT: recOut },
stdio: ["ignore", "ignore", "inherit"], detached: true,
// stderr to a per-lane file: inheriting the lane's log pipe meant a
// detached recorder surviving an aborted lane held the entrypoint's
// `| tee` pipe open and wedged the whole gate (2026-11-14, 3h hang).
stdio: ["ignore", "ignore", fs.openSync(path.join(laneDir, "recorder.stderr.log"), "a")],
detached: true,
});
activeRec = rec;

const baseEnv = cleanEnv({
HOME: path.join(laneDir, "home"),
Expand Down Expand Up @@ -613,6 +621,7 @@ async function runLane(agent, recipe) {
ctx.killInstances();
if (ctx.proxy) { try { process.kill(-ctx.proxy.pid, "SIGKILL"); } catch {} }
try { process.kill(-rec.pid, "SIGKILL"); } catch {}
activeRec = null;
}

async function startManualProxy(ctx, args) {
Expand Down Expand Up @@ -1067,7 +1076,7 @@ async function main() {
const recipe = RECIPES[agent];
if (!recipe) { record(agent, "recipe", false, "unknown agent"); continue; }
console.log(`\n===== plugin lane: ${agent} (${recipe.type}) =====`);
try { await runLane(agent, recipe); } catch (e) { record(agent, "lane", false, String(e).slice(0, 400)); }
try { await runLane(agent, recipe); } catch (e) { record(agent, "lane", false, String(e).slice(0, 400)); try { if (activeRec) process.kill(-activeRec.pid, "SIGKILL"); } catch {} activeRec = null; }
}
// #3475: env-blocked lanes (upstream lacks the protocol door) keep their
// degraded verdict — FAIL records from turn-dependent assertions are honest
Expand Down
Loading