Skip to content

fix(mcp): stop conflict resolution looping between Agents - #919

Merged
runkids merged 1 commit into
mainfrom
runkids/mcp-conflict-loop
Nov 16, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/mcp-conflict-loop

Conversation

@runkids

@runkids runkids commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

None. Reported directly by the maintainer.

Problem

Claude and Codex held codegraph as codegraph serve --mcp, and Antigravity held an absolute path. The MCP dashboard could not settle this:

  • Import from Claude saved the source and then failed with source saved; unresolved conflicts prevented adoption. The save path refused adoption when any entry in the plan conflicted (internal/mcp/mutate.go), including another Agent's. Antigravity matched the old source, so it now conflicted. Import from Antigravity flipped everything back.
  • Replace with source sent one resolution. With two conflicts, the preview stayed blocked and its apply button stayed disabled.

Change

  • Plan.ResolutionConflicts checks only the entries the resolutions name. Both the save-only API path (MutateBatch) and the interactive CLI import (reviewMCPMutations) use it. Another Agent's conflict no longer stops the import. It stays a conflict of its own.
  • The dashboard's Replace with source sends a replace resolution for every resolvable conflict of that server. The preview lists every file it overwrites before apply, and backups are kept as before.
  • After a conflict import, if Agents in the same scope (global, or the same mcp.projects root) still conflict on that server, a warning toast names them and says to choose Replace with source. source saved; unresolved conflicts prevented adoption is now translated when it still occurs, which happens when the imported Agent's own entry differs.
  • New strings in all 11 locales. Docs updated in English, ja, ko, zh-Hans and zh-Hant: how-to/daily-tasks/sharing-mcp.md and reference/commands/mcp.md.

Not covered

  • Replace is still blocked when a different server also has a conflict. Sync is all-or-nothing by design, so settle that server first.
  • Replace now includes conflicts of the kind "Agent configuration changed since sync" for that server. The preview shows them before apply.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Checks run

In a devcontainer-image container:

  • make check
  • go test ./internal/mcp ./cmd/skillshare ./internal/server
  • vitest for src/pages/MCPPage.test.tsx and src/components/mcp/
  • tsc -b
  • python3 scripts/ai-context.py check

The three new regression tests fail on main and pass here:

  • TestImportAdoptsDespiteAnotherAgentsConflict
  • TestMCPImportSavesDespiteAnotherAgentsConflict
  • "replaces every conflicting entry of the server at once"

Not run: the website build, and a manual dashboard screenshot.

When Agents hold different definitions of one server, importing one
Agent's version was refused with "unresolved conflicts prevented
adoption", because any conflict in the plan blocked it, including
another Agent's. The source was saved anyway, so the Agents that had
matched the old definition now conflicted, and importing from them
flipped the source back. Replace with source sent one resolution at a
time, so with two conflicts the plan stayed blocked and the dialog
could never apply.

Gate adoption only on the resolved entries' own conflicts, in the API
save and in the interactive CLI import. Replace with source now settles
every conflict of that server at once. After a conflict import, a
translated hint names the Agents in the same scope that still need
Replace with source, and the remaining adoption error is translated.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T07:44:15.160752Z 9a4ca4e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 5a6873e into main Nov 16, 2026
9 checks passed
@runkids
runkids deleted the runkids/mcp-conflict-loop branch November 16, 2026 07:48
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