(dc: &mut DoctorCounters, config: &serde_json::Value)
| 1046 | } |
| 1047 | |
| 1048 | fn doctor_check_agent_allowed_tools(dc: &mut DoctorCounters, config: &serde_json::Value) { |
| 1049 | let required = [KIRO_ALLOWED_BUILTIN_TOOLS, KIRO_ALLOWED_TRACEDECAY_TOOLS]; |
| 1050 | let missing: Vec<&str> = required |
| 1051 | .iter() |
| 1052 | .copied() |
| 1053 | .filter(|tool| !json_array_contains_str(config, "allowedTools", tool)) |
| 1054 | .collect(); |
| 1055 | |
| 1056 | if missing.is_empty() { |
| 1057 | dc.pass("Kiro tracedecay agent pre-approves built-in and tracedecay tools"); |
| 1058 | } else { |
| 1059 | dc.warn( |
| 1060 | "Kiro tracedecay agent allowedTools is not permissive -- run `tracedecay install --agent kiro`", |
| 1061 | ); |
| 1062 | for tool in missing { |
| 1063 | dc.info(&format!("missing allowedTools entry: {tool}")); |
| 1064 | } |
| 1065 | } |
| 1066 | } |
| 1067 | |
| 1068 | fn json_array_contains_str(config: &serde_json::Value, field: &str, expected: &str) -> bool { |
| 1069 | config |
no test coverage detected