fix(#732): status JSON allowed_tools.entries:null→[] when unrestricted; callers can use .entries|length without null guard

This commit is contained in:
YeonGyu-Kim
2026-05-26 12:36:13 +09:00
parent 29dcd478a0
commit 4c16a42f39
2 changed files with 7 additions and 1 deletions

View File

@@ -6929,7 +6929,11 @@ fn status_json_value(
let degraded = context.config_load_error.is_some();
let model_source = provenance.map(|p| p.source.as_str());
let model_raw = provenance.and_then(|p| p.raw.clone());
let allowed_tool_entries = allowed_tools.map(|tools| tools.iter().cloned().collect::<Vec<_>>());
// #732: always emit an array (empty when unrestricted) so callers can do
// `.allowed_tools.entries | length > 0` without a null-check first.
let allowed_tool_entries = allowed_tools
.map(|tools| tools.iter().cloned().collect::<Vec<_>>())
.unwrap_or_default();
json!({
"kind": "status",
"action": "show",