diff --git a/packages/opencode/src/kilocode/review/local-review.txt b/packages/opencode/src/kilocode/review/local-review.txt index a8285438dac..2e2020a4ae8 100644 --- a/packages/opencode/src/kilocode/review/local-review.txt +++ b/packages/opencode/src/kilocode/review/local-review.txt @@ -30,6 +30,8 @@ If user-provided instructions exist, they may refine review focus, but they MUST When no base is specified, choose a base by trying the following refs in order and using the first one that exists: +This priority list must match `Review.getBaseBranch()` in `packages/opencode/src/kilocode/review/review.ts`, which is used by the HTTP review endpoints. + 1. `origin/main` 2. `origin/master` 3. `origin/dev` diff --git a/packages/opencode/src/kilocode/review/review.ts b/packages/opencode/src/kilocode/review/review.ts index 11dc865f31a..26b80bd49cb 100644 --- a/packages/opencode/src/kilocode/review/review.ts +++ b/packages/opencode/src/kilocode/review/review.ts @@ -9,6 +9,7 @@ export namespace Review { * Detect base branch (main, master, dev, or develop) * Priority: main > master > dev > develop * Falls back to 'main' if none found + * Keep this in sync with the default base list in local-review.txt. */ export async function getBaseBranch(): Promise { const candidates = ["main", "master", "dev", "develop"] diff --git a/packages/opencode/test/kilocode/local-review-command.test.ts b/packages/opencode/test/kilocode/local-review-command.test.ts index e1e45ef7118..2212b5c7e79 100644 --- a/packages/opencode/test/kilocode/local-review-command.test.ts +++ b/packages/opencode/test/kilocode/local-review-command.test.ts @@ -37,6 +37,7 @@ describe("local-review command", () => { expect(text).toContain("local `dev`") expect(text).toContain("local `develop`") expect(text).toContain("fall back to `main`") + expect(text).toContain("Review.getBaseBranch()") }) test("template instructs the model to validate the base before reviewing", () => {