@@ -492,33 +492,31 @@ impl ServerRuntime {
492492 } else {
493493 ItemKind :: ToolCall
494494 } ;
495- let payload = if runtime
496- . deps
497- . registry
498- . preparation_feedback ( & tool_name)
499- == ToolPreparationFeedback :: LiveOnly
500- {
501- serde_json:: to_value ( ToolCallPayload {
502- tool_call_id : tool_use_id. clone ( ) ,
503- tool_name : tool_name. clone ( ) ,
504- parameters : pending. input . clone ( ) ,
505- command_actions : command_actions_from_tool_input (
506- & tool_name,
507- & pending. command ,
508- & pending. input ,
509- ) ,
510- } )
511- . expect ( "serialize tool call payload" )
512- } else if is_file_change_tool ( & tool_name) {
513- serde_json:: to_value ( FileChangePayload {
514- tool_call_id : tool_use_id. clone ( ) ,
515- tool_name : Some ( tool_name. clone ( ) ) ,
516- changes : Vec :: new ( ) ,
517- is_error : false ,
518- } )
519- . expect ( "serialize file change payload" )
520- } else if pending. is_command_execution {
521- serde_json:: to_value ( CommandExecutionPayload {
495+ let payload =
496+ if runtime. deps . registry . preparation_feedback ( & tool_name)
497+ == ToolPreparationFeedback :: LiveOnly
498+ {
499+ serde_json:: to_value ( ToolCallPayload {
500+ tool_call_id : tool_use_id. clone ( ) ,
501+ tool_name : tool_name. clone ( ) ,
502+ parameters : pending. input . clone ( ) ,
503+ command_actions : command_actions_from_tool_input (
504+ & tool_name,
505+ & pending. command ,
506+ & pending. input ,
507+ ) ,
508+ } )
509+ . expect ( "serialize tool call payload" )
510+ } else if is_file_change_tool ( & tool_name) {
511+ serde_json:: to_value ( FileChangePayload {
512+ tool_call_id : tool_use_id. clone ( ) ,
513+ tool_name : Some ( tool_name. clone ( ) ) ,
514+ changes : Vec :: new ( ) ,
515+ is_error : false ,
516+ } )
517+ . expect ( "serialize file change payload" )
518+ } else if pending. is_command_execution {
519+ serde_json:: to_value ( CommandExecutionPayload {
522520 tool_call_id : tool_use_id. clone ( ) ,
523521 tool_name : tool_name. clone ( ) ,
524522 command : pending. command . clone ( ) ,
@@ -533,24 +531,24 @@ impl ServerRuntime {
533531 is_error : false ,
534532 } )
535533 . expect ( "serialize command execution payload" )
536- } else if is_plan_tool ( & tool_name) {
537- serde_json:: json!( {
538- "title" : "Plan" ,
539- "text" : ""
540- } )
541- } else {
542- serde_json:: to_value ( ToolCallPayload {
543- tool_call_id : tool_use_id. clone ( ) ,
544- tool_name : tool_name. clone ( ) ,
545- parameters : pending. input . clone ( ) ,
546- command_actions : command_actions_from_tool_input (
547- & tool_name,
548- & pending. command ,
549- & pending. input ,
550- ) ,
551- } )
552- . expect ( "serialize tool call payload" )
553- } ;
534+ } else if is_plan_tool ( & tool_name) {
535+ serde_json:: json!( {
536+ "title" : "Plan" ,
537+ "text" : ""
538+ } )
539+ } else {
540+ serde_json:: to_value ( ToolCallPayload {
541+ tool_call_id : tool_use_id. clone ( ) ,
542+ tool_name : tool_name. clone ( ) ,
543+ parameters : pending. input . clone ( ) ,
544+ command_actions : command_actions_from_tool_input (
545+ & tool_name,
546+ & pending. command ,
547+ & pending. input ,
548+ ) ,
549+ } )
550+ . expect ( "serialize tool call payload" )
551+ } ;
554552 let ( item_id, item_seq) = runtime
555553 . start_item (
556554 session_id,
0 commit comments