From 11e2353585fac22568e2cd53d0cbffcd9d1b7e1b Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 10 Apr 2026 03:32:24 +0900 Subject: [PATCH] fix(cli): JSON parity for /export and /agents in resume mode /export now emits: {kind:export, file:, message_count:} /agents now emits: {kind:agents, text:} Previously both returned json:None and fell through to prose output even in --output-format json --resume mode. 159 CLI tests pass. --- rust/crates/rusty-claude-cli/src/main.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index d8ce69b..b1d2cf6 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -2835,14 +2835,19 @@ fn run_resume_command( SlashCommand::Export { path } => { let export_path = resolve_export_path(path.as_deref(), session)?; fs::write(&export_path, render_export_text(session))?; + let msg_count = session.messages.len(); Ok(ResumeCommandOutcome { session: session.clone(), message: Some(format!( "Export\n Result wrote transcript\n File {}\n Messages {}", export_path.display(), - session.messages.len(), + msg_count, )), - json: None, + json: Some(serde_json::json!({ + "kind": "export", + "file": export_path.display().to_string(), + "message_count": msg_count, + })), }) } SlashCommand::Agents { args } => { @@ -2850,7 +2855,10 @@ fn run_resume_command( Ok(ResumeCommandOutcome { session: session.clone(), message: Some(handle_agents_slash_command(args.as_deref(), &cwd)?), - json: None, + json: Some(serde_json::json!({ + "kind": "agents", + "text": handle_agents_slash_command(args.as_deref(), &cwd)?, + })), }) } SlashCommand::Skills { args } => {