mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
Merge pull request #1196 from haoqixu/fix-commands-conflict
fix(coding-agent): filter out commands conflict with builtins
This commit is contained in:
commit
7a9c668357
3 changed files with 57 additions and 8 deletions
|
|
@ -347,13 +347,14 @@ export class InteractiveMode {
|
|||
}));
|
||||
|
||||
// Convert extension commands to SlashCommand format
|
||||
const extensionCommands: SlashCommand[] = (this.session.extensionRunner?.getRegisteredCommands() ?? []).map(
|
||||
(cmd) => ({
|
||||
name: cmd.name,
|
||||
description: cmd.description ?? "(extension command)",
|
||||
getArgumentCompletions: cmd.getArgumentCompletions,
|
||||
}),
|
||||
);
|
||||
const builtinCommandNames = new Set(slashCommands.map((c) => c.name));
|
||||
const extensionCommands: SlashCommand[] = (
|
||||
this.session.extensionRunner?.getRegisteredCommands(builtinCommandNames) ?? []
|
||||
).map((cmd) => ({
|
||||
name: cmd.name,
|
||||
description: cmd.description ?? "(extension command)",
|
||||
getArgumentCompletions: cmd.getArgumentCompletions,
|
||||
}));
|
||||
|
||||
// Build skill commands from session.skills (if enabled)
|
||||
this.skillCommands.clear();
|
||||
|
|
@ -959,6 +960,9 @@ export class InteractiveMode {
|
|||
}
|
||||
}
|
||||
|
||||
const commandDiagnostics = this.session.extensionRunner?.getCommandDiagnostics() ?? [];
|
||||
extensionDiagnostics.push(...commandDiagnostics);
|
||||
|
||||
const shortcutDiagnostics = this.session.extensionRunner?.getShortcutDiagnostics() ?? [];
|
||||
extensionDiagnostics.push(...shortcutDiagnostics);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue