Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<ThreadNow
attention={null}
syncPhase={null}
goal={null}
work={backgroundWorkNowItem({
environmentId: EnvironmentId.make("test"),
threadId: ThreadId.make("thread"),
tasks: [
{
taskId: "subagent-task",
kind: "subagent",
description: "Review refactor diffs",
childThreadId: ThreadId.make("child"),
},
],
turnItems: [],
stopDisabled: false,
stopping: false,
onStop: async () => 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();
});
3 changes: 2 additions & 1 deletion apps/web/src/components/chat/BackgroundWorkDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -79,7 +80,7 @@ export function BackgroundWorkDetails(props: {
<div className="flex items-baseline justify-between gap-3">
<h3 className="font-medium">{title}</h3>
<span className="shrink-0 text-xs text-muted-foreground">
{task.awaited
{backgroundWorkHoldsCompletion([task])
? gt("Waiting", { $context: "status of background work" })
: gt("Running", { $context: "status of background work" })}
</span>
Expand Down
Loading