-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix(mothership): parallel subagent rendering #4299
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
base: staging
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -361,29 +361,26 @@ export async function runStreamLoop( | |
| flushSubagentThinkingBlock(context) | ||
| flushThinkingBlock(context) | ||
| if (spanEvt === MothershipStreamV1SpanLifecycleEvent.start) { | ||
| const lastParent = context.subAgentParentStack[context.subAgentParentStack.length - 1] | ||
| const lastBlock = context.contentBlocks[context.contentBlocks.length - 1] | ||
| if (toolCallId) { | ||
| if (lastParent !== toolCallId) { | ||
| if (!context.subAgentParentStack.includes(toolCallId)) { | ||
| context.subAgentParentStack.push(toolCallId) | ||
| } | ||
| context.subAgentParentToolCallId = toolCallId | ||
| context.subAgentContent[toolCallId] ??= '' | ||
| context.subAgentToolCalls[toolCallId] ??= [] | ||
| } | ||
| if ( | ||
| subagentName && | ||
| !( | ||
| lastParent === toolCallId && | ||
| lastBlock?.type === 'subagent' && | ||
| lastBlock.content === subagentName | ||
| if (subagentName) { | ||
| const alreadyOpen = context.contentBlocks.some( | ||
| (b) => | ||
| b.type === 'subagent' && b.content === subagentName && b.endedAt === undefined | ||
| ) | ||
| ) { | ||
| context.contentBlocks.push({ | ||
| type: 'subagent', | ||
| content: subagentName, | ||
|
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. Parallel same-name subagents collapse into single blockMedium Severity The Reviewed by Cursor Bugbot for commit 340c154. Configure here. |
||
| timestamp: Date.now(), | ||
| }) | ||
| if (!alreadyOpen) { | ||
| context.contentBlocks.push({ | ||
| type: 'subagent', | ||
| content: subagentName, | ||
| timestamp: Date.now(), | ||
| }) | ||
| } | ||
| } | ||
| return | ||
| } | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.