Skip to content

mcp: skip startup for removed server definitions - #336946

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
fix/mcp-start-after-removal
Sep 20, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
fix/mcp-start-after-removal

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

MCP discovery can unregister a collection before the workbench's debounced server list removes its entry. Starting that stale entry currently rejects with Collection or definition not found.

Treat a collection or definition that is no longer registered as a cancelled connection resolution: emit a debug log and return the existing no-connection result. The caller already handles that result as a stopped start. This also covers removal while a lazy collection is loading, without catching or suppressing genuine loader, delegate, or enterprise policy errors.

Treat a collection or definition removed during discovery reconciliation as a cancelled start instead of throwing. Log the skipped startup and preserve genuine lazy-load, delegate, and enterprise policy errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 20, 2026 19:36

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The focused lifecycle fix is consistent with caller behavior and has comprehensive regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents stale MCP entries from failing startup after their collection or definition is removed.

Changes:

  • Return a stopped-start result with debug logging for removed entries.
  • Document the expanded undefined result.
  • Add removal-race and error-preservation tests.
File Description
mcpRegistry.ts Gracefully skips removed MCP entries.
mcpRegistryTypes.ts Documents resolution behavior.
mcpRegistry.test.ts Covers removal races and preserved errors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 61803c8 into main Sep 20, 2026
34 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the fix/mcp-start-after-removal branch September 20, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants