Merge pull request #1196 from haoqixu/fix-commands-conflict
fix(coding-agent): filter out commands conflict with builtins
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user