diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eace0e33..b92c75402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Commands: accept /models as an alias for /model. - Debugging: add raw model stream logging flags and document gateway watch mode. - Agent: add claude-cli/opus-4.5 runner via Claude CLI with resume support (tools disabled). - CLI: improve `logs` output (pretty/plain/JSONL), add gateway unreachable hint, and document logging. diff --git a/src/auto-reply/commands-registry.test.ts b/src/auto-reply/commands-registry.test.ts index 58bfa00c0..b2ac9ad5d 100644 --- a/src/auto-reply/commands-registry.test.ts +++ b/src/auto-reply/commands-registry.test.ts @@ -26,6 +26,8 @@ describe("commands registry", () => { expect(detection.regex.test("/status:")).toBe(true); expect(detection.regex.test("/stop")).toBe(true); expect(detection.regex.test("/send:")).toBe(true); + expect(detection.regex.test("/models")).toBe(true); + expect(detection.regex.test("/models list")).toBe(true); expect(detection.regex.test("try /status")).toBe(false); }); diff --git a/src/auto-reply/commands-registry.ts b/src/auto-reply/commands-registry.ts index 80dd5b892..ae7c842e2 100644 --- a/src/auto-reply/commands-registry.ts +++ b/src/auto-reply/commands-registry.ts @@ -104,7 +104,7 @@ const CHAT_COMMANDS: ChatCommandDefinition[] = [ key: "model", nativeName: "model", description: "Show or set the model.", - textAliases: ["/model"], + textAliases: ["/model", "/models"], acceptsArgs: true, }, { diff --git a/src/auto-reply/model.test.ts b/src/auto-reply/model.test.ts index 626a60d36..a2bbf5f92 100644 --- a/src/auto-reply/model.test.ts +++ b/src/auto-reply/model.test.ts @@ -10,6 +10,13 @@ describe("extractModelDirective", () => { expect(result.cleaned).toBe(""); }); + it("extracts /models with argument", () => { + const result = extractModelDirective("/models gpt-5"); + expect(result.hasDirective).toBe(true); + expect(result.rawModel).toBe("gpt-5"); + expect(result.cleaned).toBe(""); + }); + it("extracts /model with provider/model format", () => { const result = extractModelDirective("/model anthropic/claude-opus-4-5"); expect(result.hasDirective).toBe(true); diff --git a/src/auto-reply/model.ts b/src/auto-reply/model.ts index 163381376..c40a618dd 100644 --- a/src/auto-reply/model.ts +++ b/src/auto-reply/model.ts @@ -14,7 +14,7 @@ export function extractModelDirective( if (!body) return { cleaned: "", hasDirective: false }; const modelMatch = body.match( - /(?:^|\s)\/model(?=$|\s|:)\s*:?\s*([A-Za-z0-9_.:@-]+(?:\/[A-Za-z0-9_.:@-]+)?)?/i, + /(?:^|\s)\/models?(?=$|\s|:)\s*:?\s*([A-Za-z0-9_.:@-]+(?:\/[A-Za-z0-9_.:@-]+)?)?/i, ); const aliases = (options?.aliases ?? [])