Repository navigation
fix(mcp): bound the page-side settle wait for pages that cannot run timers - #43746
Closed
PyBgX (bgmacris) wants to merge 1 commit into
Closed
PyBgX (bgmacris) wants to merge 1 commit into
PyBgX (bgmacris) wants to merge 1 commit into
Conversation
…imers Tab.waitForTimeout waits with a setTimeout inside the page. When the page cannot run its own timers (CSP `sandbox` without `allow-scripts`, or a page clock paused with page.clock.pauseAt), that wait never resolves and the tool call hangs. Race it against a Node-side bound of `time + 5000` ms.
Author
|
@microsoft-github-policy-service agree |
Collaborator
|
Please file an issue before submitting a PR, according to the CONTRIBUTING.md. |
Author
|
Thanks, and sorry for skipping that step. Filed #43752 with a minimal repro. |
Gabriel (gabriel-diagram)
pushed a commit
to gabriel-diagram/quimera-ai
that referenced
this pull request
Nov 16, 2026
…annot run scripts @playwright/mcp 0.0.83 ends each action with a setTimeout inside the page. A document served with CSP `sandbox` (every raw.githubusercontent.com file) never runs it, so browser_evaluate, browser_click & co. never return (2 of 5 research runs of the tandem-vs-Firecrawl bench hung reading READMEs). Fix proposed upstream: microsoft/playwright#43746. Until it ships, the autostart hook probes the current tab (sync evaluate, then a microtask over the browser endpoint: hidden tabs delay timers, never microtasks) before the 12 tools that go through that wait, and denies them with what to do instead (browser_snapshot, or fetch() from a normal page). Unsure which tab, or the page is busy → allow. ~20 ms per guarded call; TANDEM_SANDBOX_GUARD=0 turns it off. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Tab.waitForTimeoutwaits with asetTimeoutinside the page. When the page cannot run its timers, the wait never resolves and the tool call hangs with no error and no timeout.sandboxwithoutallow-scripts(for example everyraw.githubusercontent.comfile), on Chromium and WebKit; andpage.clock.pauseAt()frombrowser_run_code_unsafe.time + 5000ms (the same bound thatwaitForCompletionuses for requests).