@@ -219,7 +219,7 @@ impl SubAgent {
219219 agent. agent_display_name,
220220 style:: ResetColor ,
221221 style:: SetForegroundColor ( Color :: DarkGrey ) ,
222- format !( "({})" , agent. agent_cli_name. clone( ) . unwrap_or_else( || "Default" . to_string( ) ) ) ,
222+ format_args !( "({})" , agent. agent_cli_name. clone( ) . unwrap_or_else( || "Default" . to_string( ) ) ) ,
223223 style:: ResetColor ,
224224 style:: SetForegroundColor ( Color :: Cyan ) ,
225225 status,
@@ -297,7 +297,7 @@ async fn get_agent_status(child_pid: u32) -> Result<String, eyre::Error> {
297297 return Ok ( "No response" . to_string ( ) ) ;
298298 }
299299 let response_str = std:: str:: from_utf8 ( & buffer[ ..n] ) . unwrap_or ( "<invalid utf8>" ) ;
300- match serde_json:: from_str :: < serde_json:: Value > ( & response_str) {
300+ match serde_json:: from_str :: < serde_json:: Value > ( response_str) {
301301 Ok ( json) => {
302302 let status = json. get ( "status" ) . and_then ( |v| v. as_str ( ) ) . unwrap_or ( "Running" ) ;
303303 let tokens = json. get ( "tokens_used" ) . and_then ( |v| v. as_u64 ( ) ) . unwrap_or ( 0 ) ;
@@ -329,7 +329,6 @@ async fn spawn_agent_task(
329329
330330 let debug_log = std:: fs:: OpenOptions :: new ( )
331331 . create ( true )
332- . write ( true )
333332 . append ( true )
334333 . open ( "debug.log" ) ?;
335334 let debug_log_stderr = debug_log. try_clone ( ) ?;
@@ -342,7 +341,7 @@ async fn spawn_agent_task(
342341
343342 let child_pid = child
344343 . id ( )
345- . ok_or_else ( || std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , "Failed to get child PID" ) ) ?;
344+ . ok_or_else ( || std:: io:: Error :: other ( "Failed to get child PID" ) ) ?;
346345
347346 // Only wrapping this in async tokio task causing each process on main thread
348347 // Allows extraction of child_pid before waiting on completion for status update
@@ -368,10 +367,9 @@ async fn get_grandchild_pid(parent_pid: u32) -> std::result::Result<u32, std::io
368367 if output. status . success ( ) {
369368 let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
370369 if let Some ( first_line) = stdout. lines ( ) . next ( ) {
371- return first_line
372- . trim ( )
373- . parse :: < u32 > ( )
374- . map_err ( |_| std:: io:: Error :: new ( std:: io:: ErrorKind :: InvalidData , "Failed to parse PID" ) ) ;
370+ return first_line. trim ( ) . parse :: < u32 > ( ) . map_err ( |err| {
371+ std:: io:: Error :: new ( std:: io:: ErrorKind :: InvalidData , format ! ( "Failed to parse PID: {}" , err) )
372+ } ) ;
375373 }
376374 }
377375 Err ( std:: io:: Error :: new (
0 commit comments