Repository navigation
fix(dev-harness): let OMI_DEV_HOST make the harness actually reachable - #11787
Merged
kodjima33 merged 1 commit intoAug 18, 2026
Merged
Conversation
OMI_DEV_HOST only ever changed what the app was compiled to expect (app/setup.sh:53) — the harness bound backend, llm-gateway, desktop-backend, and the Firebase emulators to a hardcoded 127.0.0.1 regardless, so a physical device pointed at the documented LAN address reached nothing (BasedHardware#11774). The harness now resolves a dev_bind_host from OMI_DEV_BIND_HOST (falls back to OMI_DEV_HOST, defaulting to loopback), fails closed via a new validate_dev_bind_host guard unless the requested address is loopback, RFC 1918 (LAN), or 100.64.0.0/10 (Tailscale CGNAT) — never public — and binds 0.0.0.0 rather than the literal address so loopback callers (health checks, a booted simulator) keep working alongside the newly reachable LAN/tailnet address. This is deliberately a new, separate guard: validate_loopback_emulator_host protects a different boundary (the backend's own connection to its co-located emulators, which must always stay loopback) and is untouched. Verified live end to end after finding and working around two testing artifacts (a leftover `tailscale serve` config from earlier work, and lingering emulator processes from rapid manual iteration — neither is a defect in this change): with OMI_DEV_HOST set to this Mac's Tailscale address, `make dev-up` brings up all seven services healthy, and `curl http://<tailscale-ip>:8000/` and `:9099/` both return 200 — mirroring the issue's own repro, which measured a refused connection on the LAN address before this fix. Failure-Class: none Fixes BasedHardware#11774.
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.
Summary
OMI_DEV_HOSTonly ever changed what the app was compiled to expect (app/setup.sh:53) — the harness boundbackend,llm-gateway,desktop-backend, and the Firebase emulators to a hardcoded127.0.0.1regardless, so a physical device pointed at the documented LAN address reached nothing.The harness now resolves a
dev_bind_hostfromOMI_DEV_BIND_HOST(falls back toOMI_DEV_HOST, defaulting to loopback), fails closed via a newvalidate_dev_bind_hostguard unless the requested address is loopback, RFC 1918 (LAN), or100.64.0.0/10(Tailscale CGNAT) — never public — and binds0.0.0.0rather than the literal address so loopback callers (health checks, a booted simulator) keep working alongside the newly reachable LAN/tailnet address.This is deliberately a new, separate guard:
validate_loopback_emulator_hostprotects a different boundary (the backend's own connection to its co-located emulators, which must always stay loopback) and is untouched.Testing
test_safety.py(loopback/LAN/CGNAT accepted, public rejected) andtest_cli.py(env resolution priority/fallback, public address rejected atload_config,_firebase_commandand_start_app_servicesboth actually bind to the resolved host) — 94 passed, 6 skipped (platform-gated).OMI_DEV_HOSTset to this Mac's Tailscale address,make dev-upbrings up all seven services healthy, andcurl http://<tailscale-ip>:8000/and:9099/both return200— mirroring the issue's own repro, which measured a refused connection on the LAN address before this fix.tailscale serveconfig from earlier work occupying the same tailnet address/port, and lingering Firebase emulator processes from rapid manual iteration thatlsof -sTCP:LISTENdidn't surface butnetstatdid.Failure-Class: none
Fixes #11774.