From 27ea0249bd1a724986189132696860d4115701f0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 03:10:29 +0100 Subject: [PATCH] fix: repair plugin CI on main --- extensions/codex/package.json | 3 +++ src/gateway/session-compaction-checkpoints.ts | 3 +-- src/plugins/bundled-capability-metadata.test.ts | 5 ++++- .../inventory/bundled-capability-metadata.ts | 17 +++++++++++++++++ src/plugins/loader.ts | 6 ++++++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/extensions/codex/package.json b/extensions/codex/package.json index a0fcf93e5b3..faedf1adf47 100644 --- a/extensions/codex/package.json +++ b/extensions/codex/package.json @@ -26,6 +26,9 @@ "defaultChoice": "npm", "minHostVersion": ">=2026.5.1-beta.1" }, + "bundle": { + "includeInCore": false + }, "compat": { "pluginApi": ">=2026.5.1-beta.1" }, diff --git a/src/gateway/session-compaction-checkpoints.ts b/src/gateway/session-compaction-checkpoints.ts index efed3a22600..3c5753d6483 100644 --- a/src/gateway/session-compaction-checkpoints.ts +++ b/src/gateway/session-compaction-checkpoints.ts @@ -7,7 +7,6 @@ import { SessionManager, type FileEntry as PiSessionFileEntry, } from "@mariozechner/pi-coding-agent"; -import { v7 as uuidv7 } from "uuid"; import { updateSessionStore } from "../config/sessions.js"; import type { SessionCompactionCheckpoint, @@ -261,7 +260,7 @@ export async function forkCompactionCheckpointTranscriptAsync(params: { const targetCwd = params.targetCwd ?? sourceHeader.cwd ?? process.cwd(); const sessionDir = params.sessionDir ?? path.dirname(sourceFile); - const sessionId = uuidv7(); + const sessionId = randomUUID(); const timestamp = new Date().toISOString(); const fileTimestamp = timestamp.replace(/[:.]/g, "-"); const sessionFile = path.join(sessionDir, `${fileTimestamp}_${sessionId}.jsonl`); diff --git a/src/plugins/bundled-capability-metadata.test.ts b/src/plugins/bundled-capability-metadata.test.ts index 4f09e565a15..14216620a97 100644 --- a/src/plugins/bundled-capability-metadata.test.ts +++ b/src/plugins/bundled-capability-metadata.test.ts @@ -24,8 +24,11 @@ function readManifestRecords(): PluginManifest[] { return false; } const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf-8")) as { - openclaw?: { extensions?: unknown }; + openclaw?: { bundle?: { includeInCore?: unknown }; extensions?: unknown }; }; + if (packageJson.openclaw?.bundle?.includeInCore === false) { + return false; + } return normalizeBundledPluginStringList(packageJson.openclaw?.extensions).length > 0; }) .map( diff --git a/src/plugins/contracts/inventory/bundled-capability-metadata.ts b/src/plugins/contracts/inventory/bundled-capability-metadata.ts index 39d22fb8800..7872c6e9f47 100644 --- a/src/plugins/contracts/inventory/bundled-capability-metadata.ts +++ b/src/plugins/contracts/inventory/bundled-capability-metadata.ts @@ -64,8 +64,25 @@ function readJsonRecord(filePath: string): Record | undefined { } } +function isExplicitlyDownloadablePlugin(packageJson: Record | undefined): boolean { + const openclaw = packageJson?.openclaw; + if (!openclaw || typeof openclaw !== "object" || Array.isArray(openclaw)) { + return false; + } + const bundle = (openclaw as { bundle?: unknown }).bundle; + return ( + bundle !== null && + typeof bundle === "object" && + !Array.isArray(bundle) && + (bundle as { includeInCore?: unknown }).includeInCore === false + ); +} + function readBundledCapabilityManifest(pluginDir: string): BundledCapabilityManifest | undefined { const packageJson = readJsonRecord(path.join(pluginDir, "package.json")); + if (isExplicitlyDownloadablePlugin(packageJson)) { + return undefined; + } const extensions = normalizeBundledPluginStringList( packageJson?.openclaw && typeof packageJson.openclaw === "object" ? (packageJson.openclaw as { extensions?: unknown }).extensions diff --git a/src/plugins/loader.ts b/src/plugins/loader.ts index 3f1e5068d92..5b15b81792b 100644 --- a/src/plugins/loader.ts +++ b/src/plugins/loader.ts @@ -1176,6 +1176,12 @@ function activatePluginRegistry( } export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegistry { + const requestedOnlyPluginIds = normalizePluginIdScope(options.onlyPluginIds); + const requestedOnlyPluginIdSet = createPluginIdScopeSet(requestedOnlyPluginIds); + if (options.activate === false && requestedOnlyPluginIdSet?.size === 0) { + return createEmptyPluginRegistry(); + } + const { env, cfg,