-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: restore MCP tool auto-approval behavior for issue #9214 #9215
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: main
Are you sure you want to change the base?
Conversation
…nabled - Fixed regression introduced in #9157 where MCP tools required individual alwaysAllow property - When alwaysAllowMcp is true, all MCP tools are now auto-approved by default - Tools can still opt-out by explicitly setting alwaysAllow=false - Added comprehensive tests for MCP auto-approval scenarios Fixes #9204
Review completed. Found 1 minor issue to address:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| import type { McpServer, McpTool } from "../../shared/mcp" | ||
|
|
||
| import { isWriteToolAction, isReadOnlyToolAction } from "./tools" | ||
| import { isMcpToolAlwaysAllowed } from "./mcp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The isMcpToolAlwaysAllowed import is no longer used after the refactoring and should be removed to keep the code clean.
Fix it with Roo Code or mention @roomote and request a fix.
lemiesz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR attempts to address Issue #9214. Feedback and guidance are welcome.
Problem
After the recent refactoring that moved auto-approval logic from ChatView to Task (#9157), the MCP auto-approval behavior changed. When
alwaysAllowMcpwas enabled with tools marked as "always allow", the UI was still asking for permission in v3.31.1.Solution
Changed the logic to properly handle MCP tool auto-approval:
alwaysAllowMcpis enabled → auto-approve all MCP tools by defaultalwaysAllow=falseChanges
src/core/auto-approval/index.tsto check globalalwaysAllowMcpfirstsrc/core/auto-approval/__tests__/checkAutoApproval.spec.tsTesting
Fixes #9214
Important
Restores MCP tool auto-approval behavior in
index.tsand adds tests incheckAutoApproval.spec.tsto handle global and individual tool settings.alwaysAllowMcpis enabled inindex.ts.alwaysAllow=false.checkAutoApproval.spec.tsfor various scenarios including missing tools, invalid JSON, and unknown servers.This description was created by
for b8f00cc. You can customize this summary. It will automatically update as commits are pushed.