@@ -176,13 +176,9 @@ describe('runAgentStep - set_output tool', () => {
176176 '\n\n' +
177177 getToolCallString ( 'end_turn' , { } )
178178
179- spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( {
180- resolveMessageId,
181- } ) {
179+ spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( { } ) {
182180 yield { type : 'text' as const , text : mockResponse }
183- if ( resolveMessageId ) {
184- resolveMessageId ( 'mock-message-id' )
185- }
181+ return 'mock-message-id'
186182 } )
187183
188184 const sessionState = getInitialSessionState ( mockFileContext )
@@ -222,13 +218,9 @@ describe('runAgentStep - set_output tool', () => {
222218 findings : [ 'Bug in auth.ts' , 'Missing validation' ] ,
223219 } ) + getToolCallString ( 'end_turn' , { } )
224220
225- spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( {
226- resolveMessageId,
227- } ) {
221+ spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( { } ) {
228222 yield { type : 'text' as const , text : mockResponse }
229- if ( resolveMessageId ) {
230- resolveMessageId ( 'mock-message-id' )
231- }
223+ return 'mock-message-id'
232224 } )
233225
234226 const sessionState = getInitialSessionState ( mockFileContext )
@@ -269,13 +261,9 @@ describe('runAgentStep - set_output tool', () => {
269261 existingField : 'updated value' ,
270262 } ) + getToolCallString ( 'end_turn' , { } )
271263
272- spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( {
273- resolveMessageId,
274- } ) {
264+ spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( { } ) {
275265 yield { type : 'text' as const , text : mockResponse }
276- if ( resolveMessageId ) {
277- resolveMessageId ( 'mock-message-id' )
278- }
266+ return 'mock-message-id'
279267 } )
280268
281269 const sessionState = getInitialSessionState ( mockFileContext )
@@ -316,13 +304,9 @@ describe('runAgentStep - set_output tool', () => {
316304 const mockResponse =
317305 getToolCallString ( 'set_output' , { } ) + getToolCallString ( 'end_turn' , { } )
318306
319- spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( {
320- resolveMessageId,
321- } ) {
307+ spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( { } ) {
322308 yield { type : 'text' as const , text : mockResponse }
323- if ( resolveMessageId ) {
324- resolveMessageId ( 'mock-message-id' )
325- }
309+ return 'mock-message-id'
326310 } )
327311
328312 const sessionState = getInitialSessionState ( mockFileContext )
@@ -400,13 +384,9 @@ describe('runAgentStep - set_output tool', () => {
400384 )
401385
402386 // Mock the LLM stream to return a response that doesn't end the turn
403- spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( {
404- resolveMessageId,
405- } ) {
387+ spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( { } ) {
406388 yield { type : 'text' as const , text : 'Continuing with the analysis...' } // Non-empty response, no tool calls
407- if ( resolveMessageId ) {
408- resolveMessageId ( 'mock-message-id' )
409- }
389+ return 'mock-message-id'
410390 } )
411391
412392 const sessionState = getInitialSessionState ( mockFileContext )
@@ -550,16 +530,15 @@ describe('runAgentStep - set_output tool', () => {
550530 }
551531
552532 // Mock the LLM stream to spawn the inline agent
553- spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( {
554- resolveMessageId,
555- } ) {
556- yield { type : 'text' as const , text : getToolCallString ( 'spawn_agent_inline' , {
557- agent_type : 'message-deleter-agent' ,
558- prompt : 'Delete the last two assistant messages' ,
559- } ) }
560- if ( resolveMessageId ) {
561- resolveMessageId ( 'mock-message-id' )
533+ spyOn ( aisdk , 'promptAiSdkStream' ) . mockImplementation ( async function * ( { } ) {
534+ yield {
535+ type : 'text' as const ,
536+ text : getToolCallString ( 'spawn_agent_inline' , {
537+ agent_type : 'message-deleter-agent' ,
538+ prompt : 'Delete the last two assistant messages' ,
539+ } ) ,
562540 }
541+ return 'mock-message-id'
563542 } )
564543
565544 const sessionState = getInitialSessionState ( mockFileContext )
0 commit comments