Skip to content

[Bug][Windows] Desktop never starts the runtime when hostname is the machine's own Tailscale IP (ocx resolve 1500 ms probe times out) #8318

Closed

Description

@jayjay181818

Client or integration

Other

Area

Service lifecycle

Summary

On Windows, with hostname set to the PC's own Tailscale IP, OpenCodex Desktop never starts the runtime after a restart. Nothing listens on 10100 and no error is shown. Hub and local Codex are both down.

Expected: the runtime starts, or Desktop says why it didn't.

Reproduction

  1. ocx config set hostname <PC's own Tailscale IP, 100.x.y.z> and enable Hub mode.
  2. Add Tailscale Serve entries pointing at that IP.
  3. Quit and reopen OpenCodex Desktop. Startup hangs, and nothing listens on 10100.

Cause (as measured):

  • ocx resolve, which Desktop uses to find a live runtime, probes with a 1500 ms timeout.
  • On this PC, a refused connection to its own Tailscale IP takes about 2 s to fail, so the probe always times out. Desktop treats that as "not resolved" and never gets as far as starting the runtime.
  • With hostname 0.0.0.0, ocx resolve exits 0 in 0.7 s.

Related: on Windows, Tailscale Serve also can't proxy to the machine's own Tailscale IP (it hangs). Serve has to target 127.0.0.1.

Suggested fix:

  • Probe 127.0.0.1: whenever the bind address is local to the machine.
  • Treat "connection refused" as "not running, start it" instead of a timeout.
  • Make the probe timeout configurable or longer.
  • Have Desktop show why the runtime didn't start.
  • Document not to use your own Tailscale IP as hostname on Windows.

Version

2.98.0

Operating system

Windows 11 Pro 10.0.26300 (Tailscale 1.104.4)

Provider and model

No response

Logs or error output

Desktop shows no error; ocx resolve times out (1500 ms) with hostname = own Tailscale IP, exits 0 in 0.7 s with 0.0.0.0.

Screenshots and supporting files

No response

Redacted configuration

Workaround that worked:
1. ocx config unset unauthenticatedLoopbackListener   (must go first: listener + 0.0.0.0 is rejected)
2. ocx config set hostname 0.0.0.0
3. unauthenticatedLoopbackListener {enabled:true, port:10102}   (key-free local Codex)
4. Tailscale Serve 10443 → http://127.0.0.1:10100

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Nov 7, 2026
  2. added
    cli
    platform
    service
    on Nov 7, 2026
  3. Ingwannu commented on Nov 8, 2026

    @Ingwannu
    Owner

    Thanks for the measurements. I checked the resolve path on origin/dev f8dfc2f.

    What the code does: ocx resolve probes with a 1500 ms per-attempt ceiling (src/server/proxy-liveness.ts:147-150). A non-loopback hostname is probed only at that address (loopbackProbeHosts, :649-656). Only a connect-phase refusal counts as "dead" (classifyHealthz, :354-368; isConnectionRefused, :334-352). If the 1500 ms abort fires before the refusal is reported, the verdict is "unknown", and resolve exits 1 instead of treating it as absent (src/cli/resolve.ts:313). That matches the timing you measured.

    On the suggested fixes:

    • Please do not switch the probe to 127.0.0.1 for a Tailscale-IP bind. A listener bound only to that address refuses loopback, and a refusal read as "absent" could start a second runtime. Loopback probing is correct only when the runtime also listens on loopback.
    • A longer budget already exists: OCX_PROBE_TIMEOUT_MS (1 to 30000 ms, raises only; docs-site/src/content/docs/reference/cli.md:213-214). Could you test OCX_PROBE_TIMEOUT_MS=5000 in the environment that starts OpenCodex Desktop, and report whether startup completes?
    • Tailscale Serve proxies only to 127.0.0.1 (docs-site/src/content/docs/guides/remote-hub.md:351), which matches what you found.

    Needs info: Desktop passes the ocx resolve failure reason into its startup failure (desktop/src-tauri/src/startup.rs:816-833, reason from desktop/src-tauri/src/resolve.rs:268-280), so a message like "the bundled CLI could not resolve the runtime (exit 1): ..." is expected. If nothing was shown, please share the redacted Desktop startup diagnostic text and the output of ocx resolve --json under the same hostname setting.

  4. added
    needs-info
    on Nov 8, 2026
  5. jayjay181818 commented on Nov 8, 2026

    @jayjay181818
    Author

    Thanks for the walkthrough. I ran the test you asked for on Windows, OpenCodex 2.99.0 (Desktop 2.99.0).

    Setup: hostname set to the machine's own Tailscale IPv4 (config backed up first). Desktop fully stopped (nothing listening on 10100/10102), then OCX_PROBE_TIMEOUT_MS=5000 set as a user environment variable and in the shell that relaunched Desktop via Start-Process.

    Result: startup still does not complete. Desktop shows:

    OpenCodex could not start its runtime — the bundled CLI could not resolve the runtime (exit 1):
    resolve: liveness is unknown (a probe timed out or a listener withheld /healthz); refusing to treat unknown as absent.
    
    • Failed step: "Resolving the configuration home and port"; later steps never ran.
    • Diagnostic: elapsed 8597 ms, endpoint not resolved, runtime process "still running or never started", runtime output none.
    • Nothing listening on 10100 or 10102 after 60 s (plus ~20 s more); no recovery.
    • ocx status during the failure: Proxy: not running, Health: http://<tailscale-ip>:10100/healthz timed out.

    ocx resolve --json under the same hostname setting printed no JSON, only the same line (resolve: liveness is unknown ... refusing to treat unknown as absent.), exit code 1. That may be worth a look on its own: with --json I'd expect a structured failure object on stdout.

    Caveat: I couldn't confirm the running Desktop process actually inherited OCX_PROBE_TIMEOUT_MS (I didn't inspect its environment). The 8.6 s elapsed time is longer than a single 5 s attempt, so either the variable wasn't applied, or the budget covers each attempt rather than the whole resolve and the verdict stays "unknown" anyway. If there's a log line or debug flag that prints the effective probe timeout, I'm happy to rerun with it.

    Restoring hostname to 0.0.0.0 brings startup back immediately (healthy, listening on 10100 and 127.0.0.1:10102), so the trigger is still specifically binding to the machine's own Tailscale IP.

    Agreed on not probing 127.0.0.1 for a Tailscale-only bind. Understood why that's unsafe.

  6. jayjay181818 commented on Nov 8, 2026

    @jayjay181818
    Author

    Follow-up: I reran with the variable set in the same shell, so it's definitely in the process environment, and Desktop/runtime stopped (nothing listening):

    OCX_PROBE_TIMEOUT_MS exit wall time
    unset 1 6.9 s
    5000 1 8.5 s
    30000 1 8.5 s

    Same "liveness is unknown" message each time, and the 30000 run doesn't take longer, so the probe budget isn't what ends it.

    I think the cause is that a TCP connect to the machine's own Tailscale IP with nothing listening isn't refused on Windows; it fails after ~9 s (Test-NetConnection <tailscale-ip> -Port 10100 → TcpTestSucceeded: False after 9.0 s; ping to the same address is fine). So the connect ends in a timeout rather than a refusal, classifyHealthz never sees ECONNREFUSED, and the verdict stays "unknown" regardless of the budget. That suggests raising the timeout can't fix this case. It needs some other way to establish "absent" for a non-loopback bind on Windows (e.g. checking for a local listener on that port, or treating a connect timeout to the host's own interface address as absent).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclineeds-infoplatformservice

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions