





















@@ -71,6 +71,7 @@ describe("plugin gateway gauntlet helpers", () => {
7171expect(matrix[0]).toEqual({
7272activation: {},
7373authMethods: ["oauth"],
74+buildId: "alpha",
7475channels: [],
7576cliCommandAliases: [{ name: "alpha", kind: "runtime-slash", cliCommand: "plugins" }],
7677commandAliases: [{ name: "alpha", kind: "runtime-slash", cliCommand: "plugins" }],
@@ -89,6 +90,23 @@ describe("plugin gateway gauntlet helpers", () => {
8990expect(matrix[1].runtimeSlashAliases).toEqual([
9091{ name: "dreaming", kind: "runtime-slash", cliCommand: null },
9192]);
93+expect(matrix[1].buildId).toBe("beta");
94+});
95+96+it("keeps manifest ids separate from bounded build entry ids", async () => {
97+await writeManifest("kimi-coding", "openclaw.plugin.json", JSON.stringify({ id: "kimi" }));
98+99+const matrix = discoverBundledPluginManifests(repoRoot);
100+101+expect(matrix).toEqual([
102+expect.objectContaining({
103+buildId: "kimi-coding",
104+id: "kimi",
105+}),
106+]);
107+expect(buildGauntletPrebuildEnv({}, { buildIds: [matrix[0].buildId] })).toEqual({
108+OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS: "kimi-coding",
109+});
92110});
9311194112it("skips source-only plugin dirs that are excluded from the built runtime", async () => {
@@ -263,12 +281,30 @@ describe("plugin gateway gauntlet helpers", () => {
263281expect(buildGauntletPrebuildEnv({ EXISTING: "1" }, { includePrivateQa: true })).toEqual({
264282EXISTING: "1",
265283OPENCLAW_BUILD_PRIVATE_QA: "1",
284+OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS: "qa-channel,qa-lab,qa-matrix",
266285OPENCLAW_ENABLE_PRIVATE_QA_CLI: "1",
267286});
268287const env = { EXISTING: "1" };
269288expect(buildGauntletPrebuildEnv(env, { includePrivateQa: false })).toBe(env);
270289});
271290291+it("prebuilds only selected plugin dist entries for bounded gauntlet runs", () => {
292+expect(
293+buildGauntletPrebuildEnv(
294+{ EXISTING: "1" },
295+{
296+includePrivateQa: true,
297+buildIds: ["active-memory", "acpx"],
298+},
299+),
300+).toEqual({
301+EXISTING: "1",
302+OPENCLAW_BUILD_PRIVATE_QA: "1",
303+OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS: "acpx,active-memory,qa-channel,qa-lab,qa-matrix",
304+OPENCLAW_ENABLE_PRIVATE_QA_CLI: "1",
305+});
306+});
307+272308it("prebuilds only the CLI startup runtime needed by the gauntlet", () => {
273309expect(createGauntletPrebuildCommand(repoRoot)).toEqual({
274310command: process.execPath,
@@ -379,4 +415,51 @@ describe("plugin gateway gauntlet helpers", () => {
379415expect(summary.isolatedRunRootPreserved).toBe(false);
380416await expect(fs.stat(summary.isolatedRunRoot)).rejects.toHaveProperty("code", "ENOENT");
381417});
418+419+it("carries bounded build ids into QA run-node chunks", async () => {
420+const outputDir = path.join(repoRoot, "artifacts");
421+await writeManifest("alpha", "openclaw.plugin.json", JSON.stringify({ id: "alpha" }));
422+await fs.writeFile(path.join(repoRoot, "extensions", "alpha", "index.ts"), "export {};\n");
423+await fs.mkdir(path.join(repoRoot, "scripts"), { recursive: true });
424+await fs.writeFile(
425+path.join(repoRoot, "scripts", "run-node.mjs"),
426+[
427+'import fs from "node:fs";',
428+'import path from "node:path";',
429+'const outputArgIndex = process.argv.indexOf("--output-dir");',
430+"const outputDir = path.resolve(process.cwd(), process.argv[outputArgIndex + 1]);",
431+"fs.mkdirSync(outputDir, { recursive: true });",
432+'fs.writeFileSync(path.join(outputDir, "env.txt"), process.env.OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS ?? "", "utf8");',
433+'fs.writeFileSync(path.join(outputDir, "qa-suite-summary.json"), JSON.stringify({ metrics: { wallMs: 1, gatewayCpuCoreRatio: 0 } }), "utf8");',
434+].join("\n"),
435+"utf8",
436+);
437+438+const result = spawnSync(
439+process.execPath,
440+[
441+path.resolve("scripts/check-plugin-gateway-gauntlet.mjs"),
442+"--repo-root",
443+repoRoot,
444+"--output-dir",
445+outputDir,
446+"--skip-prebuild",
447+"--skip-lifecycle",
448+"--skip-slash-help",
449+"--plugin",
450+"alpha",
451+"--qa-scenario",
452+"channel-chat-baseline",
453+],
454+{
455+cwd: path.resolve("."),
456+encoding: "utf8",
457+},
458+);
459+460+expect(result.status, result.stderr).toBe(0);
461+await expect(
462+fs.readFile(path.join(outputDir, "qa-suite", "chunk-00", "env.txt"), "utf8"),
463+).resolves.toBe("alpha,qa-channel,qa-lab,qa-matrix");
464+});
382465});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。