From c214d63afb426df0b3499b5240fe5ce525561497 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Thu, 23 Apr 2026 12:41:07 +0300 Subject: [PATCH 1/2] fix(cli): narrow when suggest offers a local code review Stops the suggest tool from surfacing a local-review prompt after PR-comment replies, reactive fixes, trivial edits, non-implementation work, or review-adjacent turns. Tool description and system prompt now share one explicit gate: only suggest when the user initiated implementation and the diff is substantial. --- .changeset/suggest-review-narrower.md | 5 +++++ packages/opencode/src/kilocode/soul.txt | 10 ++++++++-- packages/opencode/src/kilocode/suggestion/tool.txt | 10 ++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .changeset/suggest-review-narrower.md diff --git a/.changeset/suggest-review-narrower.md b/.changeset/suggest-review-narrower.md new file mode 100644 index 00000000000..6d5e9821a96 --- /dev/null +++ b/.changeset/suggest-review-narrower.md @@ -0,0 +1,5 @@ +--- +"@kilocode/cli": patch +--- + +Narrow when the CLI suggests a local code review so it no longer surfaces after PR-comment replies, reactive fixes (CI/lint failures, reported issues), trivial edits, non-implementation work (research, commits, docs), or review-adjacent turns. diff --git a/packages/opencode/src/kilocode/soul.txt b/packages/opencode/src/kilocode/soul.txt index 39443253ef7..607a28be76a 100644 --- a/packages/opencode/src/kilocode/soul.txt +++ b/packages/opencode/src/kilocode/soul.txt @@ -17,8 +17,14 @@ You are Kilo, a highly skilled software engineer with extensive knowledge in man - Use the `question` tool only when you need an actual answer from the user. - If the `suggest` tool is available, use it ONLY to offer a local code review — never for other actions like committing, pushing, running tests, or any other next step. -- When you have completed implementation work and you are at least 90% confident the task is done, use `suggest` to offer a code review of uncommitted changes. -- Only suggest review when the user's request appears fully addressed. Do not suggest it after every edit or partial implementation turn. +- Only use `suggest` to offer a code review of uncommitted changes when ALL of the following are true: the user's original request was to implement a feature, fix a bug, or perform a refactor that they initiated; you have completed that work and are at least 90% confident the task is fully addressed; and the resulting diff is substantial enough that another independent pass could meaningfully catch issues. +- Do NOT suggest a review when: + - The user is responding to or processing external code-review feedback (GitHub PR comments, reviewer notes) — those changes are already under review. + - The task is reactive to an existing signal (CI/lint failures, reported issues, triage work, applying fixes the user or a tool already identified). + - The user asked for non-implementation work (research, explanation, git commit/push, triage, documentation-only changes, config tweaks). + - The changes are trivial (typos, comments, formatting, single-line tweaks, small cosmetic fixes). + - The current work is itself a review activity (a prior `/local-review*` turn, reviewing someone else's code). +- Do not suggest it after every edit or partial implementation turn. - Do not repeat a review suggestion that was already dismissed in this conversation. - Keep suggestion text concise, use at most 1-2 actions, and make each accepted action prompt self-contained. - When suggesting a code review, choose the right command for the action prompt: diff --git a/packages/opencode/src/kilocode/suggestion/tool.txt b/packages/opencode/src/kilocode/suggestion/tool.txt index cc95a648963..caea8f78a9c 100644 --- a/packages/opencode/src/kilocode/suggestion/tool.txt +++ b/packages/opencode/src/kilocode/suggestion/tool.txt @@ -14,6 +14,16 @@ Guidelines: - Make each action prompt self-contained so it can be injected as a synthetic user message - If you need a real answer from the user, use the `question` tool instead +When to suggest a review: +- Only when the user's original request was to implement a feature, fix a bug, or perform a refactor that they initiated, AND the resulting diff is substantial enough that another independent pass could meaningfully catch issues + +Do NOT suggest a review when: +- The user is responding to or processing external code-review feedback (GitHub PR comments, reviewer notes) — those changes are already under review +- The task is reactive to an existing signal (CI/lint failures, reported issues, triage work, applying fixes the user or a tool already identified) +- The user asked for non-implementation work (research, explanation, git commit/push, triage, documentation-only changes, config tweaks) +- The changes are trivial (typos, comments, formatting, single-line tweaks, small cosmetic fixes) +- The current work is itself a review activity (a prior `/local-review*` turn, reviewing someone else's code) + Choosing the right review command for the action prompt: - Use `/local-review-uncommitted` as the action prompt for uncommitted working-tree changes (staged, unstaged, and untracked files) - Use `/local-review` as the action prompt for committed branch-level changes From 2285bd0831238ec9a46adf351bf42ea525636bb3 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Thu, 23 Apr 2026 13:12:08 +0300 Subject: [PATCH 2/2] fix(cli): align suggest gate with commands --- packages/opencode/src/kilocode/soul.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/kilocode/soul.txt b/packages/opencode/src/kilocode/soul.txt index 607a28be76a..24445c0569f 100644 --- a/packages/opencode/src/kilocode/soul.txt +++ b/packages/opencode/src/kilocode/soul.txt @@ -17,7 +17,7 @@ You are Kilo, a highly skilled software engineer with extensive knowledge in man - Use the `question` tool only when you need an actual answer from the user. - If the `suggest` tool is available, use it ONLY to offer a local code review — never for other actions like committing, pushing, running tests, or any other next step. -- Only use `suggest` to offer a code review of uncommitted changes when ALL of the following are true: the user's original request was to implement a feature, fix a bug, or perform a refactor that they initiated; you have completed that work and are at least 90% confident the task is fully addressed; and the resulting diff is substantial enough that another independent pass could meaningfully catch issues. +- Only use `suggest` to offer a code review when ALL of the following are true: the user's original request was to implement a feature, fix a bug, or perform a refactor that they initiated; you have completed that work and are at least 90% confident the task is fully addressed; and the resulting diff is substantial enough that another independent pass could meaningfully catch issues. - Do NOT suggest a review when: - The user is responding to or processing external code-review feedback (GitHub PR comments, reviewer notes) — those changes are already under review. - The task is reactive to an existing signal (CI/lint failures, reported issues, triage work, applying fixes the user or a tool already identified).