@@ -620,7 +620,13 @@ impl ApiClient {
620620 // Each user message gets the next response group in sequence
621621 let response_index = ctx. count_user_messages ( ) . saturating_sub ( 1 ) ; // 0-indexed
622622
623- tracing:: debug!( actor="MockLLM" , user_message=ctx. current_user_message( ) , count=ctx. count_user_messages( ) , response_index) ;
623+ tracing:: debug!(
624+ actor="MockLLM" ,
625+ user_message=ctx. current_user_message( ) ,
626+ count=ctx. count_user_messages( ) ,
627+ response_index,
628+ response_groups=?response_groups,
629+ ) ;
624630
625631 // Send the corresponding response group
626632 if response_index < response_groups. len ( ) {
@@ -635,29 +641,8 @@ impl ApiClient {
635641 input,
636642 stop,
637643 } => {
638- // For tool events, we need to create proper tool use structure
639- if stop. unwrap_or ( false ) {
640- // This is a complete tool use - parse the arguments
641- let args = input
642- . as_ref ( )
643- . map ( |s| {
644- serde_json:: from_str ( s) . unwrap_or ( serde_json:: Value :: String ( s. clone ( ) ) )
645- } )
646- . unwrap_or ( serde_json:: Value :: Null ) ;
647-
648- let _tool_use = crate :: cli:: chat:: AssistantToolUse {
649- id : tool_use_id. clone ( ) ,
650- name : name. clone ( ) ,
651- orig_name : name. clone ( ) ,
652- args : args. clone ( ) ,
653- orig_args : args,
654- } ;
655-
656- // For now, just send text response about tool use since we don't have direct tool event API
657- // TODO: Implement proper tool event support in MockLLMContext if needed
658- ctx. respond ( format ! ( "[Tool: {} with args: {}]" , name, tool_use_id) )
659- . await ?;
660- }
644+ ctx. respond_tool_use ( tool_use_id. clone ( ) , name. clone ( ) , input. clone ( ) , stop. clone ( ) )
645+ . await ?;
661646 } ,
662647 _ => { } , // Ignore other event types
663648 }
0 commit comments