Skip to content

Browser extension relay returns stale tab cache after CDP connections die #6175

@miltondwight

Description

@miltondwight

Description

The browser extension relay (profile=chrome) returns stale tab data from /json/list even after the actual CDP connections to those tabs have died.

Steps to Reproduce

  1. Attach the OpenClaw browser extension to multiple Chrome tabs
  2. Verify tabs are accessible via browser tool (snapshot works)
  3. Leave the computer (let Chrome idle/sleep for 10-20 minutes)
  4. Try to use browser tool again

Expected Behavior

Either:

  • /json/list should return empty or error when connections are stale
  • Or the relay should auto-detect dead connections and clean up the cache

Actual Behavior

  • curl http://127.0.0.1:18792/json/list returns 4 tabs ✅
  • curl http://127.0.0.1:18792/json/protocol/<tab_id> returns "not found" ❌
  • browser snapshot fails with "tab not found"

The tab list endpoint gives false confidence that tabs are available.

Debug Info

# Tab list shows tabs
curl -s http://127.0.0.1:18792/json/list | jq length
# Returns: 4

# But individual tabs are not accessible  
curl -s http://127.0.0.1:18792/json/protocol/50F31EEB9A7693F8006EF61D96CE85E6
# Returns: not found

Suggested Fix

  1. Add heartbeat/keepalive ping to detect dead tab connections
  2. Invalidate cache entries when connections fail
  3. Return accurate state from /json/list (only live connections)

Environment

  • OpenClaw: latest (npm)
  • OS: Windows 11 + WSL2 (Ubuntu 24.04)
  • Chrome: Latest stable
  • Extension: OpenClaw Browser Relay

Workaround

Re-click the extension icon on a tab to re-establish fresh CDP connections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions