fix(browser): time out remote tab enumeration - #80147
Merged
steipete merged 5 commits intoJul 5, 2026
Merged
Conversation
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (7 earlier review cycles)
|
HemantSudarshan
force-pushed
the
hemant/issue-triage-20260509
branch
from
May 18, 2026 05:15
9aba9b4 to
b7833e6
Compare
HemantSudarshan
force-pushed
the
hemant/issue-triage-20260509
branch
from
May 18, 2026 05:34
b7833e6 to
abf9c79
Compare
Contributor
Author
|
Updated this branch to current What changed after the ClawSweeper review:
Validation run at the new head:
|
|
This pull request has been automatically marked as stale due to inactivity. |
steipete
force-pushed
the
hemant/issue-triage-20260509
branch
from
July 5, 2026 22:17
e71c197 to
717a6e5
Compare
steipete
force-pushed
the
hemant/issue-triage-20260509
branch
from
July 5, 2026 23:12
717a6e5 to
bc9e74c
Compare
steipete
force-pushed
the
hemant/issue-triage-20260509
branch
from
July 5, 2026 23:29
bc9e74c to
fe7139e
Compare
Contributor
|
Merged via squash.
|
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
Problem
Remote CDP profiles use a persistent Playwright connection for tab listing because HTTP
/json/listis ephemeral for those providers. When that Playwright-backed enumeration stalls, browser requests can hang behind the stuck CDP operation instead of failing fast.Root Cause
createProfileTabOps().readTabs()passed onlycdpUrland SSRF policy tolistPagesViaPlaywright(). The lower-level Playwright enumeration path had no operation-level timeout aroundconnectBrowser(),getAllPages(), or per-page target/title/url reads, and a stuck scoped connection could remain cached or in-flight.Architectural Reasoning
The fix reuses the existing browser remote CDP timeout contract rather than adding a new config key. Remote tab listing now uses
max(remoteCdpTimeoutMs, remoteCdpHandshakeTimeoutMs), which matches the existing distinction between HTTP discovery and WebSocket handshake budgets. Timeout cleanup goes through the existing scoped Playwright disconnect helper, preserving per-CDP URL isolation and avoiding hidden coupling to other browser profiles.Real behavior proof
v22.15.0,pnpm 10.33.2, branchhemant/issue-triage-20260509, commit9aba9b405ae5c4601211fd0b2b428d9640425b8b.listPagesViaPlaywright()throughnode --import tsxwithtimeoutMs: 100and an SSRF policy allowing loopback/private access; closed the scoped Playwright connection and destroyed the held socket after the call.Playwright page enumeration timed out after 100msand the script exited cleanly instead of hanging on the held CDP request.pnpm test extensions/browserstill has unrelated Windows environment failures noted below.Testing
pnpm test extensions/browser/src/browser/pw-session.connections.test.ts extensions/browser/src/browser/server-context.remote-profile-tab-ops.playwright.test.tspnpm exec oxfmt --check --threads=1 extensions/browser/src/browser/pw-session.ts extensions/browser/src/browser/server-context.tab-ops.ts extensions/browser/src/browser/pw-session.connections.test.ts extensions/browser/src/browser/server-context.remote-profile-tab-ops.playwright.test.tspnpm tsgo:extensionsfromO:\subst drive to avoid the repo path-with-spaces launcher bugpnpm tsgo:extensions:testfromO:\pnpm lint:extensionsfromO:\pnpm check:changelog-attributionsgit diff --check upstream/main...HEADpnpm check:changed --stagedexited 0 with no lane outputFull
pnpm test extensions/browserwas also run locally. It failed on unrelated Windows environment assumptions: local browser auto-detection / missing supported browser launch fixtures and existing/tmppath expectations being normalized toC:\tmp. The two touched regression test files pass.Risk Analysis
Risk is medium because this touches async browser/CDP lifecycle behavior. The change is scoped to remote Playwright tab enumeration, does not alter local managed browser JSON tab listing, and does not change navigation, action, or screenshot behavior. On timeout, OpenClaw drops only the scoped Playwright connection for that CDP URL and leaves the actual remote browser tabs intact.
Backward Compatibility
No config, API, or response-shape changes. Existing
browser.remoteCdpTimeoutMsandbrowser.remoteCdpHandshakeTimeoutMsnow also bound remote Playwright tab enumeration.Screenshots / Logs
The real behavior proof above is terminal output from the after-fix smoke; no UI screenshot is applicable.