openclaw - 💡(How to fix) Fix Browser existing-session mode has overly tight timeouts — multi-step automation is unstable [1 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#68779Fetched 2026-04-19 15:07:39
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Root Cause

  1. Aggressive timeout values (extensions/browser/src/browser/cdp-timeouts.ts):

    • CDP_WS_HANDSHAKE_TIMEOUT_MS = 5000ms — 5s handshake is insufficient for a loaded browser
    • CHROME_MCP_ATTACH_READY_WINDOW_MS = 8000ms — attach window too short
    • CHROME_REACHABILITY_TIMEOUT_MS = 500ms — only 500ms to probe Chrome reachability
  2. No recovery mechanism for existing-session (extensions/browser/src/browser/chrome-mcp.ts):

    • Transport/connection errors directly call sessions.delete(cacheKey), discarding the session
    • No reconnection logic, no session refresh
  3. Extensive operation limitations (extensions/browser/src/browser/routes/existing-session-limits.ts):

    • No timeout overrides for clickTimeout, hoverTimeout, scrollTimeout, etc.
    • No selector targeting support
    • No batch operation support
  4. Insufficient navigation guard retries (extensions/browser/src/browser/routes/agent.act.ts:46-175):

    • EXISTING_SESSION_INTERACTION_NAVIGATION_RECHECK_DELAYS_MS = [0, 250, 500] — only 3 attempts, max 500ms delay
RAW_BUFFERClick to expand / collapse

Problem

When using browser --browser-profile user for browser automation:

  • Operations drop mid-flow with gateway closed (1000)
  • Handshake timeouts are frequent
  • Multi-step flows ("open → click → navigate") fail repeatedly

Root Cause Analysis

  1. Aggressive timeout values (extensions/browser/src/browser/cdp-timeouts.ts):

    • CDP_WS_HANDSHAKE_TIMEOUT_MS = 5000ms — 5s handshake is insufficient for a loaded browser
    • CHROME_MCP_ATTACH_READY_WINDOW_MS = 8000ms — attach window too short
    • CHROME_REACHABILITY_TIMEOUT_MS = 500ms — only 500ms to probe Chrome reachability
  2. No recovery mechanism for existing-session (extensions/browser/src/browser/chrome-mcp.ts):

    • Transport/connection errors directly call sessions.delete(cacheKey), discarding the session
    • No reconnection logic, no session refresh
  3. Extensive operation limitations (extensions/browser/src/browser/routes/existing-session-limits.ts):

    • No timeout overrides for clickTimeout, hoverTimeout, scrollTimeout, etc.
    • No selector targeting support
    • No batch operation support
  4. Insufficient navigation guard retries (extensions/browser/src/browser/routes/agent.act.ts:46-175):

    • EXISTING_SESSION_INTERACTION_NAVIGATION_RECHECK_DELAYS_MS = [0, 250, 500] — only 3 attempts, max 500ms delay

Suggested Fixes

  1. Increase existing-session timeout values (suggestion: handshake → 15s, attach → 20s)
  2. Add session recovery/reconnection for existing-session mode
  3. Add browser connection state diagnostics to openclaw doctor
  4. Allow configuration overrides for existing-session timeouts

Related Files

  • extensions/browser/src/browser/cdp-timeouts.ts
  • extensions/browser/src/browser/chrome-mcp.ts
  • extensions/browser/src/browser/routes/existing-session-limits.ts
  • extensions/browser/src/browser/routes/agent.act.ts
  • extensions/browser/src/browser/profile-capabilities.ts

extent analysis

TL;DR

Increase the handshake timeout value to 15s and attach window to 20s to mitigate frequent handshake timeouts and operation drops.

Guidance

  • Review and adjust the timeout values in cdp-timeouts.ts to ensure they are sufficient for the loaded browser, considering increasing CDP_WS_HANDSHAKE_TIMEOUT_MS to 15s and CHROME_MCP_ATTACH_READY_WINDOW_MS to 20s.
  • Consider implementing a session recovery mechanism in chrome-mcp.ts to handle transport/connection errors and prevent session discarding.
  • Evaluate the need for adding configuration overrides for existing-session timeouts in existing-session-limits.ts to provide more flexibility.
  • Investigate the navigation guard retries in agent.act.ts and consider increasing the number of attempts or adjusting the delay values to improve reliability.

Example

// Example of updated timeout values in cdp-timeouts.ts
export const CDP_WS_HANDSHAKE_TIMEOUT_MS = 15000; // 15s
export const CHROME_MCP_ATTACH_READY_WINDOW_MS = 20000; // 20s

Notes

The suggested fixes focus on addressing the aggressive timeout values and lack of session recovery mechanism. However, the effectiveness of these changes may depend on the specific use case and browser automation workflow. Further testing and evaluation may be necessary to determine the optimal timeout values and recovery strategy.

Recommendation

Apply the workaround by increasing the handshake timeout value to 15s and attach window to 20s, as this is a straightforward change that can help mitigate the frequent handshake timeouts and operation drops.

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…

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 - 💡(How to fix) Fix Browser existing-session mode has overly tight timeouts — multi-step automation is unstable [1 participants]