-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: openclaw tui does not honor the active Gateway runtime port and still targets 18789 #42461
Copy link
Copy link
Closed
BingqingLyu/openclaw
#393Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.regressionBehavior that previously worked and now failsBehavior that previously worked and now fails
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.regressionBehavior that previously worked and now failsBehavior that previously worked and now fails
Type
Fields
Priority
None yet
Bug type
Regression (worked before, now fails)
Summary
When the Gateway is started on a custom port such as 48789, openclaw tui can still try to connect to the default local port 18789. This happens because the TUI
connection path resolves its Gateway URL from config/defaults without first applying the active runtime port override.
The fix is to apply applyGatewayRuntimePortEnvOverride() before resolving the TUI Gateway connection target, so openclaw tui automatically follows the currently r
unning Gateway listener port. A regression test should verify that when the active runtime port is 48789, TUI resolves ws://127.0.0.1:48789.
Steps to reproduce
Steps to reproduce:
openclaw gateway --port 48789
openclaw tui
openclaw gateway status --deep
Expected result:
openclaw tui should automatically connect to ws://127.0.0.1:48789.
Actual result:
openclaw tui targets ws://127.0.0.1:18789 unless --url is passed manually.
Expected behavior
no
Actual behavior
OpenClaw version
2026.3.8
Operating system
docker
Install method
docker
Model
no
Provider / routing chain
no
Config file / key location
No response
Additional provider/model setup details
We fixed the two issues like this:
We added applyGatewayRuntimePortEnvOverride() at the start of resolveGatewayConnection() in src/tui/gateway-chat.ts:269.
This makes TUI apply the active Gateway runtime port before building the local Gateway URL. If the running Gateway is listening on 48789, TUI now resolves
ws://127.0.0.1:48789 instead of falling back to 18789.
We added a regression test in src/tui/gateway-chat.test.ts:151 that covers the case where the active runtime Gateway port is 48789, and verifies that TUI
connects to 48789.
We also updated the docs in:
The docs now explicitly say that openclaw tui follows the active local Gateway runtime port, so custom listener ports such as 48789 are handled automatically.
troubleshooting.md
tui.md
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
We fixed the two issues like this:
We added applyGatewayRuntimePortEnvOverride() at the start of resolveGatewayConnection() in src/tui/gateway-chat.ts:269.
This makes TUI apply the active Gateway runtime port before building the local Gateway URL. If the running Gateway is listening on 48789, TUI now resolves
ws://127.0.0.1:48789 instead of falling back to 18789.
We added a regression test in src/tui/gateway-chat.test.ts:151 that covers the case where the active runtime Gateway port is 48789, and verifies that TUI
connects to 48789.
We also updated the docs in:
The docs now explicitly say that openclaw tui follows the active local Gateway runtime port, so custom listener ports such as 48789 are handled automatically.
troubleshooting.md
tui.md