From 280d7ebcb14fb9a4f63ea8d0cd0eccc449c43dc0 Mon Sep 17 00:00:00 2001 From: Seth <40871381+sethalan@users.noreply.github.com> Date: Sat, 5 Dec 2026 19:44:53 -0800 Subject: [PATCH] Expect the legacy skills CLI link source in the e2e test on Node below its floor, as on CI AI Assisted --- scripts/test-install-e2e.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/test-install-e2e.mjs b/scripts/test-install-e2e.mjs index df54865..5949a31 100644 --- a/scripts/test-install-e2e.mjs +++ b/scripts/test-install-e2e.mjs @@ -12,6 +12,7 @@ import test, { after } from "node:test"; import assert from "node:assert/strict"; import fs from "node:fs"; import path from "node:path"; +import { createRequire } from "node:module"; import { spawnSync } from "node:child_process"; import { installRefForRelease, chooseReleaseRef, parseLsRemoteSnapshot } from "../src/web-console/update-check.mjs"; @@ -27,6 +28,9 @@ import { writeFixtureSnapshot, } from "./install-e2e-fixture.mjs"; +// The installer's own rule for which skills CLI pin a Node version gets. +const SKILLS_CLI = createRequire(import.meta.url)("../src/installer/skills-cli.js"); + let fixtureInstance = null; function fixture() { if (!fixtureInstance) fixtureInstance = createInstallE2EFixture(); @@ -261,7 +265,13 @@ test("e2e: canonical link refresh and benchmark events carry the selected ref wi const cli = readSkillsCliLog(run.cliLog); assert.equal(cli.length, 1, "one canonical-source link refresh, not one CLI add per skill"); assert.equal(cli[0].argv[0], "add"); - assert.equal(cli[0].argv[1], path.join(run.isolated.paths.home, ".agents", "skills")); + // The installer runs on this Node, which picks the skills CLI pin: the current pin links from the + // canonical store, the legacy one (Node below its floor, as on CI's Node 20) from the built + // skills/ folder, since it skips every agent when given the store (agentLinkSource). + const pin = SKILLS_CLI.selectSkillsCliVersion(process.versions.node); + const linkSource = + pin === SKILLS_CLI.SKILLS_CLI_PINS.legacy ? path.join(run.checkout, "skills") : path.join(run.isolated.paths.home, ".agents", "skills"); + assert.equal(cli[0].argv[1], linkSource, `the link source for skills CLI ${pin}`); assert.ok(cli[0].argv.includes("-g")); assert.ok(cli[0].argv.includes("plan2code-3-implement-review"));