From 3a9753424ffd7943c04b60b353a68d769bce4813 Mon Sep 17 00:00:00 2001 From: murashit Date: Mon, 1 Jun 2026 18:36:03 +0900 Subject: [PATCH] Make auto-review slash command bare --- src/features/chat/composer/slash-commands.ts | 6 +++--- src/features/chat/slash-commands.ts | 1 - .../features/chat/composer/slash-commands.test.ts | 14 ++++++-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/features/chat/composer/slash-commands.ts b/src/features/chat/composer/slash-commands.ts index d2521b4f..648d77ef 100644 --- a/src/features/chat/composer/slash-commands.ts +++ b/src/features/chat/composer/slash-commands.ts @@ -20,9 +20,9 @@ export const SLASH_COMMANDS = [ { command: "/archive", usage: "/archive ", argsKind: "requiredThread", detail: "Archive the selected Codex thread." }, { command: "/auto-review", - usage: "/auto-review [message]", - argsKind: "optionalMessage", - detail: "Toggle approval auto-review, optionally with a message.", + usage: "/auto-review", + argsKind: "none", + detail: "Toggle approval auto-review.", }, { command: "/fast", usage: "/fast", argsKind: "none", detail: "Toggle fast service tier for subsequent turns." }, { command: "/plan", usage: "/plan [message]", argsKind: "optionalMessage", detail: "Toggle Plan mode, optionally with a message." }, diff --git a/src/features/chat/slash-commands.ts b/src/features/chat/slash-commands.ts index 16564142..e79d6cdf 100644 --- a/src/features/chat/slash-commands.ts +++ b/src/features/chat/slash-commands.ts @@ -154,7 +154,6 @@ export async function executeSlashCommand( if (command === "auto-review") { await context.toggleAutoReview(); - if (args) return { sendText: args }; return; } diff --git a/tests/features/chat/composer/slash-commands.test.ts b/tests/features/chat/composer/slash-commands.test.ts index 50412fdb..2a22d930 100644 --- a/tests/features/chat/composer/slash-commands.test.ts +++ b/tests/features/chat/composer/slash-commands.test.ts @@ -225,13 +225,13 @@ describe("slash commands", () => { expect(result).toBeUndefined(); }); - it("returns message text after toggling auto-review for /auto-review arguments", async () => { + it("rejects /auto-review arguments", async () => { const ctx = context(); - const result = await executeSlashCommand("auto-review", "この依頼からお願いします", ctx); + await executeSlashCommand("auto-review", "この依頼からお願いします", ctx); - expect(ctx.toggleAutoReview).toHaveBeenCalledOnce(); - expect(result).toEqual({ sendText: "この依頼からお願いします" }); + expect(ctx.toggleAutoReview).not.toHaveBeenCalled(); + expect(ctx.addSystemMessage).toHaveBeenCalledWith("/auto-review does not take arguments. Usage: /auto-review"); }); it("rejects /compact arguments", async () => { @@ -367,10 +367,8 @@ describe("slash commands", () => { ); }); - it("documents that /auto-review can take a message", () => { - expect(slashCommandHelpLines().find((line) => line.startsWith("/auto-review"))).toBe( - "/auto-review [message] - Toggle approval auto-review, optionally with a message.", - ); + it("documents auto-review", () => { + expect(slashCommandHelpLines().find((line) => line.startsWith("/auto-review"))).toBe("/auto-review - Toggle approval auto-review."); }); it("documents rollback", () => {