refactor(extension): remove dead MCP toggle plumbing#336
Open
FlyM1ss wants to merge 1 commit into
Open
Conversation
The MCP mode toggle UI was disabled (commented out) in an earlier
cleanup, so `document.getElementById('mcpModeSwitch')` always returned
null and `useMCP` was hardwired to false at every call site. MCP is now
the default for all agents: the LLM runs with the MCP tools server-side
on the standard chat endpoints, so there is no client-side mode to pick.
Remove the now-dead plumbing:
- api.js: drop the `useMCP` param from getChatResponse /
getChatResponseStream and the unreachable `if (useMCP)` branch, which
also silently disabled streaming whenever the toggle was set.
- handlers.js: drop the mcpModeSwitch read, the `!useMCP` term in the
streaming gate, the 'MCP mode' status label, and the useMCP argument
at every call site.
- settings_window.js: delete the commented-out MCP toggle tombstone.
RAG is left untouched (a separately parked feature). No behavior change:
useMCP was always false, so no reachable code path is altered.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
MCP is now the default for every agent, so the client-side "MCP Mode" toggle is obsolete. Its UI was already disabled (commented out) in an earlier cleanup, which meant
useMCPwas hardwired tofalseat every call site. This PR removes the resulting dead plumbing.Why now
The toggle predates MCP being always-on. Because
document.getElementById('mcpModeSwitch')returnsnull(the control is commented out),useMCPcould never betrue. The leftover code was actively misleading:if (useMCP)branch ingetChatResponseStreamthat routed to the non-streaming path — i.e. it would have disabled streaming if the toggle ever came back;!useMCPterm in the streaming gate and a'MCP mode'status label that can never show.Changes
useMCPparam fromgetChatResponse/getChatResponseStream; delete the unreachableif (useMCP)non-streaming branch; correct the endpoint comment.mcpModeSwitchread, the!useMCPterm incanStream, the'MCP mode'detail label, and theuseMCPargument at all call sites (includingcreateActionButtons).Scope / safety
useMCPwas provably alwaysfalse, so no reachable path is altered.security/extension-post-sse(feat(extension): migrate chat endpoints to POST fetch-streaming (v0.16.0) #335) because it edits the same post-migrationapi.js; GitHub will retarget this tomainonce feat(extension): migrate chat endpoints to POST fetch-streaming (v0.16.0) #335 merges.Verification
bun test— 55 pass, no new failures.bun run build:full— webpack compiles clean;dist/main.jscontains zerouseMCP/mcpModeSwitchreferences.🤖 Generated with Claude Code