From e204a318319ae51d50411fa367fd90633e7600c5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 23 Apr 2026 09:27:47 +0100 Subject: [PATCH] fix(discord): keep subagent hooks lazy in channel entry --- extensions/discord/subagent-hooks-api.ts | 6 ------ ...test-built-bundled-channel-entry-smoke.mjs | 20 +++++++++++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/extensions/discord/subagent-hooks-api.ts b/extensions/discord/subagent-hooks-api.ts index 18c594b1222..0a9b4e3d0d1 100644 --- a/extensions/discord/subagent-hooks-api.ts +++ b/extensions/discord/subagent-hooks-api.ts @@ -25,9 +25,3 @@ export function registerDiscordSubagentHooks(api: OpenClawPluginApi): void { return handleDiscordSubagentDeliveryTarget(event); }); } - -export { - handleDiscordSubagentDeliveryTarget, - handleDiscordSubagentEnded, - handleDiscordSubagentSpawning, -} from "./src/subagent-hooks.js"; diff --git a/scripts/test-built-bundled-channel-entry-smoke.mjs b/scripts/test-built-bundled-channel-entry-smoke.mjs index de8268c4817..dc3720d3011 100644 --- a/scripts/test-built-bundled-channel-entry-smoke.mjs +++ b/scripts/test-built-bundled-channel-entry-smoke.mjs @@ -144,7 +144,15 @@ function assertEntryFileExists(entry) { async function smokeChannelEntry(entryFile) { assertEntryFileExists(entryFile); - const entry = (await importBuiltModule(entryFile.path)).default; + let entry; + try { + entry = (await importBuiltModule(entryFile.path)).default; + } catch (error) { + throw new Error( + `${entryFile.id} ${entryFile.kind} entry failed to import ${entryFile.path}: ${error instanceof Error ? error.message : String(error)}`, + { cause: error }, + ); + } assert.equal(entry.kind, "bundled-channel-entry", `${entryFile.id} channel entry kind mismatch`); assert.equal( typeof entry.loadChannelPlugin, @@ -163,7 +171,15 @@ async function smokeChannelEntry(entryFile) { async function smokeSetupEntry(entryFile) { assertEntryFileExists(entryFile); - const entry = (await importBuiltModule(entryFile.path)).default; + let entry; + try { + entry = (await importBuiltModule(entryFile.path)).default; + } catch (error) { + throw new Error( + `${entryFile.id} ${entryFile.kind} entry failed to import ${entryFile.path}: ${error instanceof Error ? error.message : String(error)}`, + { cause: error }, + ); + } if (entry?.kind !== "bundled-channel-setup-entry") { return false; }