mirror of
https://github.com/instructkr/claw-code.git
synced 2026-11-18 00:00:00 +08:00
fix: mcp show <nonexistent> now returns status:error + error_kind:server_not_found + exit 1; extend ok:false gate to also check status:error
This commit is contained in:
1 parent
47521cf178
commit
181b12f0a9
2 files changed
+10
-2
No files matched your search
@@ -5872,7 +5872,8 @@ impl LiveCli {
|
||||
// Propagate ok:false → non-zero exit so automation callers
|
||||
// can rely on exit code instead of inspecting the envelope.
|
||||
// (#68: mcp error envelopes previously always exited 0.)
|
||||
let is_error = value.get("ok").and_then(|v| v.as_bool()) == Some(false);
|
||||
let is_error = value.get("ok").and_then(|v| v.as_bool()) == Some(false)
|
||||
|| value.get("status").and_then(|v| v.as_str()) == Some("error");
|
||||
println!("{}", serde_json::to_string_pretty(&value)?);
|
||||
if is_error {
|
||||
std::process::exit(1);
|
||||
|
||||
Reference in new issue
Block a user