@@ -168,8 +168,7 @@ describe('Subagent Streaming', () => {
168168 await result
169169
170170 // Verify that subagent streaming messages were sent
171- expect ( mockSendSubagentChunk ) . toHaveBeenCalledTimes ( 2 )
172- expect ( mockWriteToClient ) . toHaveBeenCalledTimes ( 2 )
171+ expect ( mockWriteToClient ) . toHaveBeenCalledTimes ( 4 )
173172
174173 // First streaming chunk is a labled divider
175174 expect ( mockWriteToClient ) . toHaveBeenNthCalledWith ( 1 , {
@@ -180,25 +179,16 @@ describe('Subagent Streaming', () => {
180179 } )
181180
182181 // Check first streaming chunk
183- expect ( mockSendSubagentChunk ) . toHaveBeenNthCalledWith ( 1 , {
184- userInputId : 'test-input' ,
185- agentId : expect . any ( String ) ,
186- agentType : 'thinker' ,
187- chunk : 'Thinking about the problem...' ,
188- prompt : 'Think about this problem' ,
189- } )
182+ expect ( mockWriteToClient ) . toHaveBeenNthCalledWith (
183+ 2 ,
184+ 'Thinking about the problem...' ,
185+ )
190186
191187 // Check second streaming chunk
192- expect ( mockSendSubagentChunk ) . toHaveBeenNthCalledWith ( 2 , {
193- userInputId : 'test-input' ,
194- agentId : expect . any ( String ) ,
195- agentType : 'thinker' ,
196- chunk : 'Found a solution!' ,
197- prompt : 'Think about this problem' ,
198- } )
188+ expect ( mockWriteToClient ) . toHaveBeenNthCalledWith ( 3 , 'Found a solution!' )
199189
200190 // Last streaming chunk is a labeled divider
201- expect ( mockWriteToClient ) . toHaveBeenNthCalledWith ( 2 , {
191+ expect ( mockWriteToClient ) . toHaveBeenNthCalledWith ( 4 , {
202192 type : 'subagent_finish' ,
203193 agentId : 'thinker' ,
204194 displayName : 'Thinker' ,
0 commit comments