Make auto-review slash command bare

This commit is contained in:
murashit 2026-06-01 18:36:03 +09:00
parent 0c7cea5c2b
commit 3a9753424f
3 changed files with 9 additions and 12 deletions

View file

@ -20,9 +20,9 @@ export const SLASH_COMMANDS = [
{ command: "/archive", usage: "/archive <thread>", 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." },

View file

@ -154,7 +154,6 @@ export async function executeSlashCommand(
if (command === "auto-review") {
await context.toggleAutoReview();
if (args) return { sendText: args };
return;
}

View file

@ -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", () => {