From 7d3493b69e9f6bdfdbef566a50856f1d4d0a6c1b Mon Sep 17 00:00:00 2001 From: Duc Lv Date: Fri, 10 Jul 2026 14:48:36 +0700 Subject: [PATCH] feat(cap-slash-commands): forward unregistered slash commands Let Codex resolve slash commands that the adapter does not own. --- src/CodexCommands.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/CodexCommands.ts b/src/CodexCommands.ts index 57df6e94..19df71e6 100644 --- a/src/CodexCommands.ts +++ b/src/CodexCommands.ts @@ -254,8 +254,8 @@ export class CodexCommands { return { handled: true }; } default: - await this.sendUnknownCommandMessage(commandName, sessionId); - return { handled: true }; + // Let Codex resolve unrecognized commands as raw prompts. + return { handled: false }; } } @@ -357,19 +357,6 @@ export class CodexCommands { await session.update(createAgentTextMessageChunk(`Command "/${name}" requires ${inputHint}.`)); } - private async sendUnknownCommandMessage(name: string, sessionId: string): Promise { - const lines = this.getBuiltinCommands().map(command => `- /${command.name}: ${command.description}`); - const text = [ - `Unknown command "/${name}".`, - "Available commands:" - ]; - if (lines.length > 0) { - text.push(...lines); - } - const session = new ACPSessionConnection(this.connection, sessionId); - await session.update(createAgentTextMessageChunk(text.join("\n"))); - } - private buildStatusMessage(sessionState: SessionState): string { const agentMode = sessionState.agentMode; const accountText = this.formatAccountInfo(sessionState.account);