fix(mcp): do not run heartbeat for clients without the event stream - #42189
Conversation
The streamable HTTP transport silently drops server->client requests until the client opens the GET event stream, which is optional per spec. A POST-only client can never answer the heartbeat ping, so its session was reaped ~5 seconds after the first tool call. Start the heartbeat, at most once per server, only after the event stream is open. The 5s transport readiness cap now applies to the roots listing only. Fixes: microsoft#42188
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
43a9121
into
microsoft:main
Test results for "MCP"2 failed 8087 passed, 1284 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a look at the CI failures here. 🟢 Both failures are pre-existing flakes — this PR is clear
DetailsOverall: no failure traces back to this change. The diff is confined to the MCP HTTP streamable transport — Pre-existing flake / infra
Triaged by the Playwright bot - agent run |
## What's New ### New Tools - **`browser_start_recording` / `browser_stop_recording`** (opt-in via `--caps=devtools`) — Record actions that the user performs manually in the browser and return them as Playwright code. Useful when the user wants to demonstrate a flow instead of describing it ([#42359](microsoft/playwright#42359)) ## Bug Fixes - The default `--codegen` language is inferred from the environment ([#42150](microsoft/playwright#42150)) - Honor `--user-data-dir` in extension mode ([#42190](microsoft/playwright#42190)) - Do not treat orphaned browser preferences entries as an installed extension ([#42224](microsoft/playwright#42224)) - `browser_take_screenshot` returns the original screenshot bytes instead of silently downscaling them to model-specific limits ([#42406](microsoft/playwright#42406)) - Drop the cached browser backend after `browser_close` with a shared browser context, so subsequent tool calls from the same client no longer fail ([#42365](microsoft/playwright#42365)) - When connected to a remote endpoint, `browserInfo` reports the browser actually running remotely instead of the configured one ([#42228](microsoft/playwright#42228)) - Do not clobber the `chromiumSandbox` setting from the config file ([#42288](microsoft/playwright#42288)) - Do not run the heartbeat for HTTP clients that have not opened an event stream ([#42189](microsoft/playwright#42189)) - The internal `/killkillkill` endpoint is no longer registered outside of tests ([#42133](microsoft/playwright#42133))
Summary
Fixes #42188