fix: correct inverted logic in blocklist check (#1336)

The should_block_action method was checking if blocklist items start
with the action, instead of checking if the action starts with blocklist
items.

This caused commands like 'vim test.py' to not be blocked even though
'vim' is in the blocklist.

Before: f.startswith(action) - checks if 'vim' starts with 'vim test.py' (False)
After:  action.startswith(f) - checks if 'vim test.py' starts with 'vim' (True)

Fixes #1316

Co-authored-by: MiloBot <milobot@milobots-mini.home>
This commit is contained in:
thecaptain789
2026-02-06 02:11:08 +00:00
committed by GitHub
parent 0cd4f5d20c
commit c69d6f56c7
+1 -1
View File
@@ -355,7 +355,7 @@ class ToolHandler:
action = action.strip()
if not action:
return False
if any(f.startswith(action) for f in self.config.filter.blocklist):
if any(action.startswith(f) for f in self.config.filter.blocklist):
return True
if action in self.config.filter.blocklist_standalone:
return True