Skip to content

fix(mcp): Close clients of providers parked for authorization - #2899

Merged
dcramer merged 1 commit into
mainfrom
fix/mcp-forget-provider-close
Nov 7, 2026
Merged

dcramer merged 1 commit into
mainfrom
fix/mcp-forget-provider-close

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

When an MCP tool call needs sign-in, forgetProvider dropped the provider's connected clients from the manager's maps without closing them. close() at turn end could no longer reach them, so their transports stayed open until garbage collection. Forgotten clients now stay in a list that close() closes with the rest. The auth pause path is unchanged, and close errors still surface from close() as before.

#2890 also listed a race where an in-flight connect re-adds a client after it was forgotten. That race is not reachable: getClient runs only from activateProvider, which returns early for active or auth-pending providers, and a connect that fails on auth already closes its own transport.

Part of #2890.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 7, 2026 7:12pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

10 screenshot changes — 10 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automation Run Details Light · Desktop
Automation Run Details Light · Desktop
Changed
Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Details Watched Linked Work · Mobile
Conversation Details Watched Linked Work · Mobile
Changed
Show 4 more changed screenshots
Conversation Event Log Virtual · Desktop
Conversation Event Log Virtual · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed

@dcramer
dcramer merged commit 533eeb9 into main Nov 7, 2026
45 checks passed
@dcramer
dcramer deleted the fix/mcp-forget-provider-close branch November 7, 2026 19:17

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 7530c5df Deployed Nov 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant