From 67fd164dfcac0b0ae6abee632bf07ccdeaad757e Mon Sep 17 00:00:00 2001 From: damocles Date: Thu, 8 Oct 2026 00:49:17 +0200 Subject: [PATCH] tool_groups: match names case-insensitively, like capabilities::is_known --- hive-c0re/src/agent_config/tool_groups.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hive-c0re/src/agent_config/tool_groups.rs b/hive-c0re/src/agent_config/tool_groups.rs index ae7ccc6e..c1379dd8 100644 --- a/hive-c0re/src/agent_config/tool_groups.rs +++ b/hive-c0re/src/agent_config/tool_groups.rs @@ -50,12 +50,14 @@ fn read_from(path: &Path) -> std::io::Result>> { Ok(map) } -/// True if `name` matches a recognised [`hive_sh4re::permissions::ToolGroup`] -/// exactly (same comparison [`validate_groups`] uses). +/// True if `name` matches a recognised [`hive_sh4re::permissions::ToolGroup`], +/// case-insensitive (same comparison [`validate_groups`] uses, and the same +/// comparison `capabilities::is_known` uses — a hand-edited `"Meta"` in the +/// file should round-trip, not get pruned). fn is_known(name: &str) -> bool { hive_sh4re::permissions::ToolGroup::ALL .iter() - .any(|g| <&str>::from(*g) == name) + .any(|g| name.eq_ignore_ascii_case(<&str>::from(*g))) } /// Drop any tool-group string in `map` that isn't a recognised