From 85e736c73ff1aeda9b9d2a4e9392b7583d9e4997 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 25 May 2026 14:34:00 +0900 Subject: [PATCH] fix: add status field to sandbox JSON envelope (ok/warn/error derived from enabled+active+supported) --- rust/crates/rusty-claude-cli/src/main.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index 41cdf194..722c3588 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -6971,8 +6971,23 @@ fn print_sandbox_status_snapshot( } fn sandbox_json_value(status: &runtime::SandboxStatus) -> serde_json::Value { + // Derive top-level status so automation can do a single field check + // instead of combining enabled/active/supported booleans. + // ok = not enabled (not requested), OR enabled and active + // warn = enabled and supported but not yet active (degraded) + // error = enabled but unsupported on this platform + let top_status = if !status.enabled { + "ok" + } else if status.active { + "ok" + } else if status.supported { + "warn" + } else { + "error" + }; json!({ "kind": "sandbox", + "status": top_status, "enabled": status.enabled, "active": status.active, "supported": status.supported,