Skip to content

chore(mcp): own the idle timer in the browser factory - #42678

Merged
Yury Semikhatsky (yury-s) merged 2 commits into
microsoft:mainfrom
yury-s:chore-mcp-idle-timer
Sep 11, 2026
Merged

Yury Semikhatsky (yury-s) merged 2 commits into
microsoft:mainfrom
yury-s:chore-mcp-idle-timer

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

  • Move IdleTimer to its own file and hand it out as part of BrowserWithInfo, 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 from program.ts.
  • BrowserBackend takes the timer instead of callStarted/callFinished callbacks.
  • Drop the relaunch notice. An idle close now behaves exactly like closing a headed browser by hand, which the server already handles by launching a new one on the next tool call. utils/mcp/server.ts is back to its pre-feature state.

Follow-up to #42663

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.
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

8496 passed, 1436 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