From afa8288a4a9f0b64e7ad8bc057edd4230dd00b56 Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Wed, 18 Nov 2026 13:07:10 -0500 Subject: [PATCH] test(web): the move-thread family specs no longer race the parent link The fake shell stream in the ChatView browser harness dropped each thread's family fields (parentThreadId, attachedToParent and the rest), though the real server's shell carries them. A child learned its parent only ~160ms later from another stream. The Move threads dialog fixes its families when it opens, so on a slow runner the dialog could open first and leave the children unticked ("moves a family as one group" failed in the merge queue for #994). The harness now also left the Move threads dialog open across specs: its open state lives in a module store the per-spec reset never closed. After the family spec failed with it open, it reopened over the next mounts and blocked the Allow all click in "groups one computer's moves". toShellThread now passes the family fields through, and the per-spec reset closes the Move threads dialog like the other dialogs. --- apps/web/src/components/ChatView.browser-harness.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/web/src/components/ChatView.browser-harness.tsx b/apps/web/src/components/ChatView.browser-harness.tsx index c38510d67..d11409a14 100644 --- a/apps/web/src/components/ChatView.browser-harness.tsx +++ b/apps/web/src/components/ChatView.browser-harness.tsx @@ -76,6 +76,7 @@ import { import { closeConnectComputerDialog } from "./settings/connections/JoinComputerDialog"; import { closeProjectSetupDialog } from "./ProjectSetupDialog"; import { closeThreadMoveDialog } from "./ThreadMoveDialog"; +import { closeMoveThreadsDialog } from "./MoveThreadsDialog"; import { useComposerDraftStore, DraftId } from "../composerDraftStore"; import { connectEnvironmentBrowserHost } from "./browser/previewAutomationHost"; import { closeThreadBrowser, useBrowserPageWatchers } from "./browser/BrowserHostLayer"; @@ -884,6 +885,14 @@ function toShellThread(thread: OrchestrationReadModel["threads"][number]) { doneOverride: thread.doneOverride, lastSeenAt: thread.lastSeenAt, session: thread.session, + // A child thread's family, as the server's shell stream carries it: the + // app knows a thread's parent from the first snapshot, not only once a + // later detail stream reports it. + parentThreadId: thread.parentThreadId, + parentTurnId: thread.parentTurnId, + attachedToParent: thread.attachedToParent, + handedBackAt: thread.handedBackAt, + handedBackTurnId: thread.handedBackTurnId, latestUserMessageAt: thread.messages.findLast((message) => message.role === "user")?.createdAt ?? null, hasPendingApprovals: false, @@ -3431,6 +3440,7 @@ export function registerChatViewSuiteHooks(): void { __resetComputerLinksForTests(); closeConnectComputerDialog(); closeThreadMoveDialog(); + closeMoveThreadsDialog(); __resetThreadMovesForTests(); __resetMoveBatchProgressForTests(); closeProjectSetupDialog();