Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Nov 12, 2025

Problem

MCP auto-approval was not working even when both alwaysAllowMcp and tool-specific alwaysAllow flags were enabled.

Root Cause

During the auto-approval refactor in #9157, ClineProvider.getState() was missing the mcpServers property that getStateToPostToWebview() includes. This caused isMcpToolAlwaysAllowed() to receive undefined for the servers list, always returning false.

Fix

Added mcpServers: this.mcpHub?.getAllServers() ?? [] to the getState() method return value, matching the implementation in getStateToPostToWebview().

Testing

Verified with debug logging that:

  • Before fix: state.mcpServers was undefined (count: 0)
  • After fix: state.mcpServers contains configured servers with tools

Fixes #9190


Important

Fixes ClineProvider.getState() to include mcpServers, resolving auto-approval issues.

  • Behavior:
    • Fixes ClineProvider.getState() in ClineProvider.ts to include mcpServers property, aligning it with getStateToPostToWebview().
    • Ensures isMcpToolAlwaysAllowed() receives the correct servers list, fixing the auto-approval issue.
  • Testing:
    • Verified state.mcpServers was undefined before the fix and contains configured servers after the fix.

This description was created by Ellipsis for a89ce92. You can customize this summary. It will automatically update as commits are pushed.

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
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Nov 12, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 12, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed - no issues found.

This PR correctly fixes the MCP auto-approval bug by adding the missing mcpServers property to getState(). The implementation matches getStateToPostToWebview() and properly enables the auto-approval logic to check tool-specific alwaysAllow flags.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Nov 12, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 12, 2025
@mrubens mrubens merged commit 7323bba into main Nov 12, 2025
29 of 31 checks passed
@mrubens mrubens deleted the fix/mcp-auto-approval-missing-servers branch November 12, 2025 18:03
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Nov 12, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Nov 13, 2025
* 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