Skip to content

[Bug][Windows] Closed IPv4 loopback ports time out, causing ownership-fence startup crash loops (2.100.2) #8697

Closed

Description

@samzoom705-sketch

Client or integration

Codex App

Area

Service lifecycle

Summary

Windows 11: OpenCodex 2.100.2 fails to start when an unbound IPv4 loopback port times out instead of refusing TCP connections. The Task Scheduler service exits with code 1 and repeats startup attempts. It cannot establish the identity/absence of a purported proxy owner, even though no process is listening.

Two independent startup checks are affected:

  1. src/server/proxy-liveness.ts: observeProxyLiveness(START_OWNERSHIP_LIVENESS) gives {"kind":"unknown","live":null}; recoverStartJournalAfterOwnerRecheck refuses startup.
  2. src/cli/cross-home-owner.ts: findCrossHomeOwnerDetailed() gives {"kind":"indeterminate","port":10100,...}; markCrossHomeSibling refuses startup.

Expected: when the exact host/port can be successfully bound, this can safely establish that there is no listener on that address, even if TCP SYN probes to closed local ports time out. A busy or unprovable port must remain fail-closed.

An equivalent failure occurs on one Windows machine with a Mihomo TUN adapter, but the cause of the TCP timeout is not proven. This issue concerns OpenCodex recovery behavior, not a confirmed defect in Mihomo.

The new v2.100.3 release does not appear to address either relevant code path: the cross-home discovery in src/cli/cross-home-owner.ts remains identical (same blob SHA on v2.100.3), and the loopback recovery path in proxy-liveness.ts remains without the tested fallback. The local fixes described below were tested on 2.100.2; 2.100.3 has not been installed on the affected machine.

Reproduction

  1. Windows 11 x64 (observed on Windows 11 25H2 / 26200), @bitkyc08/[email protected], Bun 1.4.4; OpenCodex configured to listen on 127.0.0.1:10100.
  2. When no local listener is present, connecting to 127.0.0.1:9, 127.0.0.1:505, 127.0.0.1:63890, or 127.0.0.1:10100 returns a timeout, not an immediate refusal. A temporary TcpListener bound on 127.0.0.1 accepts connections (PASS); unbound ::1:10100 refuses immediately.
  3. Get-NetTCPConnection -State Listen -LocalPort 10100 returns no listener.
  4. ocx service start registers the Windows Task Scheduler service, but the runtime exits and gets restarted repeatedly; ocx status reports Proxy: not running.
  5. Local diagnostic functions in the installed package return unknown / indeterminate as above.

Local-only mitigation that restored service on the affected machine:

  • canBindAddress("127.0.0.1", 10100, 1000) => true and canBindAddress("::1", 10100, 1000) => true when stopped.
  • For both discovery paths, after an identity/health probe returns unknown, try a bounded canBindAddress on the same literal address and port.
  • Only if bind succeeds, classify that endpoint as dead/unowned. If bind fails, deadline expires, or there is any live owner evidence, preserve the conservative unknown/refusal.

With these local modifications:

observeProxyLiveness(START_OWNERSHIP_LIVENESS) => {"kind":"absent","live":null}
findCrossHomeOwnerDetailed() => {"kind":"none"}
bun build src/cli/index.ts --target=bun => PASS (2685 modules)
ocx service start => serving on 127.0.0.1:10100
GET /healthz => HTTP 200, version 2.100.2

This confirms a narrow local recovery; it is not an upstream test suite run or verified end-to-end model request. It would be valuable to add regression tests for IPv4 timeout+successful bind, failed bind/live listener, IPv6 refusal, and both ownership-fence paths.

Version

2.100.2 (local workaround tested); 2.100.3 source checked, same cross-home fallback gap.

Operating system

Windows 11 x64, 25H2, build 26200.

Provider and model

n/a — proxy cannot start, before provider traffic.

Logs or error output

Proxy ownership is unverified; startup refused. PID record and recovery journal were preserved. Retry when the owner can be verified.
  at recoverStartJournalAfterOwnerRecheck (src/cli/start-owner-fence.ts)

Shared-client owner could not be verified (a managed client port answered but its listener could not be classified); refusing startup before any shared-client write. Retry startup after discovery recovers.
  at markCrossHomeSibling (src/cli/cross-home-owner.ts)

Screenshots and supporting files

The issue documents direct local probes, in-process results before/after the workaround, and real startup/HTTP health evidence. Related reports: #7258 (IPv6-disabled Linux loopback), #8045 (Windows Tailscale IP), and #8552 (container recovery fence). This report differs in using literal 127.0.0.1 and covering both startup fences.

Redacted configuration

{"port":10100,"hostname":"127.0.0.1"}

Checks

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

Activity

  1. added
    platform
    on Nov 13, 2026
  2. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  3. added
    bug
    service
    on Nov 15, 2026
  4. Ingwannu commented on Nov 16, 2026

    @Ingwannu
    Owner

    The report identifies two separate conservative ownership gates, and the source still has the corresponding unknown/indeterminate refusal paths. A listener-list snapshot or a successful bind on a different address cannot establish absence at the exact endpoint; the proposed fallback needs a bounded exclusive bind on that same literal address/port and must not override positive owner evidence. Releasing the probe bind also creates a race before startup, so the existing final ownership/generation checks must remain authoritative.

    A focused PR should cover timeout + successful exclusive bind, occupied/refused/unprovable bind, a listener appearing after the probe, sibling-home owner evidence, cancellation and IPv6 behavior in both paths. Do not turn all probe timeouts into dead/unowned, erase the journal/PID record, or bypass the shared-client write fence. Your local mitigation and /healthz check are useful scoped evidence, but are distinct from native Windows regression coverage or an end-to-end provider turn. I made no Windows service, tunnel, firewall or runtime change here.

  5. added a commit that references this issue on Nov 16, 2026
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

    bugplatformservice

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions