Skip to content

feat(cli): make startup readiness budget configurable (#13369) - #13433

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
KooshaPari:pr/13369-ready-timeout-config
Sep 15, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
KooshaPari:pr/13369-ready-timeout-config

Conversation

@KooshaPari

Copy link
Copy Markdown
Contributor

Summary

The 60s readiness probe budget was hardcoded with no env var or flag to raise it. On slow cold starts (Windows with antivirus/fs watchers, heavy containers) the warning fires on every single start even though the server comes up fine — users see it as an error.

Reported in #10754 where a Windows user's boot takes ~6 minutes, so the warning always fires.

Changes

  • ****: Add that reads env var, falling back to 60000. Follows the same pattern as in .
  • ****: Add --ready-timeout <ms> flag to omniroute serve. Wire it to resolveReadyTimeoutMs(). Update reportReadinessTimeout() to show the actual timeout value and suggest doubling it.
  • ****: Register OMNIROUTE_READY_TIMEOUT_MS in the CLI env listing.
  • ****: Document the new env var in the CLI helpers table.
  • ****: Add "Slow Startup / Readiness Timeout" section.

Tests

11 unit tests in tests/unit/cli/ready-timeout.test.ts covering:

  • Default fallback (60000ms)
  • Env var override
  • Explicit override takes precedence over env var
  • Edge cases (zero, negative, non-numeric, empty string)

Acceptance Criteria (from #13369)

  • Readiness budget settable via env var, with 60000 remaining default
  • Env var registered in CLI env listing
  • Unit tests covering override
  • Documentation in ENVIRONMENT.md and TROUBLESHOOTING.md

Closes #13369

…3369)

The 60s readiness probe budget was hardcoded at both the definition
(pid.mjs:waitForServer) and call site (serve.mjs), with no env var or
flag to raise it. On slow cold starts (Windows with antivirus/fs
watchers, heavy containers) the warning fires on every single start
even though the server comes up fine — users see it as an error.

Changes:
- Add resolveReadyTimeoutMs() that reads OMNIROUTE_READY_TIMEOUT_MS
  env var (falls back to 60000). Follows the same pattern as
  OMNIROUTE_HTTP_TIMEOUT_MS.
- Add --ready-timeout <ms> flag to omniroute serve.
- Register the env var in the CLI env listing (env.mjs).
- Update reportReadinessTimeout() to show the actual timeout value
  and suggest doubling it when the warning fires.
- Add 11 unit tests for resolveReadyTimeoutMs covering defaults,
  env var override, explicit override, precedence, and edge cases.
- Document in ENVIRONMENT.md (CLI helpers) and
  TROUBLESHOOTING.md (new Slow Startup section).

Fixes diegosouzapw#13369
Copilot AI lite review requested due to automatic review settings September 12, 2026 11:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@diegosouzapw
diegosouzapw merged commit fc111dc into diegosouzapw:release/v3.8.51 Sep 15, 2026
8 of 16 checks passed
diegosouzapw added a commit to dmlanday/OmniRoute that referenced this pull request Sep 15, 2026
…e readiness budget

Merge origin/release/v3.8.51 (which already carries diegosouzapw#13433's
resolveReadyTimeoutMs()/--ready-timeout) and reconcile it with this PR's
per-probe timeout escalation in waitForServer()/pollHealthOnce() and the
onOutcome-aware reportReadinessTimeout() diagnostic — both capabilities are
now preserved: a configurable total readiness budget and an escalating
per-probe ceiling within it.

Also thread the already-resolved readyTimeoutMs from runServe() into
runWithSupervisor() instead of reading opts.readyTimeout out of scope inside
that function (opts is not a parameter of runWithSupervisor and was never
actually reachable there), so --ready-timeout/OMNIROUTE_READY_TIMEOUT_MS
correctly govern the waitForServer() call instead of a hardcoded 60000.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw added a commit to dmlanday/OmniRoute that referenced this pull request Sep 15, 2026
Merge origin/release/v3.8.51 to resolve the import-list conflict with
diegosouzapw#13433's resolveReadyTimeoutMs() addition (no logic overlap with this PR's
port preflight).

The "finds a real listening socket (end-to-end)" test called the real
findListeningPids() without mocking its lsof/netstat dependency, so it always
failed on any POSIX runner without lsof installed instead of skipping —
exactly the gap findListeningPids() itself already handles gracefully in
production (falls back to reporting "port free" rather than a false "busy").
Detect lsof availability the same way the production code discovers it
(spawn it and check for ENOENT) and skip the test with a clear reason when
it's absent, so a CI runner without lsof reports the test as skipped instead
of a false regression.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…3369) (diegosouzapw#13433)

The CLI readiness budget is configurable through `OMNIROUTE_READY_TIMEOUT_MS` or `omniroute serve --ready-timeout <ms>` (default unchanged at 60s). The timeout warning prints the budget it actually used and suggests a larger value, for slow cold starts such as Windows (diegosouzapw#13369). Documented in `ENVIRONMENT.md` and `TROUBLESHOOTING.md`, with 11 resolver cases.

Validated in one consolidated batch of this series (37 PRs boarded together on `release/v3.8.51`): `typecheck:core`, `check:open-sse-typecheck` and `check:dashboard-typecheck` clean; ESLint clean on every changed file; file-size, complexity, cognitive-complexity, changelog-integrity, docs-counts, docs-sync and migration-numbering gates green (only the pre-existing `open-sse/utils/stream.ts` file-size red remains, inherited from the base); 3,743 focused `node:test` cases plus 34 vitest cases green.

Thanks @KooshaPari!
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.

feat(cli): make the 60s startup readiness budget configurable (warning fires on every slow cold start)

3 participants