-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: include mcpServers in getState() for auto-approval #9199
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
Conversation
The getState() method was missing the mcpServers property that getStateToPostToWebview() includes. This caused MCP auto-approval to fail even when both alwaysAllowMcp and tool-specific flags were enabled, because isMcpToolAlwaysAllowed() had no servers to check. Fixes #9190
Review completed - no issues found. This PR correctly fixes the MCP auto-approval bug by adding the missing Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
* Add Intercom as a subprocessor (RooCodeInc#8718) * web: Leftover white bg (RooCodeInc#8719) Leftover white bg * feat(zgsm): add supportsMaxTokens flag and adjust max token handling * docs: update Configuring Profiles video link (RooCodeInc#8189) Co-authored-by: Roo Code <[email protected]> * Fix link text for Roomote Control in README (RooCodeInc#8742) * Try a 5s status mutation timeout (RooCodeInc#8734) * web: Landing page for the reviewerFirst pass (RooCodeInc#8740) * First pass * SEO * Update apps/web-roo-code/src/app/reviewer/page.tsx Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Remove GPT‑5 instructions/reasoning_summary from UI message metadata to prevent ui_messages.json bloat (RooCodeInc#8756) chore(gpt5): stop persisting instructions/reasoning_summary in UI message metadata Problem: ui_messages.json was getting bloated with unused or duplicated content (system 'instructions' and 'reasoning_summary') that we do not read back. Root cause: earlier OpenAI Responses API implementation persisted these fields to per-message metadata; however, 'instructions' are already sent as top-level request instructions and 'reasoning_summary' is surfaced live via streaming events. Neither field is consumed from storage. Changes: (1) Task.persistGpt5Metadata now stores only previous_response_id; (2) removed instructions and reasoning_summary from types; (3) updated Zod schema; (4) persistence layer writes messages as-is (no sanitizer); (5) tests green. Impact: smaller ui_messages.json, no runtime behavior change for requests. Migration: old metadata fields will be ignored by schema. * Z.ai: add GLM-4.5-X, AirX, Flash (expand model coverage) (RooCodeInc#8745) * feat(zai): add GLM-4.5-X, AirX, Flash; sync with Z.ai docs; keep canonical api line keys * feat(zai): add GLM-4.5V vision model (supportsImages, pricing, 16K max output); add tests * feat(types,zai): sync Z.AI international model map and tests - Update pricing, context window, and capabilities for: glm-4.5-x, glm-4.5-airx, glm-4.5-flash, glm-4.5v, glm-4.6 - Add glm-4-32b-0414-128k - Align tests with new model specs * fix(zai): align handler generics with expanded model ids to satisfy CI compile step * chore(zai): remove tier pricing blocks for Z.ai models * fix(zai): simplify names in zaiApiLineConfigs for clarity * chore(zai): set default temperature to 0.6 --------- Co-authored-by: Roo Code <[email protected]> * Enable browser-use tool for all image-capable models (RooCodeInc
Problem
MCP auto-approval was not working even when both
alwaysAllowMcpand tool-specificalwaysAllowflags were enabled.Root Cause
During the auto-approval refactor in #9157,
ClineProvider.getState()was missing themcpServersproperty thatgetStateToPostToWebview()includes. This causedisMcpToolAlwaysAllowed()to receiveundefinedfor the servers list, always returningfalse.Fix
Added
mcpServers: this.mcpHub?.getAllServers() ?? []to thegetState()method return value, matching the implementation ingetStateToPostToWebview().Testing
Verified with debug logging that:
state.mcpServerswas undefined (count: 0)state.mcpServerscontains configured servers with toolsFixes #9190
Important
Fixes
ClineProvider.getState()to includemcpServers, resolving auto-approval issues.ClineProvider.getState()inClineProvider.tsto includemcpServersproperty, aligning it withgetStateToPostToWebview().isMcpToolAlwaysAllowed()receives the correct servers list, fixing the auto-approval issue.state.mcpServerswas undefined before the fix and contains configured servers after the fix.This description was created by
for a89ce92. You can customize this summary. It will automatically update as commits are pushed.