fix: add status field to sandbox JSON envelope (ok/warn/error derived from enabled+active+supported)

This commit is contained in:
YeonGyu-Kim
2026-05-25 14:34:00 +09:00
parent b64df99134
commit 85e736c73f

View File

@@ -6971,8 +6971,23 @@ fn print_sandbox_status_snapshot(
} }
fn sandbox_json_value(status: &runtime::SandboxStatus) -> serde_json::Value { 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!({ json!({
"kind": "sandbox", "kind": "sandbox",
"status": top_status,
"enabled": status.enabled, "enabled": status.enabled,
"active": status.active, "active": status.active,
"supported": status.supported, "supported": status.supported,