From 6400698a8ec5c50d2074746c97c6266d160ed5a5 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Sun, 15 Nov 2026 00:12:41 -0600 Subject: [PATCH] test(e2e): find the native Plan chip in the Coordinator chat thread (#21727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The QA Cloud plan-revise-accept journey checks that a person can revise and approve an agent's Plan > - It first checks that the saved Plan chip is visible, scoped to a settled `task-chat-turn` so a live "Writing plan" chip cannot count > - The Coordinator workspace renders the Plan chip directly in the chat thread; there is no `task-chat-turn` element and no `data-settled` attribute > - So the journey never finds the chip and fails before the person reviews the plan > - This pull request also accepts the chip in the chat thread > - The benefit is that the plan journey reaches the revision and approval steps it exists to test ## Linked Issues or Issue Description **What happened?** On QA Cloud (build 5acf27bc), plan-revise-accept failed with `journey_operation_failed`, no checks passed, one run. The agent saved a correct two-step Plan and a revision-bound confirmation. The confirmation stayed pending until cleanup closed the task, so the browser never reached it. **Steps to reproduce** 1. Open the failed journey task on QA (Coordinator workspace). 2. Query `[data-testid="task-chat-turn"][data-settled="true"] [data-testid="task-chat-plan-preview"]`: 0 matches. 3. Query `[data-testid="task-chat-thread"] [data-testid="task-chat-plan-preview"]`: 1 visible match, aria-label "Open Plan revision 1 in task sidebar". **Expected behavior** The journey finds the saved Plan chip and continues to "Request changes". ## What Changed - `planStageRootSelector(native)`: native root is a settled task-chat turn or the task chat thread. `expectPlanStageVisible` uses it. The revision-name check from #21701 is unchanged. Why this still detects the failure that matters: `runPlanRevisionAcceptance` waits through the API until every task run is terminal before this check, and the aria-label must name the exact revision, which a live "Writing plan" chip does not. ## Verification - On the live failed QA page: old scope finds 0 chips; new scope finds 1 visible chip whose label matches `planPreviewLabel(1)`. - `tests/runner-e2e` plan-revision tests: 4 pass (new selector test included). - QA Cloud rerun of plan-revise-accept follows after merge and the harness pin update. ## Risks - Low risk: journey code only. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 --- tests/runner-e2e/plan-revision-flow.test.ts | 7 ++++++- tests/runner-e2e/plan-revision-flow.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/runner-e2e/plan-revision-flow.test.ts b/tests/runner-e2e/plan-revision-flow.test.ts index 39322920453..dabad3d46fb 100644 --- a/tests/runner-e2e/plan-revision-flow.test.ts +++ b/tests/runner-e2e/plan-revision-flow.test.ts @@ -1,6 +1,6 @@ import { expect, it, vi } from "vitest"; import type { Page } from "@playwright/test"; -import { planPreviewLabel, runPlanRevisionAcceptance } from "./plan-revision-flow.js"; +import { planPreviewLabel, planStageRootSelector, runPlanRevisionAcceptance } from "./plan-revision-flow.js"; const state = { currentIssue: { status: "in_progress" }, @@ -44,3 +44,8 @@ it("accepts the classic and Coordinator Plan preview names for the exact revisio expect(planPreviewLabel(2).test("Open Plan revision 1 in task sidebar")).toBe(false); expect(planPreviewLabel(1).test("Open Plan in task sidebar")).toBe(false); }); + +it("finds the native Plan chip in a settled turn or directly in the Coordinator chat thread", () => { + expect(planStageRootSelector(true).split(", ")).toEqual(['[data-testid="task-chat-turn"][data-settled="true"]', '[data-testid="task-chat-thread"]']); + expect(planStageRootSelector(false)).toBe("body"); +}); diff --git a/tests/runner-e2e/plan-revision-flow.ts b/tests/runner-e2e/plan-revision-flow.ts index 553926580bb..f8e0df77840 100644 --- a/tests/runner-e2e/plan-revision-flow.ts +++ b/tests/runner-e2e/plan-revision-flow.ts @@ -23,8 +23,12 @@ export function planPreviewLabel(revision: number): RegExp { return new RegExp(`^Open Plan revision ${revision}(?: in task sidebar)?$`); } +export function planStageRootSelector(native: boolean): string { + return native ? '[data-testid="task-chat-turn"][data-settled="true"], [data-testid="task-chat-thread"]' : "body"; +} + export async function expectPlanStageVisible(page: Page, options: { native: boolean; revision: number | null }) { - const root = options.native ? page.locator('[data-testid="task-chat-turn"][data-settled="true"]') : page.locator("body"); + const root = page.locator(planStageRootSelector(options.native)); const preview = root.getByTestId("task-chat-plan-preview").last(); await expect(preview).toBeVisible({ timeout: 30_000 }); if (options.revision !== null) await expect(preview).toHaveAttribute("aria-label", planPreviewLabel(options.revision));