fix(sf): wire /sf rate to manual ops dispatcher

/sf rate was advertised in commands/catalog.ts and reachable from auto-mode
but had no branch in the manual ops handler — typing /sf rate outside
auto-mode silently no-op'd because ops.ts had no trimmed.startsWith("rate ")
branch. Add the dispatch alongside the existing /sf todo branch using the
same lazy-import pattern. handleRate from commands-rate.ts already exists.

Resolves: sf-monzctqn-m42nlq (command-dispatch-gap).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mikael Hugo 2026-05-02 14:24:23 +02:00
parent a8f0c63b0a
commit c19d987894

View file

@ -26,6 +26,7 @@ import {
handleSkip,
} from "../../commands-maintenance.js";
import { handlePrBranch } from "../../commands-pr-branch.js";
import { handleRate } from "../../commands-rate.js";
import { handleSessionReport } from "../../commands-session-report.js";
import { handleShip } from "../../commands-ship.js";
import { handleExport } from "../../export.js";
@ -136,6 +137,14 @@ export async function handleOpsCommand(
await handleRecover(ctx, projectRoot());
return true;
}
if (trimmed === "rate" || trimmed.startsWith("rate ")) {
await handleRate(
trimmed.replace(/^rate\s*/, "").trim(),
ctx,
projectRoot(),
);
return true;
}
if (trimmed === "export" || trimmed.startsWith("export ")) {
await handleExport(
trimmed.replace(/^export\s*/, "").trim(),
@ -189,6 +198,15 @@ export async function handleOpsCommand(
await handleTodo(trimmed.replace(/^todo\s*/, "").trim(), ctx, pi);
return true;
}
if (trimmed === "rate" || trimmed.startsWith("rate ")) {
const { handleRate } = await import("../../commands-rate.js");
await handleRate(
trimmed.replace(/^rate\s*/, "").trim(),
ctx,
process.cwd(),
);
return true;
}
if (trimmed === "config") {
await handleConfig(ctx);
return true;
@ -377,10 +395,7 @@ Examples:
trimmed.startsWith("wt ")
) {
const { handleWorktree } = await import("../../commands-worktree.js");
await handleWorktree(
trimmed.replace(/^(worktree|wt)\s*/, "").trim(),
ctx,
);
await handleWorktree(trimmed.replace(/^(worktree|wt)\s*/, "").trim(), ctx);
return true;
}
if (trimmed === "eval-review" || trimmed.startsWith("eval-review ")) {