-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
Closed
Description
Summary
The TUI's gateway connection logic hardcodes ws://127.0.0.1:${localPort} and does not respect the gateway.bind config setting, while the status command correctly uses pickProbeHostForBind() to resolve the actual bind address.
Root Cause
In src/tui/gateway-chat.ts, the resolveGatewayConnection() function at line 241 hardcodes the fallback URL:
const localUrl = `ws://127.0.0.1:${localPort}`;This does not consult the bind mode at all, unlike the status/probe code which correctly uses pickProbeHostForBind().
Steps to Reproduce
- Configure gateway to bind only to Tailscale:
openclaw config set gateway.bind tailnet - Restart gateway (now listening only on Tailscale IP, e.g., 100.97.87.117:18789)
- Try to connect via TUI:
openclaw tui - Connection fails - TUI tries localhost, but gateway isn't listening there
Current Workaround
Change bind back to loopback:
openclaw config set gateway.bind loopbackThis works but breaks remote access from the Tailnet.
Proposed Fix
Make resolveGatewayConnection() resolve the gateway host based on the bind mode from config, just like pickProbeHostForBind() does.
Required changes:
- Import
pickPrimaryTailnetIPv4from../infra/tailnet.js - Import
pickPrimaryLanIPv4from../gateway/net.js - Import
GatewayBindModetype - Resolve host based on
config.bindmode instead of hardcoding127.0.0.1
Impact
- Users cannot use TUI when gateway is bound to tailnet or LAN only
- Inconsistent behavior between status command (works) and TUI (broken)
Environment
- OpenClaw version: latest (as of 2026-02-14)
- Platform: Linux
- Config:
gateway.bind: "tailnet"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels