mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-07-30 06:32:17 +00:00
Merge pull request #682 from Fail-Safe/fix/tool-filter-case-insensitive
fix: make tool allowlist/blocklist matching case-insensitive
This commit is contained in:
@@ -5287,10 +5287,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.
|
||||
|
||||
Reference in New Issue
Block a user