diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts index 2ad930bad..b98af5dd2 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts @@ -209,9 +209,20 @@ export interface SlashCommand { export const TOP_LEVEL_COMMANDS: readonly SlashCommand[] = [ { id: 'fast', label: 'Fast' }, { id: 'research', label: 'Research' }, - { id: 'superagent', label: 'Actions' }, + { id: 'actions', label: 'Actions' }, ] as const +/** + * Maps UI command IDs to API command IDs. + * Some commands have different IDs for display vs API (e.g., "actions" -> "superagent") + */ +export function getApiCommandId(uiCommandId: string): string { + const commandMapping: Record = { + actions: 'superagent', + } + return commandMapping[uiCommandId] || uiCommandId +} + export const WEB_COMMANDS: readonly SlashCommand[] = [ { id: 'search', label: 'Search' }, { id: 'read', label: 'Read' }, diff --git a/apps/sim/stores/panel/copilot/store.ts b/apps/sim/stores/panel/copilot/store.ts index 3c5cad8c7..5068cd167 100644 --- a/apps/sim/stores/panel/copilot/store.ts +++ b/apps/sim/stores/panel/copilot/store.ts @@ -2815,9 +2815,14 @@ export const useCopilotStore = create()( mode === 'ask' ? 'ask' : mode === 'plan' ? 'plan' : 'agent' // Extract slash commands from contexts (lowercase) and filter them out from contexts + // Map UI command IDs to API command IDs (e.g., "actions" -> "superagent") + const uiToApiCommandMap: Record = { actions: 'superagent' } const commands = contexts ?.filter((c) => c.kind === 'slash_command' && 'command' in c) - .map((c) => (c as any).command.toLowerCase()) as string[] | undefined + .map((c) => { + const uiCommand = (c as any).command.toLowerCase() + return uiToApiCommandMap[uiCommand] || uiCommand + }) as string[] | undefined const filteredContexts = contexts?.filter((c) => c.kind !== 'slash_command') const result = await sendStreamingMessage({