fix(server): slow OpenCode wrappers no longer show as unavailable#16544

merged1
main
GitHub fork: fix/opencode-version-probe-timeout
openedOct 6, 2026byJjosephv123
View on GitHubTwo-way sync enabledPR last imported 22d ago

Problem

Local OpenCode health checks run opencode --version and give up after 4 seconds. Installs behind a wrapper (version managers, shims) can take longer than that to start cold, so a working OpenCode shows as Unavailable in settings until a later warm probe succeeds.

Change

The version-probe timeout in apps/server/src/provider/opencodeVersionProbe.ts goes from 4s to 10s. The timeout was added in #8750 to stop --version calls that hang for hours. 10s still stops those, but leaves room for a slow cold start. The process-group kill on timeout is unchanged.

Only OpenCode's local CLI probe changes. The external-server probe, other providers' timeouts and the status shown after a real timeout stay the same. The timeout is not configurable.

Scope and approval

Fixes #11080, labeled accepted. This is option 1 of the maintainer triage: "Raise the OpenCode version-probe timeout to ~8–10s so realistic wrapper cold starts can finish." (https://github.com/pingdotgg/t3code/issues/11080#issuecomment-5619422274).

Earlier PRs were closed without being rejected on approach. #11093 was closed during the provider-layer freeze for orchestration V2, which has since landed. #12701 and #14575 were closed by their author after growing a configurable timeout. This PR is the minimal version.

Verification

  • vp test run src/server/status.test.ts in packages/provider-opencode: 27/27 passed. (Since #17302 moved OpenCode into its own package, the probe lives in packages/provider-opencode/src/server/versionProbe.ts; this PR is rebased onto that.)
  • New test, "waits for a slow but healthy local CLI version probe": --version answers after 6s on the test clock. The probe reports the installed version 1.14.19 and not an error. With the timeout set back to 4s, this test fails.
  • The existing hang test now advances the clock 10s and checks that the error message says "timed out after 10 seconds", so a hung --version still fails.
  • packages/provider-opencode typecheck is clean, and lint and format are clean on the touched files.
  • Not verified: a real slow wrapper. opencode is not installed on my test machine; the tests simulate the cold start with the test clock.

Done by Claude Opus 5.5 via Claude Code in T3 Code.

Checks

24 successful · 11 skipped
All checks passed
69d95d0
Synced from GitHub

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This changes the unconfigurable local OpenCode probe timeout from 4 to 10 seconds, altering when a configured installation is reported as unavailable and how long a hung probe can delay failure. The behavior is well covered by focused tests, but the product-default change warrants human review.

No code changes detected at 69d95d0. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dd05b602-5b73-4d19-8efa-62edecc8a3ce

📥 Commits

Reviewing files that changed from the base of the PR and between cefd01e1a44139a1b2306695b533265190a902a1 and 69d95d0095300cc349f79024c092c04e37d2f14e.


📒 Files selected for processing (2)
  • packages/provider-opencode/src/server/status.test.ts
  • packages/provider-opencode/src/server/versionProbe.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The OpenCode CLI version probe timeout increases from 4 seconds to 10 seconds. Tests cover the timeout and a successful version probe delayed by 6 seconds.

Changes

OpenCode version probe

Layer / File(s)Summary
Timeout and probe tests
packages/provider-opencode/src/server/versionProbe.ts, packages/provider-opencode/src/server/status.test.ts
The probe timeout and timeout error message use a 10-second limit. The test mock supports configurable delays, and tests check timeout and successful completion after a 6-second delay.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge


Merge Risk | ⚪ Minimal · up to 69d95

Merge Risk: ⚪ Minimal · up to 69d95

The local CLI probe now allows a healthy six-second startup while still timing out after ten seconds. The changed behavior is covered, and no actionable merge-blocking risk remains.

Security Architecture Review

Security architecture risk: 🔵 Low · up to cefd0

Local checks receive six additional seconds using the existing commands and permissions. No introduced security defect was established, but real-process cleanup during timeout or cancellation remains unverified.

Retained concerns No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The directly affected execution surface is the configured local command on the server host, with its existing supplied or inherited environment. The PR extends its allowed probe interval without adding credentials or changing environment handling. The evidence does not establish tenant-wide or deployment-wide exposure.

Trust Boundaries and Controls

  • observed — The changed local probe does not consume server passwords or issue HTTP requests. Those remain on the separately selected server-probe branch, which retains its URL validation, response classification and authentication handling.

Resilience and Maintainability Implications

  • inferred — The material uncertainty is whether timeout and caller interruption reliably complete owned-process cleanup, including interrupted spawning, completion races and concurrent probes. Spawn precedes explicit finalizer registration, but missing dependency semantics prevent treating that ordering as a demonstrated leak. The ownership structure predates this PR.

Hardening Proposals

  • proposed — Resolve the lifecycle proof gap by establishing the dependency's interruption and scoped-spawn guarantees, supplemented by real-child checks for timeout, cancellation and completion races. This is verification of an existing containment guarantee, not a finding that cleanup is broken.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues checkPassedIssue [#11080] requires tolerance for realistic OpenCode CLI cold starts or a configurable probe timeout. packages/provider-opencode/src/server/versionProbe.ts sets the local CLI timeout to 10 secon…
Out of Scope Changes checkPassedThe reviewed changes are limited to the local OpenCode CLI timeout and related tests. The external-server timeout remains 5 seconds, and no other provider timeout or timeout configuration changes appe…
Title checkPassedThe title clearly identifies the fix: slow OpenCode wrappers no longer appear unavailable. It is concise, specific, and uses a conventional commit format.
Description checkPassedThe description includes all required sections. It explains the problem, the 4-to-10-second timeout change, scope limits, linked issue and triage direction, focused test results, unverified real-wrapp…

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Added 1 commit

  • fix(server): slow OpenCode wrappers no longer show as unavailable69d95d0