Skip to content

fix(embed): probe both loopback families in UI health check - #3530

Closed
NovaLux12 wants to merge 1 commit into
vectorize-io:mainfrom
NovaLux12:fix/embed-ui-health-ipv6-loopback
Closed

fix(embed): probe both loopback families in UI health check#3530
NovaLux12 wants to merge 1 commit into
vectorize-io:mainfrom
NovaLux12:fix/embed-ui-health-ipv6-loopback

Conversation

@NovaLux12

Copy link
Copy Markdown
Contributor

Closes #3527

Problem

hindsight-embed ui start / ui status report the Control Plane UI as not
running even when it is up: is_ui_running() health-checks a hardcoded
http://127.0.0.1:<port>/api/health URL, but when the UI binds only the IPv6
loopback (e.g. Next.js started with --hostname localhost, the documented
#1926 workaround) the probe is refused. Every command that depends on the
check — ui start's ready-wait, ui status — reports failure, and ui start
times out after 30s while the UI is actually serving on [::1].

Change

  • DaemonEmbedManager.is_ui_running() now probes both loopback families,
    127.0.0.1 then ::1, returning True on the first healthy response.
  • get_ui_url() brackets IPv6 literals (::1[::1]) so the probe URL —
    and any display of an IPv6 hostname — is a valid URL.

Verification

  • New regression tests in hindsight-embed/tests/test_embed_manager.py:
    • UI bound to [::1] only is detected as running (asserts the exact probe
      URLs, including the bracketed IPv6 form);
    • IPv4-loopback success short-circuits without probing IPv6;
    • both loopback probes refused → False;
    • get_ui_url("::1")http://[::1]:<port>.
  • uv run pytest tests/ in hindsight-embed: 162 passed; the 3 failures
    (test_profile_daemon_config.py) are pre-existing and environmental —
    they fail identically on a clean main checkout because the venv lacks
    sentence_transformers, which flips _find_api_command to the uvx
    fallback. Unrelated to this change.
  • ruff check and ruff format --check pass on both changed files.

is_ui_running() health-checked a hardcoded 127.0.0.1 URL, so a Control Plane
UI bound only to the IPv6 loopback (--hostname localhost, the vectorize-io#1926
workaround) was always reported as down: ui start timed out after 30s and ui
status lied. Probe 127.0.0.1 then ::1, and bracket IPv6 literals in
get_ui_url() so the probe URL is valid.

Closes vectorize-io#3527
@NovaLux12

Copy link
Copy Markdown
Contributor Author

Duplicate of #3529 (opened 4 minutes earlier by @chethanuk) — closing mine to keep the issue to a single PR. Mine took a narrower approach (explicit 127.0.0.1 then [::1] probes with bracketed IPv6 URLs in is_ui_running, +98/-9 over 2 files, 162 embed tests passing); #3529 is broader (family-agnostic localhost probe, netstat parsing, _is_port_in_use). Happy to defer to #3529 or help consolidate if the maintainers prefer either variant.

@NovaLux12 NovaLux12 closed this Aug 16, 2026
@NovaLux12
NovaLux12 deleted the fix/embed-ui-health-ipv6-loopback branch August 16, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hindsight-embed: is_ui_running() hardcodes 127.0.0.1 so ui start/status always fail when the UI binds [::1] (localhost)

1 participant