Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Browser Relay loses connection after tab switch - 'tab not found' on all actions #1160

@sgeier

Description

@sgeier

Bug Description

Browser relay loses connection to all tabs after switching the attached tab. Tabs are listed in the CDP endpoint but all actions (snapshot, navigate, click, etc.) return "tab not found".

Steps to Reproduce

  1. Start browser relay with Chrome extension profile
  2. Attach Tab A (e.g., midjourney.com) via extension icon → Badge shows "ON"
  3. Perform actions on Tab A → Works correctly (snapshot, click, navigate, clipboard read)
  4. Switch to Tab B (e.g., discord.com) in Chrome
  5. Click extension icon on Tab B to attach it → Badge shows "ON"
  6. Try to perform actions on Tab B → Fails with 'tab not found'
  7. Try Tab A again → Also fails now

Expected Behavior

After attaching Tab B, actions should work on Tab B.

Actual Behavior

{
  "status": "error",
  "tool": "browser",
  "error": "404: {\"error\":\"Error: tab not found\"}"
}

Meanwhile:

  • browser status shows cdpReady: true, cdpHttp: true
  • browser tabs lists all tabs with valid targetIds
  • curl http://127.0.0.1:18792/json/list returns all tabs correctly
  • But NO tab is controllable (including the original Tab A)

Debug Info

# Status shows everything green
curl http://127.0.0.1:18791/
# {"enabled":true,"cdpReady":true,"cdpHttp":true,...}

# Tabs are listed
curl http://127.0.0.1:18792/json/list
# Returns array with all tabs, valid IDs

# But snapshot fails for ANY tab
curl http://127.0.0.1:18791/snapshot
# {"error":"Error: tab not found"}

Environment

  • Clawdbot: Latest npm install
  • OS: Windows 11 + WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
  • Browser: Chrome (Windows side)
  • Extension: Clawdbot Browser Relay (loaded unpacked)
  • Ports: Control 18791, CDP 18792

Workaround

Complete restart of the browser control server is required. Clicking Cancel/re-attaching does not help.

Notes

  • Single WebSocket endpoint shared by all tabs (ws://127.0.0.1:18792/cdp)
  • Issue may be related to chrome.debugger detach/reattach handling in the extension
  • Once broken, even NEW tabs that are attached also fail

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions