Fix: increase OpenCode server timeout to allow for slower OpenCode server startups#3493
Fix: increase OpenCode server timeout to allow for slower OpenCode server startups#3493AJ-505 wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved This PR increases a timeout constant from 5 to 20 seconds - a simple, low-risk configuration tweak that allows more time for slower server startups without changing any functional behavior. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Increases timeout for Opencode server to prevent abrupt failures for slower spawn times.
Fixes #2337
Why
Currently, the OpenCode provider times out after 5 seconds before returning an error (
Failed to execute OpenCode CLI health check: Timed out waiting for OpenCode server start after 5000ms.). Increase the timeout to 20 seconds to resolve the issue.Why 20 seconds?
In my testing, the OpenCode server takes about 9 seconds at best, and 12 seconds at worst, to restart (on a Linux PC). 20 seconds is basically some extra allowance in case of longer delays.
Checklist
Verification
vp checkvp run typecheckvp test run apps/server/src/provider/Layers/OpenCodeProvider.test.tsNote
Low Risk
Single constant change in provider startup timing with no auth, data, or API contract changes; worst case is slightly longer waits before failure.
Overview
Raises the default wait for local OpenCode server startup from 5s to 20s in
opencodeRuntime.ts(DEFAULT_OPENCODE_SERVER_TIMEOUT_MS), sostartOpenCodeServerProcess/connectToOpenCodeServerare less likely to fail with a health-check timeout when the CLI is slow to printopencode server listening.Callers can still pass
timeoutMsto override the default; only the fallback when that option is omitted changes.Reviewed by Cursor Bugbot for commit 0941e8f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Increase OpenCode server startup timeout from 5s to 20s
Raises
DEFAULT_OPENCODE_SERVER_TIMEOUT_MSin opencodeRuntime.ts from 5,000 ms to 20,000 ms to accommodate slower OpenCode server startups.Macroscope summarized 0941e8f.