| 560 | |
| 561 | it('keeps two concurrent subagent lanes separate for text and thinking', async () => { |
| 562 | const send = (parent: string, channel: MothershipStreamV1TextChannel, text: string) => |
| 563 | subAgentHandlers.text( |
| 564 | { |
| 565 | type: MothershipStreamV1EventType.text, |
| 566 | scope: { |
| 567 | lane: 'subagent', |
| 568 | parentToolCallId: parent, |
| 569 | spanId: `span-${parent}`, |
| 570 | agentId: 'research', |
| 571 | }, |
| 572 | payload: { channel, text }, |
| 573 | } satisfies StreamEvent, |
| 574 | context, |
| 575 | execContext, |
| 576 | { interactive: false, timeout: 1000 } |
| 577 | ) |
| 578 | |
| 579 | // Interleaved thinking across two concurrent lanes. |
| 580 | await send('A', MothershipStreamV1TextChannel.thinking, 'A-think-1 ') |