mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-04-10 17:59:37 +08:00
fix(cli): emit JSON for --resume with no command in --output-format json mode
claw --output-format json --resume <session> (no command) was printing:
'Restored session from <path> (N messages).'
to stdout as prose, regardless of output format.
Now emits:
{"kind":"restored","session_id":"...","path":"...","message_count":N}
159 CLI tests pass.
This commit is contained in:
parent
8dcf10361f
commit
4f670e5513
@ -2256,11 +2256,23 @@ fn resume_session(session_path: &Path, commands: &[String], output_format: CliOu
|
||||
};
|
||||
|
||||
if commands.is_empty() {
|
||||
println!(
|
||||
"Restored session from {} ({} messages).",
|
||||
resolved_path.display(),
|
||||
session.messages.len()
|
||||
);
|
||||
if output_format == CliOutputFormat::Json {
|
||||
println!(
|
||||
"{}",
|
||||
serde_json::json!({
|
||||
"kind": "restored",
|
||||
"session_id": session.session_id,
|
||||
"path": resolved_path.display().to_string(),
|
||||
"message_count": session.messages.len(),
|
||||
})
|
||||
);
|
||||
} else {
|
||||
println!(
|
||||
"Restored session from {} ({} messages).",
|
||||
resolved_path.display(),
|
||||
session.messages.len()
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user