Skip to content

fix(dev-harness): let OMI_DEV_HOST make the harness actually reachable - #11787

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
formed2forge:fix/dev-harness-lan-bind
Aug 18, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
formed2forge:fix/dev-harness-lan-bind

Conversation

@formed2forge

@formed2forge formed2forge commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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.

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.

Testing

  • New unit tests in test_safety.py (loopback/LAN/CGNAT accepted, public rejected) and test_cli.py (env resolution priority/fallback, public address rejected at load_config, _firebase_command and _start_app_services both actually bind to the resolved host) — 94 passed, 6 skipped (platform-gated).
  • Verified live end to end, not just in unit tests: 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.
  • Along the way, found and worked around two testing artifacts that are not defects in this change: a leftover tailscale serve config from earlier work occupying the same tailnet address/port, and lingering Firebase emulator processes from rapid manual iteration that lsof -sTCP:LISTEN didn't surface but netstat did.

Failure-Class: none

Fixes #11774.

Review in cubic

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.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes OMI_DEV_HOST actually bind the harness services, fail-closed against public addresses via a new dedicated guard; tests + live end-to-end verification. Fixes #11774.

@kodjima33
kodjima33 merged commit bab4808 into BasedHardware:main Aug 18, 2026
30 checks passed
@cursor
cursor Bot deleted the fix/dev-harness-lan-bind branch September 2, 2026 02:34
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.

OMI_DEV_HOST cannot make the dev harness reachable from a physical device — the harness binds 127.0.0.1 unconditionally

2 participants