fix: don't ask agent to address feedback on LGTM approval (#293)

* fix: don't ask agent to address feedback on LGTM approval (#284)

When the reviewer approves with no annotations, send a neutral
"Code review completed — no changes requested." message instead of
the contradictory "LGTM" + "Please address this feedback."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use explicit approved flag instead of annotations.length heuristic

The previous fix inferred LGTM from an empty annotations array, but
VS Code editor annotations are carried in feedbackMarkdown without
populating the annotations array — causing real review comments to be
misclassified as approvals. Thread an explicit `approved` boolean from
the UI through the review server to all three integrations.

Closes #284

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: append assertive instruction to review feedback output

When the reviewer submits actual feedback, append "The reviewer has
identified issues above. You must address all of them." so the agent
treats annotations with urgency rather than soft-acknowledging them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: annotate unused LGTM feedback string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michael Ramos
2026-03-14 17:58:57 -07:00
committed by GitHub
parent f5705cdb9c
commit 54e951e2f7
9 changed files with 38 additions and 14 deletions
+6 -1
View File
@@ -56,8 +56,9 @@ export interface ReviewServerResult {
url: string;
/** Whether running in remote mode */
isRemote: boolean;
/** Wait for user feedback submission */
/** Wait for user review decision */
waitForDecision: () => Promise<{
approved: boolean;
feedback: string;
annotations: unknown[];
agentSwitch?: string;
@@ -101,11 +102,13 @@ export async function startReviewServer(
// Decision promise
let resolveDecision: (result: {
approved: boolean;
feedback: string;
annotations: unknown[];
agentSwitch?: string;
}) => void;
const decisionPromise = new Promise<{
approved: boolean;
feedback: string;
annotations: unknown[];
agentSwitch?: string;
@@ -259,6 +262,7 @@ export async function startReviewServer(
if (url.pathname === "/api/feedback" && req.method === "POST") {
try {
const body = (await req.json()) as {
approved?: boolean;
feedback: string;
annotations: unknown[];
agentSwitch?: string;
@@ -266,6 +270,7 @@ export async function startReviewServer(
deleteDraft(draftKey);
resolveDecision({
approved: body.approved ?? false,
feedback: body.feedback || "",
annotations: body.annotations || [],
agentSwitch: body.agentSwitch,