openclaw - ✅(Solved) Fix existing-session browser attach hangs while Chrome remote debugging and gateway remain healthy [1 pull requests, 2 comments, 3 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#49295Fetched 2026-04-08 00:56:49
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Timeline (top)
commented ×2cross-referenced ×2

existing-session browser attach hangs on this machine even though Chrome remote debugging stays live and the OpenClaw gateway stays reachable. In the same environment, a local Playwright worker works normally, which isolates the failure to the OpenClaw existing-session path rather than general browser automation.

Root Cause

existing-session browser attach hangs on this machine even though Chrome remote debugging stays live and the OpenClaw gateway stays reachable. In the same environment, a local Playwright worker works normally, which isolates the failure to the OpenClaw existing-session path rather than general browser automation.

Fix Action

Fixed

PR fix notes

PR #49773: browser: harden existing-session manage timeouts

Description (problem / solution / changelog)

AI Assistance

  • AI-assisted: yes (OpenClaw + Codex ACP)
  • Testing degree: focused browser/timeout coverage plus targeted lint/format validation
  • Codex ACP was used for the follow-up self-review + fix pass that produced commit 1cb8f34d07

Summary

  • honor top-level timeoutMs for host browser tool manage actions (status, profiles, tabs, open, focus, close, start, stop) without changing the shared browser client fast-fail defaults
  • scope the longer 45s manage timeout to host existing-session / profile=user tool calls instead of making it the global browser client default
  • fix both close fallback paths to propagate the resolved timeout (proxy POST /act and direct host /act)
  • avoid redundant Chrome MCP reachability work on existing-session status/tab listing routes while keeping error mapping user-friendly
  • expand timeout/error-path test coverage for host and proxy manage actions

Why

The original patch fixed a real issue (profile=user timing out even when openclaw browser --browser-profile user tabs succeeded), but reviewers correctly pointed out that raising browserStatus / browserProfiles / browserTabs defaults globally to 45s would make unrelated sandbox/remote failures hang much longer.

This revision keeps the intended behavior for slow host existing-session attach flows, while restoring the shared browser client layer to fast-fail defaults for other callers.

Validation

  • pnpm test -- src/agents/tools/browser-tool.test.ts src/browser/client.test.ts src/browser/routes/basic.existing-session.test.ts src/browser/routes/tabs.existing-session.test.ts src/browser/server-context.existing-session.test.ts
  • pnpm exec oxfmt --write src/browser/client.test.ts src/browser/client.ts src/browser/routes/tabs.existing-session.test.ts
  • pnpm exec oxlint src/agents/tools/browser-tool.ts src/agents/tools/browser-tool.test.ts src/browser/client.ts src/browser/client.test.ts src/browser/client-actions-core.ts src/browser/routes/tabs.ts src/browser/routes/tabs.existing-session.test.ts

Refs #45889 Refs #49295

Changed files

  • src/agents/tools/browser-tool.actions.ts (modified, +4/-2)
  • src/agents/tools/browser-tool.test.ts (modified, +234/-1)
  • src/agents/tools/browser-tool.ts (modified, +120/-19)
  • src/browser/client-actions-core.ts (modified, +5/-2)
  • src/browser/client.test.ts (modified, +59/-1)
  • src/browser/client.ts (modified, +51/-16)
  • src/browser/routes/basic.existing-session.test.ts (modified, +9/-4)
  • src/browser/routes/basic.ts (modified, +6/-5)
  • src/browser/routes/tabs.existing-session.test.ts (added, +93/-0)
  • src/browser/routes/tabs.ts (modified, +13/-0)

Code Example

{
  "browser": {
    "attachOnly": false,
    "enabled": true,
    "defaultProfile": "user",
    "profiles": {
      "user": {
        "driver": "existing-session",
        "attachOnly": true,
        "color": "#00AA00"
      }
    }
  }
}

---

9222
/devtools/browser/b2c55e12-eb64-4fd2-bf68-de6331509473

---

Targets
Local loopback ws://127.0.0.1:18789
  Connect: ok (33ms) · RPC: limited - missing scope: operator.read

---

openclaw browser --browser-profile user status
openclaw browser --browser-profile user tabs
RAW_BUFFERClick to expand / collapse

Summary

existing-session browser attach hangs on this machine even though Chrome remote debugging stays live and the OpenClaw gateway stays reachable. In the same environment, a local Playwright worker works normally, which isolates the failure to the OpenClaw existing-session path rather than general browser automation.

OpenClaw version

  • OpenClaw 2026.3.13 (61d171a)

Environment

  • OS: Ubuntu 24.04.4 LTS
  • Kernel: 6.17.0-19-generic
  • Browser: Google Chrome 146.0.7680.80

Exact browser profile config

{
  "browser": {
    "attachOnly": false,
    "enabled": true,
    "defaultProfile": "user",
    "profiles": {
      "user": {
        "driver": "existing-session",
        "attachOnly": true,
        "color": "#00AA00"
      }
    }
  }
}

This is from ~/.openclaw/openclaw.json.

What was verified

Chrome remote debugging stayed live

~/.config/google-chrome/DevToolsActivePort existed and contained:

9222
/devtools/browser/b2c55e12-eb64-4fd2-bf68-de6331509473

Chrome remote debugging UI was enabled and reported:

  • server running at 127.0.0.1:9222

Gateway stayed reachable

openclaw gateway probe consistently reported successful loopback connectivity, e.g.:

Targets
Local loopback ws://127.0.0.1:18789
  Connect: ok (33ms) · RPC: limited - missing scope: operator.read

So this does not appear to be a general gateway outage.

Exact commands that hung

These commands repeatedly hung / timed out instead of returning browser status:

openclaw browser --browser-profile user status
openclaw browser --browser-profile user tabs

I also saw equivalent timeouts via the OpenClaw browser tool when using profile="user".

Additional observations

  • chrome-devtools-mcp was being launched by OpenClaw.
  • Chrome remote debugging remained live while the commands hung.
  • Gateway remained reachable while the commands hung.

Control test: Playwright works on the same machine

I created a simple local Playwright worker and verified it works end-to-end on the same machine.

Successful repeated runs produced screenshots such as:

  • /home/leo/.openclaw/workspace/browser-workers/out/example.png
  • /home/leo/.openclaw/workspace/browser-workers/out/example-2.png

So browser automation in general works here; the failure appears isolated to the OpenClaw existing-session attach path.

Cleanup / reset attempts

I tried the following recovery steps:

  1. verified Chrome remote debugging was enabled
  2. verified DevToolsActivePort existed
  3. verified gateway reachability with openclaw gateway probe
  4. restarted the OpenClaw gateway
  5. cleaned up / attempted cleanup of stale chrome-devtools-mcp helper processes
  6. re-ran a single fresh attach test

Result: cleanup/reset did not recover the existing-session path.

Expected behavior

With Chrome remote debugging enabled and the user existing-session profile configured, I expected at minimum:

  • openclaw browser --browser-profile user status to return promptly
  • openclaw browser --browser-profile user tabs to return the live tabs

Actual behavior

Those commands hang until timeout even though:

  • Chrome remote debugging stays live
  • the OpenClaw gateway stays reachable
  • Playwright works on the same host

Possible area to inspect

This seems likely to be somewhere in the OpenClaw browser existing-session / Chrome DevTools MCP integration path, or a stuck consent/attach state that does not resolve correctly and leaves browser commands hanging.

extent analysis

Fix Plan

To resolve the issue with the OpenClaw existing-session browser attach hanging, follow these steps:

  1. Update OpenClaw Configuration: Ensure that the attachOnly flag is correctly set to true for the user profile in ~/.openclaw/openclaw.json.
    {
      "browser": {
        "attachOnly": false,
        "enabled": true,
        "defaultProfile": "user",
        "profiles": {
          "user": {
            "driver": "existing-session",
            "attachOnly": true,
            "color": "#00AA00"
          }
        }
      }
    }
  2. Verify Chrome Remote Debugging: Confirm that Chrome remote debugging is enabled and the DevToolsActivePort file exists with the correct port number.
  3. Check for Stale Processes: Ensure there are no stale chrome-devtools-mcp processes running. If found, terminate them and restart the OpenClaw gateway.
  4. Reset OpenClaw Gateway: Restart the OpenClaw gateway to ensure it's in a clean state.
  5. Test with Simplified Configuration: Temporarily simplify the openclaw.json configuration to only include the necessary settings for the user profile and test again.

Example Code Snippet for Verification

After applying the above steps, verify the fix by running the following commands and checking for a prompt response:

openclaw browser --browser-profile user status
openclaw browser --browser-profile user tabs

These commands should return promptly without hanging, indicating a successful fix.

Verification

To verify that the fix worked:

  • Run the commands openclaw browser --browser-profile user status and openclaw browser --browser-profile user tabs multiple times to ensure they consistently return without hanging.
  • Use the OpenClaw browser tool with profile="user" to verify that it works as expected.

Extra Tips

  • Regularly check for updates to OpenClaw and Chrome to ensure you have the latest features and bug fixes.
  • Consider implementing a script to periodically restart the OpenClaw gateway and clean up stale processes to prevent similar issues in the future.

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

With Chrome remote debugging enabled and the user existing-session profile configured, I expected at minimum:

  • openclaw browser --browser-profile user status to return promptly
  • openclaw browser --browser-profile user tabs to return the live tabs

Still need to ship something?

×6

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

Back to top recommendations

TRENDING