Skip to content

fix(startup): scale the idle-silence timeout for CI, matching the absolute-max ceiling#22

Merged
kriszyp merged 1 commit into
mainfrom
fix/ci-aware-startup-idle-timeout
Jul 17, 2026
Merged

fix(startup): scale the idle-silence timeout for CI, matching the absolute-max ceiling#22
kriszyp merged 1 commit into
mainfrom
fix/ci-aware-startup-idle-timeout

Conversation

@kriszyp

@kriszyp kriszyp commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

DEFAULT_STARTUP_TIMEOUT_MS (the idle/no-output watchdog window runHarperCommand uses to decide a boot has hung) was a flat 60s regardless of environment, while DEFAULT_STARTUP_MAX_MS (the absolute ceiling) already scales 120s → 300s under CI (IS_CI check). Applies the same 2.5x ratio to the idle window: 60s → 150s under CI.

Purpose

Closes the "and/or a higher CI-aware default" ask from #8, and the underlying cause of HarperFast/harper#1827 (recurring HarperStartupError: Harper produced no startup output for 60000ms across unrelated PRs).

Timeline that led here:

Where to look

  • src/harperLifecycle.ts: the DEFAULT_STARTUP_TIMEOUT_MS default and its JSDoc, plus the StartHarperOptions.startupTimeoutMs JSDoc (caught by Codex review — was still documenting the old flat 60s).
  • README.md: default value docs updated to match.

No behavior change for non-CI runs; CI runs get 2.5x more idle headroom, consistent with the existing max-ceiling ratio. Not adding new test coverage for the IS_CI branch here — the sibling DEFAULT_STARTUP_MAX_MS CI branch has no coverage either and is already tracked as a follow-up in #10; happy to fold this new branch into that same issue instead of inventing a one-off pattern for it now.

🤖 Generated by Claude (Sonnet 5), reviewed via codex exec review --uncommitted (one non-blocking JSDoc nit found and fixed).

…olute-max ceiling

DEFAULT_STARTUP_TIMEOUT_MS (the idle/no-output window) was still a flat 60s
regardless of environment, while DEFAULT_STARTUP_MAX_MS (the absolute ceiling)
already scales 120s -> 300s under CI. Under contended CI runners (e.g. several
Harper instances booting concurrently within one sharded test process, each
doing CPU/IO-heavy native module loads), a healthy boot can go quiet for more
than 60s between debug-log lines without actually being hung, tripping the
idle timer well under the (deliberately larger) absolute ceiling.

Apply the same 2.5x ratio already used for DEFAULT_STARTUP_MAX_MS: 60s -> 150s
under CI.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request increases the default startup timeout (DEFAULT_STARTUP_TIMEOUT_MS) from 60 seconds to 150 seconds when running in a CI environment to prevent false-positive hang detections on contended runners. The documentation in README.md and the JSDoc comments in src/harperLifecycle.ts have been updated accordingly. There are no review comments, and I have no additional feedback to provide.

@heskew heskew left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Test-infra only; idle-silence timeout scales 2.5× for CI (60→150s) consistently with the absolute-max ceiling (120→300s), and idle never exceeds max. Docs aligned. LGTM.

🤖 Reviewed via cross-model pipeline; approved by @heskew.

@kriszyp
kriszyp merged commit ab75e40 into main Jul 17, 2026
8 checks passed
@kriszyp
kriszyp deleted the fix/ci-aware-startup-idle-timeout branch July 17, 2026 20:08
github-actions Bot pushed a commit that referenced this pull request Jul 17, 2026
## [0.6.4](v0.6.3...v0.6.4) (2026-07-17)

### Bug Fixes

* **startup:** scale the idle-silence timeout for CI, matching the absolute-max ceiling ([#22](#22)) ([ab75e40](ab75e40))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.6.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants