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

Skip to content

fix(cli): advertise 127.0.0.1 for Agent UI to match bind host#1519

Merged
kovtcharov-amd merged 2 commits into
mainfrom
autofix/issue-1471
Jun 8, 2026
Merged

fix(cli): advertise 127.0.0.1 for Agent UI to match bind host#1519
kovtcharov-amd merged 2 commits into
mainfrom
autofix/issue-1471

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

gaia chat --ui binds the Agent UI server to 127.0.0.1, but the console (and the docs) told users to open http://localhost:<port>. On Windows, localhost can resolve to IPv6 ::1 first and fail to connect to the IPv4-only listener — forcing users to manually retype the URL as 127.0.0.1. This aligns every advertised URL with the actual bind address so the UI just opens.

Closes #1471

Changes

  • CLI (src/gaia/cli.py): the three advertised-URL strings (log line + two prints) now use 127.0.0.1 instead of localhost, with a one-line comment naming the advertise-host == bind-host invariant.
  • Docs: the four "open the Agent UI in your browser" instructions (docs/guides/agent-ui.mdx, docs/deployment/ui.mdx) now advertise 127.0.0.1:4200, closing the same ::1 gap a Windows user hits via the docs path. Addresses the review note on this PR. (Backend/API --backend/curl references are intentionally left as localhost — they're programmatic, not browser-open instructions.)

Test plan

  • On Windows, run gaia chat --ui and confirm the printed URL is http://127.0.0.1:<port> and opens directly with no manual retyping.
  • python util/lint.py --all passes (no Python logic changed; string-only edit).

gaia chat --ui binds the server to 127.0.0.1 but told users to open
http://localhost:<port>. On Windows, localhost can resolve to IPv6 ::1
first and fail to connect to the IPv4-only listener, forcing users to
manually retype the URL as 127.0.0.1. Align the advertised URL with the
actual bind address.

Closes #1471
@github-actions github-actions Bot added the cli CLI changes label Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Code Review

Approve. This is a correct, minimal fix: the advertised URL now matches the actual bind host, fixing the Windows IPv6 (::1) connect failure described in #1471.

Summary

gaia chat --ui binds the server to 127.0.0.1 (src/gaia/cli.py:962) but previously told users to open http://localhost:<port>. On Windows, localhost can resolve to IPv6 ::1 first, which fails against the IPv4-only listener — forcing users to retype the URL. This PR changes the three advertised-URL strings (log + two prints) to 127.0.0.1 so the message matches reality. Verified the bind host directly: the change is consistent with the listener, and the added comment follows GAIA's one-line WHY convention (src/gaia/cli.py:942-943).

Issues Found

🟢 Minor — docs still advertise localhost:4200 for the same UI (out of scope, follow-up)
The same IPv6-vs-IPv4 gap exists in user-facing docs that tell people to open the Agent UI, e.g. docs/guides/agent-ui.mdx:108, docs/deployment/ui.mdx:160 and :215. They're outside this CLI-scoped PR, so not blocking — but worth a follow-up issue so Windows users hitting the docs path don't run into the same ::1 failure this PR fixes in the console. No action required here.

Strengths

  • Root-cause fix, not a workaround — aligns the advertised URL with the actual bind rather than papering over it, and the inline comment names the exact invariant (advertise host == bind host) so the two stay in sync.
  • Tightly scoped — three string changes plus a two-line comment, no drive-by edits. No tests needed for a print-string change, correctly omitted.

Verdict

Approve — ready to merge. The one minor note is an optional docs follow-up, not a blocker.

The CLI fix in this PR aligned the console-advertised URL with the
IPv4 bind host. The browser-open instructions in the UI docs had the
same localhost->::1 gap on Windows; align them too.
@github-actions github-actions Bot added the documentation Documentation changes label Jun 4, 2026
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Good catch on the docs — addressed in this PR rather than deferring. The four browser-open instructions (docs/guides/agent-ui.mdx, docs/deployment/ui.mdx) now advertise 127.0.0.1:4200, so the same ::1 failure can't bite a Windows user coming through the docs path. Left the backend/API --backend/curl references as localhost since those are programmatic, not browser-open instructions.

@kovtcharov-amd kovtcharov-amd enabled auto-merge June 4, 2026 23:51
@kovtcharov-amd kovtcharov-amd added this pull request to the merge queue Jun 8, 2026
Merged via the queue into main with commit f7fbd31 Jun 8, 2026
41 checks passed
@kovtcharov-amd kovtcharov-amd deleted the autofix/issue-1471 branch June 8, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI changes documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: build error

3 participants