Skip to content

fix(mcp): close isolated HTTP client context on disconnect#41560

Merged
pavelfeldman merged 2 commits into
microsoft:mainfrom
pavelfeldman:fix-41539
Jul 1, 2026
Merged

fix(mcp): close isolated HTTP client context on disconnect#41560
pavelfeldman merged 2 commits into
microsoft:mainfrom
pavelfeldman:fix-41539

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • In --isolated mode each HTTP client owns its own browser context, but the disposed callback returned early while other clients were still connected, leaking the disconnected client's context until the last client left.
  • Now the per-client isolated context is closed immediately on disconnect; a genuinely shared context (--shared-browser-context) still stays open for remaining clients, and the browser is closed only when the last client leaves.

Fixes #41539

In --isolated mode each HTTP client gets its own browser context, but the
disposed callback returned early while other clients were connected, leaking
the disconnected client's context until the last client left. Close the
per-client context immediately on disconnect; shared contexts stay open.

Fixes: microsoft#41539
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

7461 passed, 1132 skipped


Merge workflow run.

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.

[MCP]: Isolated HTTP sessions keep their browser context after disconnect

2 participants