mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-28 16:36:45 +00:00
fix(#739): skills unknown-subcommand JSON path no longer emits double error envelope; help action not propagated as Err
This commit is contained in:
@@ -6080,8 +6080,11 @@ impl LiveCli {
|
||||
CliOutputFormat::Json => {
|
||||
let result = handle_skills_slash_command_json(args, &cwd)?;
|
||||
let is_error = result.get("status").and_then(|v| v.as_str()) == Some("error");
|
||||
// #739: action:"help" with unexpected set is a usage response, not a fatal error;
|
||||
// don't return Err which would emit a second error envelope from the generic path.
|
||||
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 {
|
||||
if is_error && !is_help_action {
|
||||
return Err(result
|
||||
.get("message")
|
||||
.and_then(|v| v.as_str())
|
||||
|
||||
Reference in New Issue
Block a user