Skip to content

Commit 1ade03b

Browse files
committed
fix(web): settled subagent members keep their status word
Failed and stopped members show the status next to their metrics so the outcome is not carried by color alone, and the remaining spawn-row comments no longer call it a CTA.
1 parent f7cf1f3 commit 1ade03b

2 files changed

Lines changed: 18 additions & 13 deletions

File tree

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3888,9 +3888,14 @@ function AgentSpawnMemberRow({
38883888
]
38893889
.filter(Boolean)
38903890
.join(" · ");
3891-
const statusLabel = activeStatus
3892-
? AGENT_MEMBER_STATUS_LABEL[agent.status]
3893-
: meta || AGENT_MEMBER_STATUS_LABEL[agent.status];
3891+
// Settled members show their metrics; anything other than success keeps
3892+
// the status word so the outcome is not carried by color alone.
3893+
const statusLabel =
3894+
activeStatus || !meta
3895+
? AGENT_MEMBER_STATUS_LABEL[agent.status]
3896+
: agent.status === "completed"
3897+
? meta
3898+
: `${AGENT_MEMBER_STATUS_LABEL[agent.status]} · ${meta}`;
38943899
const role =
38953900
agent.role && agent.role.trim().toLowerCase() !== agent.title.trim().toLowerCase()
38963901
? agent.role

‎apps/web/src/session-logic.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ interface DerivedWorkLogEntry extends WorkLogEntry {
101101
[workLogCollapseKey]?: string;
102102
toolCallId?: string;
103103
isWorkflowCoordinator?: boolean;
104-
/** Shell/monitor/plan tasks: ordinary work-log rows, never spawn CTAs. */
104+
/** Shell/monitor/plan tasks: ordinary work-log rows, never spawn rows. */
105105
isBackgroundTask?: boolean;
106106
}
107107

@@ -171,7 +171,7 @@ export function workEntrySignalsSevereFailure(entry: WorkLogEntry): boolean {
171171

172172
/** Tool-like row with neither clear success nor failure (empty, incomplete, in progress, etc.). */
173173
export function workEntryIndicatesToolNeutralStatus(entry: WorkLogEntry): boolean {
174-
// Spawn CTA rows are never neutral-hidden: mid-run they derive from
174+
// Spawn rows are never neutral-hidden: mid-run they derive from
175175
// task.progress (tone "thinking") and the neutral filter was swallowing
176176
// them exactly while the fleet ran — the one moment they matter most.
177177
if (entry.agentSpawn !== undefined) {
@@ -396,7 +396,7 @@ export function hasActionableProposedPlan(
396396
* - task.updated is fold input only (status patches are not narrative).
397397
* Unattributed rows always stay: over-hiding loses the only terminal signal.
398398
*/
399-
/** Agent (non-background) task.started rows seed spawn CTA batches. */
399+
/** Agent (non-background) task.started rows seed spawn batches. */
400400
function isAgentTaskStartedActivity(activity: OrchestrationThreadActivity): boolean {
401401
const payload =
402402
activity.payload && typeof activity.payload === "object"
@@ -423,10 +423,10 @@ function isAgentInternalActivity(activity: OrchestrationThreadActivity): boolean
423423
activity.kind === "task.completed";
424424
// Task rows classify by the server stamp: a subagent's own background
425425
// shell (agentId + "background") is agent-internal, but a nested AGENT
426-
// (agentId + "agent") stays visible so its rows can anchor a spawn CTA
426+
// (agentId + "agent") stays visible so its rows can anchor a spawn row
427427
// (review finding: hiding on agentId alone removed nested agents and
428428
// their anchors). Bypassed agent lifecycle rows also pass — collapse
429-
// folds every such row into its batch's single CTA row, which is how
429+
// folds every such row into its batch's single spawn row, which is how
430430
// Codex children (whose rows are ALL bypassed) get an anchor at the
431431
// spawn point.
432432
if (isTaskRow) {
@@ -455,10 +455,10 @@ export function deriveWorkLogEntries(
455455
for (const activity of foldUserInputActivities(ordered)) {
456456
if (activity.tone !== "error" && isWorktreeSetupActivity(activity.kind)) continue;
457457
if (activity.kind === "tool.started") continue;
458-
// Agent task.started rows are CTA seeds: they carry the true spawn turn,
458+
// Agent task.started rows are spawn seeds: they carry the true spawn turn,
459459
// which is the batch key (completions of background subagents arrive
460460
// under later synthetic turns and must not start new batches). They
461-
// collapse into the batch's single CTA row, never render standalone.
461+
// collapse into the batch's single spawn row, never render standalone.
462462
if (activity.kind === "task.started" && !isAgentTaskStartedActivity(activity)) continue;
463463
if (activity.kind === "task.updated") continue;
464464
if (activity.kind === "tool.progress") continue;
@@ -657,7 +657,7 @@ function agentSpawnGroupKey(entry: DerivedWorkLogEntry): string {
657657
}
658658
// No turn id means no batch signal at all: fall back to one group per
659659
// task. Unrelated turn-less spawns (separate fleets whose rows lost their
660-
// turn) must not collapse into one immortal "direct:no-turn" CTA
660+
// turn) must not collapse into one immortal "direct:no-turn" spawn
661661
// accumulating every agent the thread ever ran (review finding). Adapters
662662
// stamp spawn turns (Codex spawnTurnId; Claude rows ride real turns), so
663663
// this path is defensive.
@@ -680,7 +680,7 @@ function collapseDerivedWorkLogEntries(
680680
const collapsed: DerivedWorkLogEntry[] = [];
681681
// Subagent rows collapse by spawn group, not adjacency: a workflow run (or
682682
// a turn's batch of direct spawns) is ONE narrative event in the chat — a
683-
// CTA row that opens the Agents panel — no matter how many agents it
683+
// spawn row in the timeline — no matter how many agents it
684684
// contains or how their progress rows interleave (quiet-timeline
685685
// guarantee).
686686
const spawnRowIndex = new Map<string, number>();
@@ -713,7 +713,7 @@ function collapseDerivedWorkLogEntries(
713713
: [...(existing.agentSpawn?.agentTaskIds ?? []), entry.taskId];
714714
collapsed[existingIndex] = {
715715
...mergeDerivedWorkLogEntries(existing, entry),
716-
// The CTA row keeps the group's ANCHOR identity, not the last
716+
// The spawn row keeps the group's ANCHOR identity, not the last
717717
// agent's: id/createdAt/turnId stay pinned to the spawn point so
718718
// the row renders where the run launched instead of drifting to
719719
// the newest progress tick (mid-run it drifted below the whole

0 commit comments

Comments
 (0)