fix(embed): use family-agnostic localhost probe and port helpers (#3527) - #3529
Open
chethanuk wants to merge 1 commit into
Open
Conversation
nicoloboschi
requested changes
Aug 17, 2026
chethanuk
force-pushed
the
fix/issue-3527-hindsightembed-isuirunning-hardcodes-127001-so-ui
branch
from
August 17, 2026 12:11
916aef1 to
37535c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
hindsight-embed ui startandui statusreport failure when the control plane binds IPv6 ([::1]) under--hostname localhostor in dual-stack environments. The UI health probe previously hardcoded IPv4127.0.0.1, which is refused when Next.js binds IPv6-only::1.Root Cause
daemon_embed_manager.py:is_ui_runninghardcoded127.0.0.1for/api/health._is_port_in_useused anAF_INET-only socket, treating live IPv6 listeners as free ports._find_pid_on_portfiltered Windowsnetstatoutput for127.0.0.1:{port}substring.Fix
get_ui_url: Default host fallback tolocalhostinstead of0.0.0.0.is_ui_running: Remove hardcoded127.0.0.1override; probelocalhostsohttpxresolves both IPv4 and IPv6 families viagetaddrinfo._is_port_in_use: Use stdlibsocket.create_connection(("localhost", port), timeout=1)for dual-stack support._find_pid_on_port: Replace substring check with bounds-checked netstat column parsing.http://localhost:{port}.Testing
Added
hindsight-embed/tests/test_ui_health_probe.pycovering:::1) health probe response (failing before fix, passing now)127.0.0.1) health probe response[::1]:portand127.0.0.1:portAll 169 unit & integration tests pass cleanly:
Fixes #3527