From 0f62a430b20344a7e1d61014aebffb47867c550b Mon Sep 17 00:00:00 2001 From: Yash Singh Date: Sun, 1 Nov 2026 18:21:41 -0600 Subject: [PATCH 1/3] fix(web): clarify the waiting label for background work --- .../components/chat/ThreadActivityBanners.tsx | 52 ++++++++++--------- .../src/state/threadExecution.ts | 10 ++-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/apps/web/src/components/chat/ThreadActivityBanners.tsx b/apps/web/src/components/chat/ThreadActivityBanners.tsx index 217d0b6ea92b7..99dd032a3bbf3 100644 --- a/apps/web/src/components/chat/ThreadActivityBanners.tsx +++ b/apps/web/src/components/chat/ThreadActivityBanners.tsx @@ -11,6 +11,7 @@ import { type RunStopPresentation, } from "@t3tools/client-runtime/state/thread-execution"; import { childThreadInputsTitle } from "@t3tools/client-runtime/state/threads"; +import { commandDisplayText } from "@t3tools/client-runtime/work-log/command-label"; import { formatDuration } from "@t3tools/shared/orchestrationTiming"; import * as DateTime from "effect/DateTime"; import { @@ -25,7 +26,6 @@ import { } from "lucide-react"; import { Fragment } from "react"; import { tickTextContent } from "~/lib/tickTextContent"; -import { cn } from "~/lib/utils"; import { Button, InlineButton } from "../ui/button"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import type { ComposerBannerStackItem } from "./ComposerBannerStack"; @@ -174,6 +174,14 @@ export function backgroundWorkNowItem(input: { const subagent = item?.type === "subagent" ? item : undefined; return { task, + label: + item?.type === "command_execution" && commandDisplayText(item.input) === task.label ? ( + + {task.label} + + ) : ( + task.label + ), activity: subagent?.progress?.replace(/\s+/gu, " ").trim() || null, startedAtMs: item?.startedAt ? DateTime.toEpochMillis(item.startedAt) : null, updatedAtMs: subagent ? DateTime.toEpochMillis(subagent.updatedAt) : 0, @@ -185,35 +193,29 @@ export function backgroundWorkNowItem(input: { .filter((row) => row.activity) .toSorted((left, right) => right.updatedAtMs - left.updatedAtMs)[0]; const isCommand = (row: (typeof rows)[number]) => row.task.kind !== "subagent"; - const verb = presentation.waiting ? "Waiting on" : "Running"; const onlyThreadId = only?.childThreadId; const startedAtMs = only?.startedAtMs ?? null; return { id: `background-work:${input.threadId}`, icon: rows.every(isCommand) ? : , - title: only ? ( - <> - {verb}{" "} - - {only.task.label} - - - ) : ( - presentation.title - ), - description: only ? ( - only.activity - ) : newest ? ( - `${newest.task.label}: ${newest.activity}` - ) : rows.every(isCommand) ? ( - {rows.map((row) => row.task.label).join(", ")} - ) : ( - rows.map((row) => row.task.label).join(", ") - ), + title: + only && typeof only.label !== "string" ? ( + <> + {presentation.waiting ? "Waiting" : "Running"} · {only.label} + + ) : ( + presentation.title + ), + description: only + ? only.activity + : newest + ? `${newest.task.label}: ${newest.activity}` + : rows.map((row, index) => ( + + {index > 0 ? ", " : null} + {row.label} + + )), actions: ( <> {startedAtMs === null ? null : ( diff --git a/packages/client-runtime/src/state/threadExecution.ts b/packages/client-runtime/src/state/threadExecution.ts index 361f44f717edb..b6151c7c875be 100644 --- a/packages/client-runtime/src/state/threadExecution.ts +++ b/packages/client-runtime/src/state/threadExecution.ts @@ -433,12 +433,10 @@ export function presentPendingBackgroundWork( if (items.length === 1 && only !== undefined) { const noun = BACKGROUND_WORK_KINDS[only.kind].singular; const named = only.label !== noun; - const title = waiting - ? named - ? `${only.kind === "monitor" ? "" : `Waiting on ${noun} `}${only.label}` - : `Waiting on a ${noun}` - : named - ? `Running: ${only.label}` + const title = named + ? `${waiting ? "Waiting" : "Running"} · ${only.label}` + : waiting + ? `Waiting on a ${noun}` : `Running a ${noun}`; return { title, items, waiting }; } From 8a3b3787c2ce98200022d86fe5d30435ebf8cafb Mon Sep 17 00:00:00 2001 From: Yash Singh Date: Sun, 1 Nov 2026 18:33:50 -0600 Subject: [PATCH 2/3] fix(web): preserve multiline background labels in details --- apps/web/src/components/chat/ThreadActivityBanners.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/src/components/chat/ThreadActivityBanners.tsx b/apps/web/src/components/chat/ThreadActivityBanners.tsx index 99dd032a3bbf3..e36774cee5fc5 100644 --- a/apps/web/src/components/chat/ThreadActivityBanners.tsx +++ b/apps/web/src/components/chat/ThreadActivityBanners.tsx @@ -179,6 +179,8 @@ export function backgroundWorkNowItem(input: { {task.label} + ) : task.label.includes("\n") ? ( + {task.label} ) : ( task.label ), From 62db2c73bb9761576da62fd6b7635d484002fe52 Mon Sep 17 00:00:00 2001 From: Yash Singh Date: Sun, 1 Nov 2026 18:44:12 -0600 Subject: [PATCH 3/3] fix(web): keep background labels consistent across banner rows --- .../components/chat/ThreadActivityBanners.tsx | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/chat/ThreadActivityBanners.tsx b/apps/web/src/components/chat/ThreadActivityBanners.tsx index e36774cee5fc5..368931833dc72 100644 --- a/apps/web/src/components/chat/ThreadActivityBanners.tsx +++ b/apps/web/src/components/chat/ThreadActivityBanners.tsx @@ -201,23 +201,27 @@ export function backgroundWorkNowItem(input: { id: `background-work:${input.threadId}`, icon: rows.every(isCommand) ? : , title: - only && typeof only.label !== "string" ? ( + only && typeof only.label !== "string" && only.task.label !== only.task.kind ? ( <> {presentation.waiting ? "Waiting" : "Running"} · {only.label} ) : ( presentation.title ), - description: only - ? only.activity - : newest - ? `${newest.task.label}: ${newest.activity}` - : rows.map((row, index) => ( - - {index > 0 ? ", " : null} - {row.label} - - )), + description: only ? ( + only.activity + ) : newest ? ( + <> + {newest.label}: {newest.activity} + + ) : ( + rows.map((row, index) => ( + + {index > 0 ? ", " : null} + {row.label} + + )) + ), actions: ( <> {startedAtMs === null ? null : (