Skip to content

Fix: increase OpenCode server timeout to allow for slower OpenCode server startups#3493

Open
AJ-505 wants to merge 1 commit into
pingdotgg:mainfrom
AJ-505:fix/opencode-server-restart-time
Open

Fix: increase OpenCode server timeout to allow for slower OpenCode server startups#3493
AJ-505 wants to merge 1 commit into
pingdotgg:mainfrom
AJ-505:fix/opencode-server-restart-time

Conversation

@AJ-505

@AJ-505 AJ-505 commented Jun 21, 2026

Copy link
Copy Markdown

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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Verification

  • vp check
  • vp run typecheck
  • vp test run apps/server/src/provider/Layers/OpenCodeProvider.test.ts

Note

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), so startOpenCodeServerProcess / connectToOpenCodeServer are less likely to fail with a health-check timeout when the CLI is slow to print opencode server listening.

Callers can still pass timeoutMs to 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_MS in opencodeRuntime.ts from 5,000 ms to 20,000 ms to accommodate slower OpenCode server startups.

Macroscope summarized 0941e8f.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a0e08f68-05ef-4edb-9b3f-4d553ac33840

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jun 21, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

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

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Failed to execute OpenCode CLI health check

1 participant