Skip to content

Commit 11e2353

Browse files
committed
fix(cli): JSON parity for /export and /agents in resume mode
/export now emits: {kind:export, file:<path>, message_count:<n>} /agents now emits: {kind:agents, text:<agents report>} Previously both returned json:None and fell through to prose output even in --output-format json --resume mode. 159 CLI tests pass.
1 parent 0845705 commit 11e2353

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • rust/crates/rusty-claude-cli/src

rust/crates/rusty-claude-cli/src/main.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,22 +2835,30 @@ fn run_resume_command(
28352835
SlashCommand::Export { path } => {
28362836
let export_path = resolve_export_path(path.as_deref(), session)?;
28372837
fs::write(&export_path, render_export_text(session))?;
2838+
let msg_count = session.messages.len();
28382839
Ok(ResumeCommandOutcome {
28392840
session: session.clone(),
28402841
message: Some(format!(
28412842
"Export\n Result wrote transcript\n File {}\n Messages {}",
28422843
export_path.display(),
2843-
session.messages.len(),
2844+
msg_count,
28442845
)),
2845-
json: None,
2846+
json: Some(serde_json::json!({
2847+
"kind": "export",
2848+
"file": export_path.display().to_string(),
2849+
"message_count": msg_count,
2850+
})),
28462851
})
28472852
}
28482853
SlashCommand::Agents { args } => {
28492854
let cwd = env::current_dir()?;
28502855
Ok(ResumeCommandOutcome {
28512856
session: session.clone(),
28522857
message: Some(handle_agents_slash_command(args.as_deref(), &cwd)?),
2853-
json: None,
2858+
json: Some(serde_json::json!({
2859+
"kind": "agents",
2860+
"text": handle_agents_slash_command(args.as_deref(), &cwd)?,
2861+
})),
28542862
})
28552863
}
28562864
SlashCommand::Skills { args } => {

0 commit comments

Comments
 (0)