From 6ab77612f54fb6ed1240c7b215de7069a362ca18 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 16 Mar 2026 00:00:00 -0400 Subject: [PATCH] fix: make tool allowlist/blocklist matching case-insensitive Tool names stored via the dashboard can arrive in any case (e.g. uppercase FILE_READ vs registered name file_read). The previous case-sensitive comparison caused allowlisted tools to silently match nothing, giving the agent an empty effective tool set with no error or warning. Normalise both sides with to_lowercase() so the filter works regardless of how the names were entered. Co-Authored-By: Claude Sonnet 4.6 --- crates/openfang-kernel/src/kernel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/openfang-kernel/src/kernel.rs b/crates/openfang-kernel/src/kernel.rs index 5e582d04..5f5f7b7c 100644 --- a/crates/openfang-kernel/src/kernel.rs +++ b/crates/openfang-kernel/src/kernel.rs @@ -5164,10 +5164,10 @@ impl OpenFangKernel { .unwrap_or_default(); if !tool_allowlist.is_empty() { - all_tools.retain(|t| tool_allowlist.iter().any(|a| a == &t.name)); + all_tools.retain(|t| tool_allowlist.iter().any(|a| a.to_lowercase() == t.name.to_lowercase())); } if !tool_blocklist.is_empty() { - all_tools.retain(|t| !tool_blocklist.iter().any(|b| b == &t.name)); + all_tools.retain(|t| !tool_blocklist.iter().any(|b| b.to_lowercase() == t.name.to_lowercase())); } // Step 5: Remove shell_exec if exec_policy denies it.