chore(mcp): own the idle timer in the browser factory - #42678
Merged
Yury Semikhatsky (yury-s) merged 2 commits intoSep 11, 2026
Merged
Conversation
The idle timer moves to its own file and travels with BrowserWithInfo, so the browser that owns it closes itself and every caller gets the timer for free: a shared browser hands the same timer to each client, an unshared one gets its own. BrowserBackend takes the timer instead of call callbacks. Drop the relaunch notice. An idle close now looks exactly like closing a headed browser by hand, which the server already handles by launching a new one on the next tool call.
Contributor
Test results for "MCP"8496 passed, 1436 skipped Merge workflow run. |
Pavel Feldman (pavelfeldman)
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IdleTimerto its own file and hand it out as part ofBrowserWithInfo, so the browser that owns the timer closes itself on idle. A shared browser gives every client the same timer, an unshared one gets its own, which drops the shared-vs-own branching fromprogram.ts.BrowserBackendtakes the timer instead ofcallStarted/callFinishedcallbacks.utils/mcp/server.tsis back to its pre-feature state.Follow-up to #42663