Skip to content

fix(mcp): persistent context is always shared#39601

Merged
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:fix-mcp-persistent-shared-context
Mar 10, 2026
Merged

fix(mcp): persistent context is always shared#39601
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:fix-mcp-persistent-shared-context

Conversation

@pavelfeldman
Copy link
Copy Markdown
Member

@pavelfeldman pavelfeldman commented Mar 10, 2026

Summary

  • Remove the --shared-browser-context CLI flag and sharedBrowserContext config option
  • When using a persistent browser context (userDataDir), automatically share it across HTTP clients
  • Lazily create the shared browser on first client connection and clean up when the last client disconnects

When using a persistent browser context (userDataDir), always share
it across HTTP clients instead of requiring a separate
--shared-browser-context flag. This removes the sharedBrowserContext
config option and makes sharing implicit for persistent sessions.
The shared browser is now lazily created on first client connection
and cleaned up when the last client disconnects.
@pavelfeldman pavelfeldman merged commit 8708b7e into microsoft:main Mar 10, 2026
34 of 36 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chromium] › mcp/http.spec.ts:207 › http transport browser lifecycle (persistent) @mcp-macos-latest

5126 passed, 164 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [webkit-library] › library/proxy.spec.ts:127 › should allow bypassing [::1] requests @webkit-ubuntu-22.04-node20

6 flaky ⚠️ [chromium-library] › library/trace-viewer.spec.ts:1230 › should display language-specific locators `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:1230 › should display language-specific locators `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104 › should work with strict CSP policy `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:118 › should collapse repeated console messages for test `@macos-latest-node20`

38946 passed, 842 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.

2 participants