Skip to content

Commit 4ba5cae

Browse files
committed
fix(web): an Updated subagent notification keeps no status of its own
1 parent 4278aeb commit 4ba5cae

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎apps/web/src/components/chat/V2LifecycleRow.tsx‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,23 +415,28 @@ function SubagentTimelineLink(props: {
415415
(thread) => thread?.projection.subagents.find((agent) => agent.id === props.subagentId) ?? null,
416416
);
417417
const threadId = props.threadId;
418-
const status = props.event?.status ?? agent?.status ?? props.status;
419-
const statusLabel = props.event?.label ?? subagentStatusVisual(status).label;
418+
const liveStatus = agent?.status ?? props.status;
419+
const status = props.event ? props.event.status : liveStatus;
420+
const statusLabel = props.event?.label ?? subagentStatusVisual(liveStatus).label;
420421
const result = (agent?.result ?? props.result)?.trim();
421422
const progress = (agent?.progress ?? props.progress)?.trim();
422-
const settled = SETTLED_SUBAGENT_STATUSES.has(status);
423+
const settled = SETTLED_SUBAGENT_STATUSES.has(status ?? liveStatus);
423424
const rawDetail = settled ? result || progress : progress || result;
424425
const detail =
425426
rawDetail && !GENERIC_CHILD_END.test(rawDetail) ? plainDetail(rawDetail) || null : null;
426427
const failed = status === "failed";
427428
const timing = {
428-
status,
429+
status: liveStatus,
429430
startedAt: isoOrNull(agent?.startedAt ?? props.startedAt),
430431
completedAt: isoOrNull(agent?.completedAt ?? props.completedAt),
431432
};
432433
const content = (
433434
<>
434-
<SubagentAvatar driver={props.driver} provider={props.provider} status={status} />
435+
<SubagentAvatar
436+
driver={props.driver}
437+
provider={props.provider}
438+
status={status ?? undefined}
439+
/>
435440
<span className="min-w-0 flex-1">
436441
<span className="flex items-baseline gap-2">
437442
<span className="min-w-0 truncate text-xs font-medium text-foreground">
@@ -507,7 +512,7 @@ function SubagentTimelineLink(props: {
507512
{...props}
508513
elapsed={agent ? <AgentElapsed agent={projectedSubagentsToRuntime([agent])[0]!} /> : null}
509514
model={agent?.model ?? null}
510-
status={status}
515+
status={status ?? liveStatus}
511516
result={agent?.result ?? props.result}
512517
progress={agent?.progress ?? props.progress}
513518
/>

0 commit comments

Comments
 (0)