Repository navigation
fix(web): a turn waiting on a foreground subagent no longer reads as Thinking #35060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
730be8b
6972e5f
430189c
8290155
f336978
1b1d6f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -531,6 +531,7 @@ type MessagesTimelineRowContent = | |
| createdAt: string | null; | ||
| groupId?: string; | ||
| expanded?: boolean; | ||
| waitingOnSubagents?: number; | ||
| } | ||
| | { | ||
| kind: "work-toggle"; | ||
|
|
@@ -2267,6 +2268,29 @@ export function deriveMessagesTimelineRows(input: { | |
| } | ||
| } | ||
|
|
||
| // The open run is only waiting when its subagent group is its newest work; finished text the | ||
| // parent wrote after launching them does not count as work. | ||
| let waitingOnSubagents = 0; | ||
| for (let index = timelineEntries.length - 1; input.isWorking && index >= 0; index -= 1) { | ||
| const entry = timelineEntries[index]!; | ||
| if ( | ||
| entry.kind === "message" && | ||
| entry.message.role === "assistant" && | ||
| !entry.message.streaming && | ||
| entry.message.runId === unsettledRunId | ||
| ) { | ||
| continue; | ||
| } | ||
| if ( | ||
| entry.kind !== "event" || | ||
| entry.projectedItem.item.type !== "subagent" || | ||
| entry.projectedItem.item.runId == null || | ||
| entry.projectedItem.item.runId !== unsettledRunId | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stop at the newest subagent group's provider-turn boundary. The event grouping at Line 2148 separates subagents by If an older group contains a running child and the newest group contains only completed children from another provider turn in the same run, the scan reaches the older child and suppresses Stop when
|
||
| ) { | ||
| break; | ||
| } | ||
| if (isLiveSubagentTurnItem(entry.projectedItem.item)) waitingOnSubagents += 1; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Determine waiting status before visibility filtering. In Use the unfiltered activity sequence to determine waiting status. Extend the existing streaming-parent-reply case with
|
||
| } | ||
| const hasWorkingRow = nextRows.some((row) => row.kind === "working"); | ||
| if (input.isWorking && !hasWorkingRow && activeTurnHeaderIndex === timelineEntries.length) { | ||
| appendWorkingRow(); | ||
|
|
@@ -2300,6 +2324,7 @@ export function deriveMessagesTimelineRows(input: { | |
| kind: "thinking", | ||
| id: LIVE_ACTIVITY_ROW_ID, | ||
| createdAt: input.activeTurnStartedAt ?? null, | ||
| ...(waitingOnSubagents > 0 ? { waitingOnSubagents } : {}), | ||
| }); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
chat/MessagesTimeline.logic.ts:2274With
toolCallVisibility: "hideAll", this scan reportswaitingOnSubagentsand renders “Waiting on a subagent” even when the parent is executing acommand_execution.timelineEntrieshas already hidden that parent work, so it cannot terminate the scan; useinput.timelineEntriesto determine activity ordering.🚀 Reply "fix it for me" or copy this AI Prompt for your agent: