Skip to content

fix(mcp): close isolated contexts on client disposal#41540

Closed
oleksii-tumanov wants to merge 1 commit into
microsoft:mainfrom
oleksii-tumanov:fix/mcp-isolated-context-cleanup
Closed

fix(mcp): close isolated contexts on client disposal#41540
oleksii-tumanov wants to merge 1 commit into
microsoft:mainfrom
oleksii-tumanov:fix/mcp-isolated-context-cleanup

Conversation

@oleksii-tumanov

Copy link
Copy Markdown
Contributor

Summary

Close the browser context owned by an isolated HTTP client when it disconnects.

Regression coverage for two concurrent isolated clients:
after one disconnects, the remaining client sees one live context instead of two.

Fixes #41539

@pavelfeldman

pavelfeldman commented Jul 1, 2026

Copy link
Copy Markdown
Member

Somehow my agent did it with a smaller diff. Identical behavior though: https://github.com/microsoft/playwright/pull/41560/changes

@oleksii-tumanov

Copy link
Copy Markdown
Contributor Author

Thanks @pavelfeldman . The smaller production diff make sense.

I analized both patches. I see that #41560 keeps the last-client browser shutdown path unchanged and reuses lifecycle log assertions additionally for concurrent HTTP and SSE. While old #41540 added a direct contexts().length check for direct validation.

For future contributions, would you have preferred that I revise #41540 in that direction? I would have been happy to update it based on review feedback. Understanding that would help me better match the project’s preferred workflow.

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