diff --git a/apps/web/src/components/chat/BackgroundWorkDetails.browser.test.tsx b/apps/web/src/components/chat/BackgroundWorkDetails.browser.test.tsx index 01311a60ecf4..d5d5d62d3c2a 100644 --- a/apps/web/src/components/chat/BackgroundWorkDetails.browser.test.tsx +++ b/apps/web/src/components/chat/BackgroundWorkDetails.browser.test.tsx @@ -95,3 +95,35 @@ it("opens full command details for short labels and keeps pending tasks current" await page.getByRole("button", { name: "Close", exact: true }).click(); await expect.element(page.getByRole("dialog")).not.toBeInTheDocument(); }); + +it("gives a subagent the same status as the background work line", async () => { + await using screen = await render( + undefined, + onOpenThread: () => undefined, + })} + />, + ); + await expect.element(page.getByText("Waiting ยท Review refactor diffs")).toBeVisible(); + await screen.getByRole("button", { name: "Details", exact: true }).click(); + await expect + .element(page.getByRole("dialog").getByText("Waiting", { exact: true })) + .toBeVisible(); +}); diff --git a/apps/web/src/components/chat/BackgroundWorkDetails.tsx b/apps/web/src/components/chat/BackgroundWorkDetails.tsx index 8679275e9de6..72ca70c2b16e 100644 --- a/apps/web/src/components/chat/BackgroundWorkDetails.tsx +++ b/apps/web/src/components/chat/BackgroundWorkDetails.tsx @@ -4,6 +4,7 @@ import type { ThreadId, } from "@t3tools/contracts"; import type { ThreadStructure } from "@t3tools/client-runtime/state/shell"; +import { backgroundWorkHoldsCompletion } from "@t3tools/shared/orchestrationV2PendingBackgroundWork"; import { T, useGT } from "gt-react"; import { useState } from "react"; @@ -79,7 +80,7 @@ export function BackgroundWorkDetails(props: {

{title}

- {task.awaited + {backgroundWorkHoldsCompletion([task]) ? gt("Waiting", { $context: "status of background work" }) : gt("Running", { $context: "status of background work" })}