-
Notifications
You must be signed in to change notification settings - Fork 1
Fix dangerous command detection for mixed-case tool names #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughIntroduces case-insensitive tool-name matching in DangerousCommandService by normalizing configured tool names. Updates scan logic to use a precomputed lowercased set. Adds a unit test verifying detection when tool name case differs, asserting the matched rule remains unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant DangerousCommandService as Service
participant Config
Caller->>Service: scan(tool_name, args)
Service->>Config: read tool_names
note right of Service: Build _normalized_tool_names (lowercased)
alt tool_name (case-insensitive) in _normalized_tool_names
Service->>Service: evaluate command against rules
Service-->>Caller: Detection result (rule e.g., "git-reset-hard")
else not matched
Service-->>Caller: None
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (1)tests/unit/core/services/test_dangerous_command_service.py (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
Comment |
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68ec26d70c8083338f26e9e0caaa409e
Summary by CodeRabbit