From 714914b14c373e58238bc3234d8e2e9f7e325672 Mon Sep 17 00:00:00 2001 From: Ramon Nogueira Date: Tue, 23 Jun 2026 19:02:08 -0400 Subject: [PATCH] feat(open-swe): disable "Request changes" until the plan has a comment (#1602) Requesting changes hands the reviewer comments to the agent, so it's meaningless with none. Disable the button (with a hint tooltip) until at least one comment exists; approve is unaffected. --- tests/e2e/tests/plan_review.spec.ts | 4 ++++ ui/src/components/agents/PlanReview.tsx | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/e2e/tests/plan_review.spec.ts b/tests/e2e/tests/plan_review.spec.ts index 85b57ec0..cd9032c7 100644 --- a/tests/e2e/tests/plan_review.spec.ts +++ b/tests/e2e/tests/plan_review.spec.ts @@ -89,10 +89,14 @@ test.describe("Plan review (HTTP comments)", () => { timeout: 30_000, }); await expect(owner.getByTestId("approve-plan")).toBeVisible(); + // "Request changes" is meaningless with no feedback → disabled until a + // comment exists. + await expect(owner.getByTestId("reject-plan")).toBeDisabled(); // Owner leaves a comment. await addComment(owner, "Owner: looks solid, ship it."); await expect(owner.getByTestId("plan-comment")).toHaveCount(1); + await expect(owner.getByTestId("reject-plan")).toBeEnabled(); // 4. A COLLABORATOR opens the same plan: sees it AND the owner's comment // (fetched over HTTP), but has NO approve button. diff --git a/ui/src/components/agents/PlanReview.tsx b/ui/src/components/agents/PlanReview.tsx index ea1c9c71..bafcf43c 100644 --- a/ui/src/components/agents/PlanReview.tsx +++ b/ui/src/components/agents/PlanReview.tsx @@ -128,7 +128,14 @@ export function PlanReview({ plan }: { plan: PlanData }) {