mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-13 18:32:12 +03:00
The fetch-start (headers-wait) phase inherited the flat, non-adaptive FETCH_TIMEOUT_MS (default 600_000ms) with no ceiling comparable to a real client's patience, unlike the body-phase readiness watchdog which already adapts per payload shape. Codex's own hard client-abort window for a stalled turn is ~120s, 5x shorter than the old default — so when an upstream never returned any response at all (not even headers, e.g. a stalled NVIDIA target behind a tool-heavy Responses->Chat translation), OmniRoute kept the connection open on keepalives only, guaranteeing the client gave up first with an opaque 499 instead of OmniRoute detecting and failing the stall fast. Adds resolveFetchStartTimeout() (open-sse/utils/fetchStartTimeoutPolicy.ts) that caps the headers-wait timeout to 110s for STREAMING requests only, leaving non-streaming requests on the existing flat default. Wired into BaseExecutor.execute(). The existing TimeoutError classification path (chatCore.ts) already maps this to a 504, so no change was needed there. Regression test: tests/unit/issue-11526-repro.test.ts.