Bug Description
The Control UI (webchat) successfully authenticates with the gateway token for the default (main) agent, but when switching to a different agent session (e.g. navi-coder), the WebSocket reconnects without sending the stored token, resulting in:
unauthorized: gateway token missing (open the dashboard URL and paste the token in Control UI settings)
Steps to Reproduce
- Configure gateway auth with
mode: "token" (default after openclaw gateway install --force)
- Open the dashboard via
openclaw dashboard — main agent connects fine
- Navigate to a second agent session, e.g.:
http://127.0.0.1:18789/chat?session=agent%3Anavi-coder%3Amain
- Control UI shows "unauthorized: gateway token missing"
Even appending #token=<token> to the navi-coder URL doesn't persist — the UI drops it on the WebSocket reconnect.
Gateway Error Logs
[ws] unauthorized conn=... remote=127.0.0.1 client=openclaw-control-ui webchat v2026.3.8 reason=token_missing
[ws] closed before connect conn=... code=1008 reason=unauthorized: gateway token missing
These repeat on every attempt to switch to a non-default agent session.
Expected Behavior
The Control UI should include the stored gateway token on all WebSocket connections, including when switching between agent sessions.
Workaround
Set gateway.auth.mode to "none" in ~/.openclaw/openclaw.json (safe when gateway bind is loopback):
"gateway": {
"auth": {
"mode": "none"
}
}
Then restart the gateway (launchctl unload/load the plist or openclaw gateway install --force).
Environment
- OpenClaw: 2026.3.8 (3caab92)
- OS: macOS (Darwin 25.3.0)
- Browser: Chrome 145
- Gateway bind: loopback
- Agents: main (default) + navi-coder (secondary)
Bug Description
The Control UI (webchat) successfully authenticates with the gateway token for the default (main) agent, but when switching to a different agent session (e.g.
navi-coder), the WebSocket reconnects without sending the stored token, resulting in:Steps to Reproduce
mode: "token"(default afteropenclaw gateway install --force)openclaw dashboard— main agent connects fineEven appending
#token=<token>to the navi-coder URL doesn't persist — the UI drops it on the WebSocket reconnect.Gateway Error Logs
These repeat on every attempt to switch to a non-default agent session.
Expected Behavior
The Control UI should include the stored gateway token on all WebSocket connections, including when switching between agent sessions.
Workaround
Set
gateway.auth.modeto"none"in~/.openclaw/openclaw.json(safe when gateway bind isloopback):Then restart the gateway (
launchctl unload/loadthe plist oropenclaw gateway install --force).Environment