diff --git a/extensions/slack/src/monitor/slash.test.ts b/extensions/slack/src/monitor/slash.test.ts index d73392764c30..b94289f51d23 100644 --- a/extensions/slack/src/monitor/slash.test.ts +++ b/extensions/slack/src/monitor/slash.test.ts @@ -589,6 +589,7 @@ describe("Slack native command argument menus", () => { const commands = new Map Promise>(); const actions = new Map Promise>(); const postEphemeral = vi.fn().mockResolvedValue({ ok: true }); + const runtimeLog = vi.fn(); const app = { client: { chat: { postEphemeral } }, command: (name: string, handler: (args: unknown) => Promise) => { @@ -604,7 +605,7 @@ describe("Slack native command argument menus", () => { }; const ctx = { cfg: { commands: { native: true, nativeSkills: false } }, - runtime: {}, + runtime: { log: runtimeLog }, botToken: "bot-token", botUserId: "bot", teamId: "T1", @@ -637,6 +638,12 @@ describe("Slack native command argument menus", () => { // Registration should not throw despite app.options() throwing await registerCommands(ctx, account); expect(commands.size).toBeGreaterThan(0); + expect(runtimeLog).toHaveBeenCalledTimes(1); + expect(runtimeLog).toHaveBeenCalledWith( + expect.stringContaining( + "slack: external arg-menu registration failed; falling back to static slash command menus.", + ), + ); expect( Array.from(actions.keys()).some( (key) => key instanceof RegExp && String(key) === String(/^openclaw_cmdarg/), diff --git a/extensions/slack/src/monitor/slash.ts b/extensions/slack/src/monitor/slash.ts index d69ab1846285..d64cce94b6ef 100644 --- a/extensions/slack/src/monitor/slash.ts +++ b/extensions/slack/src/monitor/slash.ts @@ -18,7 +18,7 @@ import { } from "openclaw/plugin-sdk/native-command-config-runtime"; import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; import type { ResolvedAgentRoute } from "openclaw/plugin-sdk/routing"; -import { danger, logVerbose } from "openclaw/plugin-sdk/runtime-env"; +import { danger, logVerbose, warn } from "openclaw/plugin-sdk/runtime-env"; import { loadSessionStore, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime"; import { normalizeLowercaseStringOrEmpty, @@ -927,6 +927,11 @@ export async function registerSlackMonitorSlashCommands(params: { registerArgOptions(); } catch (err) { supportsExternalArgMenus = false; + runtime.log?.( + warn( + "slack: external arg-menu registration failed; falling back to static slash command menus. Enable verbose logs for details.", + ), + ); logVerbose( `slack: external arg-menu registration failed, falling back to static menus: ${formatErrorMessage(err)}`, );