fix(browser): thread snapshot timeoutMs through agent tool and helpers#75702
Conversation
|
Codex review: passed. Latest ClawSweeper review: 2026-05-24 02:12 UTC / May 23, 2026, 10:12 PM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
PR Surface View PR surface stats
Summary Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused timeout propagation after exact-head checks, accepting the proxy fail-fast alignment as intentional and keeping #72653 separate. Do we have a high-confidence way to reproduce the issue? Yes, source reproduction is high-confidence: current main accepts top-level browser Is this the best way to solve the issue? Yes, this is the best narrow fix: it reuses the existing timeout contract and existing Chrome MCP/Playwright timeout surfaces instead of adding a new API. The only maintainer choice is whether the newly enforced 20s proxied snapshot default is acceptable. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against d5814150267f. |
|
The earlier Clawsweeper changelog finding has been addressed (commit 6646e1e adds the required |
6646e1e to
f7f59c8
Compare
|
Friendly nudge from a downstream operator hitting this on 2026.5.x: the underlying bug (#72934) is still live, the dist bundle still ships the hardcoded This PR has been open 20 days at P1 / impact:crash-loop with proof:sufficient and zero maintainer review. Anything reviewers need from the author or downstream users to unblock landing? Happy to provide additional repro traces from a Linux + Browserbase setup if useful. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Cosmic Review Wisp Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
@clawsweeper automerge |
|
🦞✅ Source: What merged:
Automerge notes:
The automerge loop is complete. Automerge progress:
|
…aywright helper tests
f7f59c8 to
0eec196
Compare
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
openclaw#75702) Summary: - Threads browser snapshot `timeoutMs` through the agent action, client/proxy request, snapshot route plan, Ch ... Playwright/CDP helpers, regression tests, changelog, and one JSDoc-only shrinkwrap script type annotation. - Reproducibility: yes. source reproduction is high-confidence: current main accepts top-level browser `timeou ... helpers drop it. I did not rerun the original macOS or Browserbase live scenario in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(browser): apply default snapshot timeout to proxy path and add Pl… - PR branch already contained follow-up commit before automerge: docs(changelog): add browser snapshot timeout propagation fix entry - PR branch already contained follow-up commit before automerge: fix(browser): thread snapshot timeoutMs through agent tool and helpers - PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-7570… Validation: - ClawSweeper review passed for head 0eec196. - Required merge gates passed before the squash merge. Prepared head SHA: 0eec196 Review: openclaw#75702 (comment) Co-authored-by: masatohoshino <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
Fixes #72934.
Summary
browser action=snapshotconsistently times out on macOS (issue [Bug]: Browser snapshot action consistently times out despite successful open/navigate #72934).open/navigatesucceed, but every snapshot path times out — making the browser tool effectively unusable from agents.timeoutMsnor any sane default reaches the Chrome MCP / Playwright snapshot helpers.timeoutMsfrom the agent tool input throughbrowserSnapshot(client) →BrowserSnapshotPlan(/snapshotroute plan) →/snapshotroute → Chrome MCPtake_snapshot/take_screenshot(labels) and PlaywrightsnapshotAi/snapshotRole/snapshotAria/screenshotWithLabelshelpers. AddDEFAULT_BROWSER_SNAPSHOT_TIMEOUT_MS = 20_000and replace the previously hardcoded20000literal so the default value is unchanged. The default is now applied uniformly at theexecuteSnapshotActionboundary so it reaches both the direct client call and the proxied path; without this, the proxy path was effectively unbounded.timeoutMsto existing race / API options;extensions/browser/boundary is preserved; docs/tools/browser.md is not touched. (CHANGELOG.md includes the required browser snapshot timeout fix entry, added in a separate follow-up commit per the Clawsweeper guidance.)Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
navigateChromeMcpPagetimeout race — directly mirrored here fortake_snapshot), Bug: browser tool times out despite CDP connection working (Playwright can connect directly) #72653 (Linux/all-action timeout — different root cause, out of scope)Root Cause (if applicable)
extensions/browser/does not propagatetimeoutMsend-to-end. Specifically:executeSnapshotActionnever readsinput.timeoutMs(and never injects the default), so the proxied snapshot request reaches the gateway with notimeoutMsat all;browserSnapshot(client) hardcodestimeoutMs: 20000and has noopts.timeoutMs;BrowserSnapshotPlanhas notimeoutMsfield;takeChromeMcpSnapshotcallscallToolwithout forwarding anyoptions.timeoutMs, so the Promise.race + session reset added in PR fix(browser): reset Chrome MCP session after navigate_page timeout #69733 never engages for snapshot;snapshotRoleViaPlaywright/snapshotAriaViaPlaywrightignore caller timeouts (the role helper hardcodes 5000 ms; the aria helper has no timeout at all onAccessibility.getFullAXTree).timeoutMsfrom the agent tool reaches each snapshot helper;browser-tool.test.tsmockedbrowserSnapshotand never inspected timeout-related arguments.timeoutMsrace tocallTooland used it fornavigate_page, but did not extend the same wiring totake_snapshotor to the Playwright snapshot helpers — leaving the snapshot path silently subject to whatever the underlying Chrome MCP / Playwright operation chooses to do.Regression Test Plan (if applicable)
extensions/browser/src/browser-tool.test.ts,extensions/browser/src/browser/client.test.ts,extensions/browser/src/browser/chrome-mcp.test.ts,extensions/browser/src/browser/routes/agent.snapshot.plan.test.ts,extensions/browser/src/browser/pw-tools-core.snapshot.test.ts.timeoutMssupplied by an agent must reachbrowserSnapshot(and the/snapshotquery string),BrowserSnapshotPlan,takeChromeMcpSnapshot(where it must arm thecallToolrace),snapshotRoleViaPlaywright(must reachpage.ariaSnapshot({ timeout })),snapshotAriaViaPlaywright(must raceAccessibility.getFullAXTree), and the proxied browser snapshot path. TheDEFAULT_BROWSER_SNAPSHOT_TIMEOUT_MS = 20_000default is also locked in for both direct and (implicitly viaexecuteSnapshotAction) proxied paths.timeoutMsis dropped today, without requiring a real Chromium / Playwright session.browser-request.timeout.test.tscoversbrowser.requestlocal dispatches but not snapshot path;agent.snapshot.test.tscoversresolveTargetIdAfterNavigateonly.User-visible / Behavior Changes
Default snapshot timeout is unchanged in value (still 20_000 ms; the hardcoded literal is replaced by
DEFAULT_BROWSER_SNAPSHOT_TIMEOUT_MS = 20_000). What does change is enforcement scope: the same 20_000 ms default that previously only applied to direct host snapshots now applies uniformly to the proxied node-target snapshot path as well — previously the proxy path silently had no per-request timeout for snapshot, leaving it subject to whatever Chrome MCP / Playwright happened to do. Caller-suppliedtimeoutMsis now honored end-to-end across all snapshot paths. No public schema change beyondBrowserSnapshotPlangaining an optionaltimeoutMsfield.Diagram (if applicable)
Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
pnpm test extensions/browser/src/browser-tool.test.ts extensions/browser/src/browser/client.test.ts extensions/browser/src/browser/chrome-mcp.test.ts extensions/browser/src/browser/routes/agent.snapshot.plan.test.ts extensions/browser/src/browser/pw-tools-core.snapshot.test.ts.client.test.ts—browserSnapshotwritestimeoutMsinto the/snapshot?query (explicit value + 20_000 default).agent.snapshot.plan.test.ts—resolveSnapshotPlanparsestimeoutMsand rejects non-positive values.chrome-mcp.test.ts—takeChromeMcpSnapshot({ timeoutMs: 75 })rejects with thetake_snapshotrace error after fake timers advance.browser-tool.test.ts—executeSnapshotActionpassesinput.timeoutMsto both the directbrowserSnapshotcall and the proxiedcallBrowserProxy(params.query.timeoutMs+params.timeoutMs); falls back to the default 20_000 ms when none is supplied.pw-tools-core.snapshot.test.ts—snapshotAriaViaPlaywright({ timeoutMs: 750 })racesAccessibility.getFullAXTreeand rejects on timeout;snapshotRoleViaPlaywright({ refsMode: "aria", timeoutMs: 8888 })forwards the value intopage.ariaSnapshot({ mode: "ai", timeout: 8888 }).Expected
timeoutMsis observable at every snapshot seam, and the default reaches both the direct and proxied paths.Actual
Evidence
timeoutMswas never threaded through any of the asserted seams; e.g., thechrome-mcp.test.tssnapshot race test would never reject becausetakeChromeMcpSnapshotdid not passoptions.timeoutMstocallTool).## Real behavior proofsection below.Real behavior proof
Captured 2026-05-17 against branch
pr/openclaw-browser-snapshot-timeout-propagationhead6646e1edb9(= 3 commits on top ofe6c1a6637a).Behavior or issue addressed: the
browser action=snapshotpath used to ignore agent-suppliedtimeoutMsat every layer below the agent tool, so a slow or hung Chrome MCP / Playwright snapshot could only be cut short by the global request timeout. This PR threadstimeoutMsfrom the agent tool input, throughexecuteSnapshotAction, through thebrowserSnapshotHTTP client, through the/snapshotroute plan resolver, throughtakeChromeMcpSnapshot, and through both Playwright helpers (snapshotAriaViaPlaywrightPromise.race wrapper +snapshotRoleViaPlaywrightPlaywrightariaSnapshot({ timeout })) all the way to the leaf accessibility call. The Codex review asked for evidence that the parameter is honored by a real boundary rather than only by unit tests.Real environment tested: Linux x86_64 local dev workspace (Node 22.22.2, pnpm 10.33.2). A real loopback Node
http.createServerstands in for the OpenClaw browser agent's/snapshotroute with a controlled per-request delay. The actual productionbrowserSnapshotHTTP client from this PR's source (extensions/browser/src/browser/client.ts) is invoked against that real socket, sofetchBrowserJsonexercises its real AbortController and the URL query carries the real serializedtimeoutMs. Live Chromium was attempted but blocked on missinglibasound.so.2in this sandbox (cannot apt-install without sudo); the HTTP-client boundary is the next outermost real seam and is the one the agent tool actually reaches in production.Exact steps or command run after this patch:
browserSnapshotclient fromextensions/browser/src/browser/client.tsand call it with{ format: "ai", timeoutMs: X }against the loopback server.(timeoutMs, server delay): baseline (notimeoutMs, fast server), tighttimeoutMsagainst a slow server (expect abort neartimeoutMs), and loosetimeoutMsagainst a moderate server (expect success).timed out after Xms), and the URL query the server actually received.Concrete commands run on the branch:
Evidence after fix:
Terminal transcript from the HTTP-boundary probe (real Node socket, no mocks):
Focused-test summary on the rebased branch (5 files, 95 cases):
Observed result after fix:
timeoutMstimeoutMs=20000)timeoutMs=9000)timed out after 300mstimed out after 1500mstimeoutMs=4000)What this proves at the public HTTP-client boundary:
timeoutMsreaches the URL query ofGET /snapshot?...&timeoutMs=X, so the downstream/snapshotroute handler (already covered byagent.snapshot.plan.test.ts) has the value it needs to feed totakeChromeMcpSnapshot/snapshotAriaViaPlaywright/snapshotRoleViaPlaywright.timeoutMs, not at the legacy default. Wall-clock elapsed tracks the input within ~10 ms (310ms for 300ms, 1505ms for 1500ms), and the thrown message names the exact value (timed out after 300ms,timed out after 1500ms), so a hung downstream cannot keep the agent waiting longer than the agent asked.timeoutMs=Xin the URL query) and the response payload (the snapshot JSON:targetId,snapshot,stats) cross a real socket round-trip.Combined with the 95 focused unit cases that already cover the downstream layers (
/snapshotplan resolution, Chrome MCPcallToolrace, PlaywrightariaSnapshot({ timeout })forwarding, Promise.race wrapper for the Accessibility CDP call), the whole agent-input → leaf-call chain is now observably timeoutMs-honoring.What was not tested:
ariaSnapshoton a real page — blocked on missinglibasound.so.2in this sandbox (apt-install requires sudo, not available here). The PR's Playwright leaf is covered by the in-tree vitest cases (pw-tools-core.snapshot.test.ts— including theraces against an explicit timeoutMsandforwards an explicit timeoutMs into the role-aria Playwright ariaSnapshot callcases) and the wrapper logic is mechanically the same as the already-mergednavigateChromeMcpPagemodel from PR fix(browser): reset Chrome MCP session after navigate_page timeout #69733.pnpm check:changedtypecheck-all picked up two pre-existing typecheck errors inextensions/matrix/src/matrix/monitor/handler.ts(Property 'dmScope' does not exist,Cannot find name 'liveDmAllowFrom') that are introduced by upstreamextensions/matrix/advances after this PR's basee6c1a6637a(git log e6c1a6637a..upstream/main -- extensions/matrix/lists 3 upstream commits, none touched by this PR). The browser-scoped focused tests above remain green.Human Verification (required)
browser action=snapshotpath:executeSnapshotActionforwardsinput.timeoutMstobrowserSnapshot({ timeoutMs })and the resulting/snapshot?URL carries the value (default 20_000 when absent).callBrowserProxy: the gateway invocation receivesparams.query.timeoutMsANDparams.timeoutMsso both the proxied HTTP request and the Chrome MCP race honor it (assertion locks inouter = inner + 5_000 ms slack).takeChromeMcpSnapshotarms thecallToolrace, matching thenavigateChromeMcpPagemodel from PR fix(browser): reset Chrome MCP session after navigate_page timeout #69733.snapshotRoleViaPlaywrightforwardstimeoutMstopage.ariaSnapshot({ timeout })/locator.ariaSnapshot({ timeout });snapshotAriaViaPlaywrightraces the unboundedAccessibility.getFullAXTreecall.timeoutMsvalues fall through to the existing 20_000 ms default — covered by theagent.snapshot.plan.test.tsregression for0andnot-a-number, and by theclient.test.ts/browser-tool.test.ts"default snapshot timeout" assertions.BrowserSnapshotPlan.timeoutMsfield — additive, so existing plan consumers remain unaffected; verified via the focused snapshot tests (5 files / 95 tests pass).timeoutMsto Playwright's accepted range (500–60_000 ms). This matches the existingsnapshotAiViaPlaywrightmodel (page.ariaSnapshot({ mode: "ai", timeout: Math.max(500, Math.min(60_000, ...))})) and is preserved here as defensive normalization for the same external-API guarantees, not a new policy added in this PR.timeoutMswas dropped before this change.Review Conversations
Compatibility / Migration
YesNoNoBrowserSnapshotPlan.timeoutMsis an optional field, so plan consumers (shouldUsePlaywrightForAriaSnapshotetc.) remain non-breaking. Direct snapshot path keeps the same effective deadline; the proxied path now also honors that deadline rather than being silently unbounded — this is the bug the PR fixes.Risks and Mitigations
page.ariaSnapshot({ timeout })/locator.ariaSnapshot({ timeout })rely on the Playwright Locator API supporting an explicit timeout option.snapshotAiViaPlaywright(page.ariaSnapshot({ mode: "ai", timeout })), so the Playwright surface is known to accept it.timeoutMstotakeChromeMcpSnapshotengages thecallToolrace + session reset, which could surface previously masked transport hangs.navigate_pagein PR fix(browser): reset Chrome MCP session after navigate_page timeout #69733 without follow-up issues.Notes for maintainers
## Unreleased→### Fixesin a separate follow-up commit, per Clawsweeper's required-changelog guidance; please relocate or rephrase at release time if desired.DEFAULT_BROWSER_SNAPSHOT_TIMEOUT_MS = 20_000. Adjusting that default is a separate UX discussion and intentionally not in this PR.Math.max(500, Math.min(60_000, ...))clamp aroundpage.ariaSnapshot({ timeout })(matchingsnapshotAiViaPlaywright). This is a defensive normalization for what Playwright accepts, not a new policy introduced by this PR.