The best way to control Claude Code, Codex and more from any computer or phone
fix(web): clarify the waiting label for background work (#28969)
Yash Singh committed
Nov 1, 2026 at 19:58 UTC
05c0ed7da69ee6aceab8fad84e8a0dc0c474138a
2 files changed
+32
-26
apps/web/src/components/chat/ThreadActivityBanners.tsx
+28
-20
@@ -11,6 +11,7 @@ import {
11
type RunStopPresentation,
12
} from "@t3tools/client-runtime/state/thread-execution";
13
import { childThreadInputsTitle } from "@t3tools/client-runtime/state/threads";
14
+import { commandDisplayText } from "@t3tools/client-runtime/work-log/command-label";
15
import { formatDuration } from "@t3tools/shared/orchestrationTiming";
16
import * as DateTime from "effect/DateTime";
17
import {
@@ -25,7 +26,6 @@ import {
26
} from "lucide-react";
27
import { Fragment } from "react";
28
import { tickTextContent } from "~/lib/tickTextContent";
28
-import { cn } from "~/lib/utils";
29
import { Button, InlineButton } from "../ui/button";
30
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
31
import type { ComposerBannerStackItem } from "./ComposerBannerStack";
@@ -174,6 +174,16 @@ export function backgroundWorkNowItem(input: {
174
const subagent = item?.type === "subagent" ? item : undefined;
175
return {
176
task,
177
+ label:
178
+ item?.type === "command_execution" && commandDisplayText(item.input) === task.label ? (
179
+ <span className="font-mono in-data-[slot=popover-popup]:whitespace-pre-wrap">
180
+ {task.label}
181
+ </span>
182
+ ) : task.label.includes("\n") ? (
183
+ <span className="in-data-[slot=popover-popup]:whitespace-pre-wrap">{task.label}</span>
184
+ ) : (
185
+ task.label
186
+ ),
187
activity: subagent?.progress?.replace(/\s+/gu, " ").trim() || null,
188
startedAtMs: item?.startedAt ? DateTime.toEpochMillis(item.startedAt) : null,
189
updatedAtMs: subagent ? DateTime.toEpochMillis(subagent.updatedAt) : 0,
@@ -185,34 +195,32 @@ export function backgroundWorkNowItem(input: {
195
.filter((row) => row.activity)
196
.toSorted((left, right) => right.updatedAtMs - left.updatedAtMs)[0];
197
const isCommand = (row: (typeof rows)[number]) => row.task.kind !== "subagent";
188
- const verb = presentation.waiting ? "Waiting on" : "Running";
198
const onlyThreadId = only?.childThreadId;
199
const startedAtMs = only?.startedAtMs ?? null;
200
return {
201
id: `background-work:${input.threadId}`,
202
icon: rows.every(isCommand) ? <TerminalIcon /> : <CircleDashedIcon />,
194
- title: only ? (
195
- <>
196
- {verb}{" "}
197
- <span
198
- className={cn(
199
- isCommand(only) && "font-mono in-data-[slot=popover-popup]:whitespace-pre-wrap",
200
- )}
201
- >
202
- {only.task.label}
203
- </span>
204
- </>
205
- ) : (
206
- presentation.title
207
- ),
203
+ title:
204
+ only && typeof only.label !== "string" && only.task.label !== only.task.kind ? (
205
+ <>
206
+ {presentation.waiting ? "Waiting" : "Running"} · {only.label}
207
+ </>
208
+ ) : (
209
+ presentation.title
210
+ ),
211
description: only ? (
212
only.activity
213
) : newest ? (
211
- `${newest.task.label}: ${newest.activity}`
212
- ) : rows.every(isCommand) ? (
213
- <span className="font-mono">{rows.map((row) => row.task.label).join(", ")}</span>
214
+ <>
215
+ {newest.label}: {newest.activity}
216
+ </>
217
) : (
215
- rows.map((row) => row.task.label).join(", ")
218
+ rows.map((row, index) => (
219
+ <Fragment key={row.task.taskId}>
220
+ {index > 0 ? ", " : null}
221
+ {row.label}
222
+ </Fragment>
223
+ ))
224
),
225
actions: (
226
<>
packages/client-runtime/src/state/threadExecution.ts
+4
-6
@@ -433,12 +433,10 @@ export function presentPendingBackgroundWork(
433
if (items.length === 1 && only !== undefined) {
434
const noun = BACKGROUND_WORK_KINDS[only.kind].singular;
435
const named = only.label !== noun;
436
- const title = waiting
437
- ? named
438
- ? `${only.kind === "monitor" ? "" : `Waiting on ${noun} `}${only.label}`
439
- : `Waiting on a ${noun}`
440
- : named
441
- ? `Running: ${only.label}`
436
+ const title = named
437
+ ? `${waiting ? "Waiting" : "Running"} · ${only.label}`
438
+ : waiting
439
+ ? `Waiting on a ${noun}`
440
: `Running a ${noun}`;
441
return { title, items, waiting };
442
}