Skip to content

Commit 9c55411

Browse files
authored
fix: forward unregistered slash commands (#281)
Let Codex resolve slash commands that the adapter does not own.
1 parent 75893cd commit 9c55411

1 file changed

Lines changed: 2 additions & 15 deletions

File tree

src/CodexCommands.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ export class CodexCommands {
254254
return { handled: true };
255255
}
256256
default:
257-
await this.sendUnknownCommandMessage(commandName, sessionId);
258-
return { handled: true };
257+
// Let Codex resolve unrecognized commands as raw prompts.
258+
return { handled: false };
259259
}
260260
}
261261

@@ -357,19 +357,6 @@ export class CodexCommands {
357357
await session.update(createAgentTextMessageChunk(`Command "/${name}" requires ${inputHint}.`));
358358
}
359359

360-
private async sendUnknownCommandMessage(name: string, sessionId: string): Promise<void> {
361-
const lines = this.getBuiltinCommands().map(command => `- /${command.name}: ${command.description}`);
362-
const text = [
363-
`Unknown command "/${name}".`,
364-
"Available commands:"
365-
];
366-
if (lines.length > 0) {
367-
text.push(...lines);
368-
}
369-
const session = new ACPSessionConnection(this.connection, sessionId);
370-
await session.update(createAgentTextMessageChunk(text.join("\n")));
371-
}
372-
373360
private buildStatusMessage(sessionState: SessionState): string {
374361
const agentMode = sessionState.agentMode;
375362
const accountText = this.formatAccountInfo(sessionState.account);

0 commit comments

Comments
 (0)