fix(#788): skills show not-found emitted duplicate JSON error envelope; use exit(1) instead of Err propagation

This commit is contained in:
YeonGyu-Kim
2026-05-27 09:36:11 +09:00
parent 113145a42a
commit abdbf61acf
3 changed files with 107 additions and 6 deletions

View File

@@ -6333,12 +6333,10 @@ impl LiveCli {
let is_help_action = result.get("action").and_then(|v| v.as_str()) == Some("help");
println!("{}", serde_json::to_string_pretty(&result)?);
if is_error && !is_help_action {
return Err(result
.get("message")
.and_then(|v| v.as_str())
.unwrap_or("skills command failed")
.to_string()
.into());
// #788: the error JSON is already emitted above; returning Err here
// would cause the top-level handler to emit a second error envelope.
// Exit directly to signal failure without a duplicate envelope.
std::process::exit(1);
}
}
}