File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -209,9 +209,20 @@ export interface SlashCommand {
209209export const TOP_LEVEL_COMMANDS : readonly SlashCommand [ ] = [
210210 { id : 'fast' , label : 'Fast' } ,
211211 { id : 'research' , label : 'Research' } ,
212- { id : 'superagent ' , label : 'Actions' } ,
212+ { id : 'actions ' , label : 'Actions' } ,
213213] as const
214214
215+ /**
216+ * Maps UI command IDs to API command IDs.
217+ * Some commands have different IDs for display vs API (e.g., "actions" -> "superagent")
218+ */
219+ export function getApiCommandId ( uiCommandId : string ) : string {
220+ const commandMapping : Record < string , string > = {
221+ actions : 'superagent' ,
222+ }
223+ return commandMapping [ uiCommandId ] || uiCommandId
224+ }
225+
215226export const WEB_COMMANDS : readonly SlashCommand [ ] = [
216227 { id : 'search' , label : 'Search' } ,
217228 { id : 'read' , label : 'Read' } ,
Original file line number Diff line number Diff line change @@ -2815,9 +2815,14 @@ export const useCopilotStore = create<CopilotStore>()(
28152815 mode === 'ask' ? 'ask' : mode === 'plan' ? 'plan' : 'agent'
28162816
28172817 // Extract slash commands from contexts (lowercase) and filter them out from contexts
2818+ // Map UI command IDs to API command IDs (e.g., "actions" -> "superagent")
2819+ const uiToApiCommandMap : Record < string , string > = { actions : 'superagent' }
28182820 const commands = contexts
28192821 ?. filter ( ( c ) => c . kind === 'slash_command' && 'command' in c )
2820- . map ( ( c ) => ( c as any ) . command . toLowerCase ( ) ) as string [ ] | undefined
2822+ . map ( ( c ) => {
2823+ const uiCommand = ( c as any ) . command . toLowerCase ( )
2824+ return uiToApiCommandMap [ uiCommand ] || uiCommand
2825+ } ) as string [ ] | undefined
28212826 const filteredContexts = contexts ?. filter ( ( c ) => c . kind !== 'slash_command' )
28222827
28232828 const result = await sendStreamingMessage ( {
You can’t perform that action at this time.
0 commit comments