Skip to content

fix(mcp): Move leaves only the agents its confirm named; an unchanged Copy refreshes nothing - #49290

Merged
AmoabaKelvin merged 6 commits into
mainfrom
fix/mcp-move-confirmed-agents-and-noop-copy
Nov 25, 2026
Merged

AmoabaKelvin merged 6 commits into
mainfrom
fix/mcp-move-confirmed-agents-and-noop-copy

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Three fixes to "Move to Orca" and "Copy to Orca" for MCP servers:

  • Move removes only what the confirm named. Move could take a server out of an agent the confirm never mentioned, if that agent started getting Orca's list between the confirm and the click. Now Move removes only from the agents the confirm showed.
  • An unchanged Copy is quiet. Copying a server Orca already has used to make every open settings page and the agent-file sync redo their work. Now it does nothing.
  • Fewer file reads. Listing servers that live only in terminal agents' configs no longer reads the Grok/Cursor/Droid consent.
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​18 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​18
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​69 $\color{#cf222e}{\Huge{\mathbf{−}}}$​26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43

What Changed

  • mcpServers.move takes an optional agents: the agents the confirm named. Desktop and the phone send the row's removesFrom. moveAgentMcpServer takes the server out only of copies whose agent was confirmed and is still reached after the add. With nothing to take out, it doesn't re-read reach at all. Older clients omit agents and keep the host-computed set, and older hosts ignore the key.
  • mcpServers.copy announces mcpServersChanged (and reconciles shared processes) only when the host list was written, through the existing onHost(..., 'written'). Move keeps its announcement on every finished Move, so clients never keep a row Move removed.
  • hostListReaches reads the Grok/Cursor/Droid consent only when one of those agents is among the agents asked. Discovery and Move pass the agents in play.

Why

All three come from the same Move/Copy path.

  • Move: the confirm and the host each computed "which agents" at different moments. Binding the removal to what the user saw, then narrowing it by current reach, means the user is never surprised and an agent that lost reach still keeps its copy.
  • Copy: an unchanged Copy wrote nothing, but it announced a change anyway. The 'written' mode already existed for exactly this.
  • Consent read: the predicate eagerly read the consent file for agents that never consult it.

Linked Issue

STA-18427, STA-18428, STA-18429

Visual Proof

N/A: no visible change. The confirm text and rows are the same; only what the host removes and announces changed.

Testing

  • agent-mcp-config-removal.test.ts "takes a server out of only the agents its confirm named": Claude and Codex are both reached, and the confirm named Codex. ~/.claude.json stays byte-identical. It fails on main, where Claude's copy is removed.

  • Counts through the real RPC handlers with a temporary harness (not committed), at N=5 and 10N=50 Codex-only servers:

    Operation main (N / 10N) this PR (N / 10N)
    Notifications for N unchanged Copies 5 / 50 0 / 0
    Consent reads per terminal-only discovery 1 / 1 0 / 0
    Consent reads for N terminal-only Moves 10 / 100 0 / 0

    An independent pass at N=100 and 10N=1,000 matched these.

  • pnpm check:changed passes.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

This removes work and adds none. An unchanged Copy goes from 1 host-wide announcement (each connected client re-reads list and discovery, and the agent-file sync runs a pass) to 0. Terminal-only discovery goes from 1 consent read to 0, and terminal-only Move from 2 to 0. The counts are above.

Risk

The riskiest part is the new optional agents on mcpServers.move.

  • Mixed versions: a client that sends it to an older host has it stripped, and gets that host's old behaviour. An older client omits it and gets this host's reach-based set, as before.
  • Revert: a plain revert.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Runs on the execution host, so local, SSH and paired servers behave the same.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…imports

The confirm named one set of agents while the host removed from the set it
computed at Move time, so an agent whose reach came back meanwhile lost its
copy unasked. Clients now send the agents the confirm named and the host takes
the server out of only those it still reaches. Move and Copy announce a change
only when the host list was written, so an unchanged Copy refreshes nothing,
and Grok/Cursor/Droid consent is read only when one of them has a copy.
With Move and Copy announcing on a host-list write, the importer's own
announcement on a failure after the add came on top of it.
This reverts commit 61e78de716478a05ee55a12e565c6b9f53ee284d.
Announcing only on a host-list write could drop the announcement for a Move
whose removals finished after another change was announced, leaving clients
with the removed row. Move keeps its own announcement; only an unchanged Copy
stays quiet.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Move requests now pass discovered source agent IDs through the runtime to the importer. The importer limits removal candidates and reachability checks to the applicable agents. The move parameter schema allows an optional list of up to 64 agent IDs. Copy notifications now depend on whether a list write occurred and was already announced.

Merge Risk: Minimal · up to f78ac · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Move now removes a server only from the agents its confirm named, and an unchanged Copy no longer triggers refreshes. Both points match the changeset (move/copy handli…
Description check Passed The description follows the template closely. It has ELI5, What Changed, Why, Linked Issue (STA-18427/18428/18429, not a GitHub issue link), Visual Proof marked N/A with a reason, Testing with a speci…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Move now removes a server only from the agents its confirm named, and an unchanged Copy no longer triggers refreshes. Both points match the changeset (move/copy handling, removesFrom scoping, copy announcement gated on a list write). The title is slightly long and packs two changes into one line, but it is specific and related to the code.

Full details: Description check

Explanation

The description follows the template closely. It has ELI5, What Changed, Why, Linked Issue (STA-18427/18428/18429, not a GitHub issue link), Visual Proof marked N/A with a reason, Testing with a specific test and measured counts, Performance with a concrete statement, Risk with level and revert path, and the Checklist. Gaps: the 'Fixes #' issue line is not filled in with a GitHub issue reference, the AI Disclosure section is empty, and the final pnpm lint/typecheck/test/build checkbox is unchecked. The author also did not state manual testing. These gaps are non-critical, so the check passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7f657e7-6ce8-4d64-a434-c84545d06410
Commits

Reviewing files that changed from the base of the PR and between 4acfded and f78acc9.

Files selected for processing: 1

  • src/main/mcp-servers/agent-configs/agent-mcp-import.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a82d4981-bfff-470f-a877-6f0038946bc1
Commits

Reviewing files that changed from the base of the PR and between 282fae0 and 7e7ab29.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 8

  • mobile/src/mcp-servers/use-mcp-server-actions.ts
  • src/main/mcp-servers/agent-configs/agent-mcp-config-removal.test.ts
  • src/main/mcp-servers/agent-configs/agent-mcp-import.ts
  • src/main/runtime/rpc/methods/mcp-servers-import.ts
  • src/main/runtime/rpc/methods/mcp-servers.ts
  • src/renderer/src/components/settings/mcp-servers/McpServersPane.tsx
  • src/renderer/src/runtime/mcp-servers/mcp-servers-client.ts
  • src/shared/rpc-contract/mcp-servers-params.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

A Move whose confirm left out Cursor, Grok or Droid still read their consent,
only to drop the answer.
@AmoabaKelvin
AmoabaKelvin merged commit 81fdbb3 into main Nov 25, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant