Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions packages/opencode/src/command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Info>
Expand Down Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions packages/opencode/test/kilocode/local-review-command.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down Expand Up @@ -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 },
)
})
Loading