Fix: Browser Relay Extension Rejects Token After Upgrade
/json/version โ 401 Unauthorized (with raw gateway token header)
Extension badge: (!) โ cannot attach
After upgrading OpenClaw, the Browser Relay Chrome extension shows a red error badge and cannot attach to browser tabs. The root cause is a token format change: the extension now expects to exchange the gateway token for a derived session token via /json/version, not use the raw token directly. Old tokens stored in the extension Options page are rejected.
Next Step
Fix now, then reduce repeat incidents
If this issue keeps coming back, validate your setup in Doctor first, then harden your config.
Jump to Fix
Step 1: Clear the Old Token from the Extension
- Open Chrome and go to
chrome://extensions - Find OpenClaw Browser Relay and click Details
- Click Extension options
- Clear the token field completely and click Save
Step 2: Get the Derived Token from Your Gateway
The new flow exchanges your raw gateway token for a session token via the /json/versionendpoint. Do this exchange manually to get the derived token:
# Replace YOUR_GATEWAY_TOKEN with your gateway.auth.token value curl -s http://localhost:18789/json/version -H "Authorization: Bearer YOUR_GATEWAY_TOKEN" | python3 -m json.tool
The response should include a webSocketDebuggerUrl and asessionToken field. Copy the sessionToken value.
If /json/version returns 401 even with the correct gateway token, check that your gateway.auth.token in openclaw.json matches what you are using in the header. A stale token in the config is the most common cause.
Step 3: Re-Pair the Extension
In newer versions of the Browser Relay extension, the re-pairing flow is automatic:
- Open the extension Options page (from
chrome://extensions) - Enter your gateway URL (default:
http://localhost:18789) and gateway.auth.token - Click Connect โ the extension now handles the token exchange internally
- The badge should turn green
If your extension is older and does not have the Connect flow, paste the derived session token (from Step 2) directly into the token field instead of the raw gateway token.
openclaw gateway restart # Then re-open the extension options and connect
Step 4: Verify the Extension Attaches
# Test CDP endpoint is reachable with your token curl -s http://localhost:18789/json/version -H "Authorization: Bearer YOUR_GATEWAY_TOKEN" # Should return 200 with browser version info โ not 401
Once the extension badge turns green and /json/version returns 200, open a browser tab and confirm the relay can attach. Your agent should now be able to control browser tabs via the relay.
Related browser & auth issues
Fix It Faster With Our Tools
Did this guide solve your problem?