diff --git a/packages/opencode/src/command/index.ts b/packages/opencode/src/command/index.ts index 3a19f1901f3..0655ef15a2b 100644 --- a/packages/opencode/src/command/index.ts +++ b/packages/opencode/src/command/index.ts @@ -12,7 +12,7 @@ import { MCP } from "../mcp" import { Skill } from "../skill" import { localReviewCommand, localReviewUncommittedCommand } from "@/kilocode/review/command" // kilocode_change import PROMPT_INITIALIZE from "./template/initialize.txt" -import PROMPT_REVIEW from "./template/review.txt" +// kilocode_change: PROMPT_REVIEW intentionally not imported — /review is disabled, see comment below. type State = { commands: Record @@ -94,18 +94,11 @@ export const layer = Layer.effect( }, hints: hints(PROMPT_INITIALIZE), } - commands[Default.REVIEW] = { - name: Default.REVIEW, - description: "review changes [commit|branch|pr], defaults to uncommitted", - source: "command", - get template() { - return PROMPT_REVIEW.replace("${path}", ctx.worktree) - }, - subtask: true, - hints: hints(PROMPT_REVIEW), - } - // kilocode_change start + // /review is intentionally disabled — use /local-review and /local-review-uncommitted instead. + // It was accidentally re-introduced via the OpenCode v1.3.0 merge (PR #8772, commit b1811147). + // Do NOT re-enable without explicit team discussion. + commands[Default.LOCAL_REVIEW] = localReviewCommand() commands[Default.LOCAL_REVIEW_UNCOMMITTED] = localReviewUncommittedCommand() // kilocode_change end diff --git a/packages/opencode/test/kilocode/local-review-command.test.ts b/packages/opencode/test/kilocode/local-review-command.test.ts index e05e03deb17..66abfe0e623 100644 --- a/packages/opencode/test/kilocode/local-review-command.test.ts +++ b/packages/opencode/test/kilocode/local-review-command.test.ts @@ -1,5 +1,9 @@ import { describe, expect, test } from "bun:test" +import { Effect, Layer } from "effect" +import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner" +import { Command } from "../../src/command" import { localReviewCommand, localReviewUncommittedCommand, parseReviewCommand } from "../../src/kilocode/review/command" +import { testEffect } from "../lib/effect" describe("review command parsing", () => { test("parses review slash commands", () => { @@ -158,3 +162,26 @@ describe("local-review-uncommitted command", () => { expect(text).toContain("NO_FINDINGS") }) }) + +// Guard against accidental re-introduction of /review. +// +// /review was intentionally disabled in favour of /local-review and +// /local-review-uncommitted. It was accidentally re-enabled during the +// OpenCode v1.3.0 upstream merge (PR #8772, commit b1811147) because the +// kilocode_change suppression comment was lost in conflict resolution. +// This test ensures the same mistake cannot silently ship again. +const it = testEffect(Layer.mergeAll(Command.defaultLayer, CrossSpawnSpawner.defaultLayer)) + +describe("/review command guard", () => { + it.instance( + "/review is not present in the registered command list", + () => + Effect.gen(function* () { + const svc = yield* Command.Service + const list = yield* svc.list() + const names = list.map((c) => c.name) + expect(names).not.toContain("review") + }), + { git: true }, + ) +})