openclaw - ✅(Solved) Fix [Bug]: Browser profile "user" connection cached as failed after first timeout, requires gateway restart [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69624Fetched 2026-04-22 07:50:02
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
closed ×1commented ×1cross-referenced ×1labeled ×1

When using an external Chrome instance via cdpPort with driver: "existing-session", a single operation timeout (such as navigation or script evaluation) causes the Gateway to enter a permanent error state for that specific profile. Subsequent requests to the same profile fail immediately with a timeout error, even if the Chrome instance is still responsive. This state is only cleared by restarting the Gateway.

Error Message

When using an external Chrome instance via cdpPort with driver: "existing-session", a single operation timeout (such as navigation or script evaluation) causes the Gateway to enter a permanent error state for that specific profile. Subsequent requests to the same profile fail immediately with a timeout error, even if the Chrome instance is still responsive. This state is only cleared by restarting the Gateway. Status: Timeout Error. Status: Immediate Timeout Error. All following requests are rejected with a timeout error without any actual attempt to communicate with the Chrome instance.

Root Cause

When using an external Chrome instance via cdpPort with driver: "existing-session", a single operation timeout (such as navigation or script evaluation) causes the Gateway to enter a permanent error state for that specific profile. Subsequent requests to the same profile fail immediately with a timeout error, even if the Chrome instance is still responsive. This state is only cleared by restarting the Gateway.

Fix Action

Fixed

PR fix notes

PR #69733: fix(browser): reset Chrome MCP session after navigate_page timeout

Description (problem / solution / changelog)

Summary

Fixes #69624 — browser profile existing-session gets permanently stuck after the first navigation timeout, requiring a gateway restart.

Root Cause

navigateChromeMcpPage() only forwarded a timeout to the Chrome MCP navigate_page tool when the caller explicitly provided timeoutMs. The route in agent.snapshot.ts never provides one, so Chrome MCP's subprocess could block indefinitely on a slow navigation. Because the stuck session was cached and returned to all subsequent callers, the entire profile became unresponsive until the gateway restarted.

callTool() also lacked a safety-net: even if Chrome MCP honoured its own timeout internally, there was no outer guard to tear down and evict the session. The existing catch block also had a pre-existing race where it deleted the session cache entry without a transport-identity check, so a concurrently-created replacement session could be clobbered.

Changes

extensions/browser/src/browser/chrome-mcp.ts

  • callTool() gains an optional timeoutMs parameter. When set, Promise.race competes the raw MCP call against a setTimeout-based rejection; on timeout the session is torn down (transport-identity-checked) and the error surfaces to the caller so the next request reconnects with a fresh subprocess.
  • navigateChromeMcpPage() now defaults timeoutMs to CHROME_MCP_NAVIGATE_TIMEOUT_MS (20 s) and always forwards it to Chrome MCP, plus passes CHROME_MCP_NAVIGATE_CALL_SAFETY_TIMEOUT_MS (25 s) as the outer safety-net to callTool().
  • The catch block in callTool() gains the same transport-identity guard used elsewhere in the file, fixing the pre-existing replacement-session race.

extensions/browser/src/browser/chrome-mcp.test.ts

  • Two new tests: one asserting the default timeout is always forwarded; one using vi.useFakeTimers() to advance past the 25 s safety-net and confirm the session is reset and the next call reconnects.

extensions/browser/src/browser/chrome.internal.test.ts

  • Pre-existing test failures on Linux: existsSync mocks matched only the macOS Chrome app path ("Google Chrome"). Extended all affected mocks to also match Linux paths (google-chrome, /usr/bin/chromium). No logic changes to the tests themselves.

Why This Is Safe

  • No change to any public export signatures — timeoutMs was already an optional parameter on navigateChromeMcpPage().
  • The 25 s safety-net gives Chrome MCP the full 20 s to honour its own timeout plus a 5 s buffer; the two timeouts do not conflict.
  • openChromeMcpTab() already passed an explicit timeoutMs — its behaviour is unchanged.
  • agent.snapshot.ts passes no timeoutMs; the new default covers it with no edit to that file.

Testing

All 94 browser extension test files pass (809 tests), including two new cases:

  • "always passes a default timeout to navigate_page when none is specified"
  • "resets the Chrome MCP session when a navigate_page call hangs past the safety-net timeout"

Fixes #69624

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/browser/src/browser/chrome-mcp.test.ts (modified, +66/-1)
  • extensions/browser/src/browser/chrome-mcp.ts (modified, +56/-13)
  • extensions/browser/src/browser/chrome.internal.test.ts (modified, +50/-10)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When using an external Chrome instance via cdpPort with driver: "existing-session", a single operation timeout (such as navigation or script evaluation) causes the Gateway to enter a permanent error state for that specific profile. Subsequent requests to the same profile fail immediately with a timeout error, even if the Chrome instance is still responsive. This state is only cleared by restarting the Gateway.

Steps to reproduce

Steps to Reproduce 1. Configure config.yaml Set up a user profile to connect to an external debugging port: browser.profiles.user.cdpPort: 9222 browser.profiles.user.driver: "existing-session" browser.profiles.user.attachOnly: true

2. Launch Chrome Start the browser with the debugging port enabled: chrome.exe --remote-debugging-port=9222

3. Initial Call Invoke any browser tool using profile: "user" to open a webpage. Status: Success.

4. Trigger Timeout Perform an operation that exceeds the timeout limit (e.g., navigating to a slow site or running a heavy evaluate script). Status: Timeout Error.

5. Subsequent Calls Attempt any further browser operations (navigation, snapshot, etc.) using the same profile: "user". Status: Immediate Timeout Error.

6. Verify Connection Run curl localhost:9222/json/version. Status: The Chrome CDP port is still active and responding normally.

Expected behavior

The Gateway should handle the timeout gracefully without locking the profile state. On subsequent requests, it should attempt to re-establish the connection or re-initialize the CDP session. A single request failure should not lead to a persistent "unusable" state for the profile.

Actual behavior

The Gateway appears to cache or "lock" the timeout state for the existing-session profile. All following requests are rejected with a timeout error without any actual attempt to communicate with the Chrome instance. The issue persists until the command openclaw gateway restart is executed.

OpenClaw version

Latest (as of April 2026)

Operating system

Windows 11

Install method

No response

Model

GLM5, KIMI 2.5

Provider / routing chain

LLM(GLM5) → OpenClaw Gateway → Browser Provider → existing-session Profile (CDP:9222)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The Gateway can be fixed by modifying its handling of timeout errors for existing-session profiles, possibly by re-establishing the CDP session after a timeout.

Guidance

  • Investigate the Gateway's error handling mechanism for existing-session profiles to identify why it enters a permanent error state after a single timeout.
  • Consider implementing a retry mechanism or a session re-initialization process after a timeout to prevent the profile from becoming unusable.
  • Review the config.yaml settings, specifically the browser.profiles.user section, to ensure that the configuration is correct and not contributing to the issue.
  • Test the Gateway with different timeout settings or operation types to determine if the issue is specific to certain conditions.

Example

No specific code example can be provided without more information about the Gateway's internal implementation. However, a potential solution might involve modifying the Gateway's error handling code to include a retry or session reset mechanism.

Notes

The issue seems to be specific to the existing-session profile type and the Gateway's handling of timeouts. Without more information about the Gateway's internal implementation or configuration, it's difficult to provide a more specific solution.

Recommendation

Apply a workaround by modifying the Gateway's error handling mechanism to retry or re-initialize the CDP session after a timeout, as this is likely to resolve the issue without requiring a full upgrade or significant changes to the existing setup.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The Gateway should handle the timeout gracefully without locking the profile state. On subsequent requests, it should attempt to re-establish the connection or re-initialize the CDP session. A single request failure should not lead to a persistent "unusable" state for the profile.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Browser profile "user" connection cached as failed after first timeout, requires gateway restart [1 pull requests, 1 comments, 2 participants]