fix(server): tolerate slow OpenCode version probes #12701
main fromrefs/pull/12701/head·opened View on GitHubWhat Changed#
Raise OpenCode CLI version-probe timeout from 4s to 10s (OPENCODE_VERSION_PROBE_TIMEOUT in OpenCodeProvider.ts). Process-group kill on timeout is unchanged.
In mergeProviderSnapshot: if a probe times out after a ready, versioned snapshot, keep that version/auth/ready status (plus cached models/skills) instead of flipping to error. First-boot timeouts with no prior version still error. Missing binary / inventory failures still error.
Fixes #11080
Why#
The 4s budget was added for hung wrappers (#8750), not slow-but-healthy OpenCode startups (e.g. ARM under load). A single timeout was clearing ready status and making the provider look Unavailable.
UI Changes#
No UI change. Provider health behavior only. Screenshots/video not applicable.
Verification#
From apps/server at commit 4f6663b646db:
vp test run src/provider/Layers/OpenCodeProvider.test.ts src/provider/Layers/ProviderRegistry.test.ts
Result: 2 files passed, 72 tests passed (3.50s). Regression coverage is the provider test that times out a hanging local CLI version probe after 10 seconds and the test that waits past the legacy four-second budget for a slow local CLI version probe, plus the registry tests that keep a ready OpenCode snapshot through a single version-probe timeout and do not keep last-known-good OpenCode state without a ready versioned snapshot.
vp run typecheck
Result: tsc --noEmit exited 0 (cache disabled). The compiler also printed 422 suggestion diagnostics and no error TS lines.
Limitations: Checked on Linux only. The slow version probe is covered by these unit tests with a test clock; a live OpenCode CLI was not exercised.
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
Summary by CodeRabbit#
- Bug Fixes
- OpenCode version checks now allow up to 10 seconds, improving detection on slower or heavily loaded systems.
- When a refresh times out, previously confirmed OpenCode provider details remain available instead of being cleared.
- Providers without a previously confirmed version continue to show an error when version detection times out.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
@coderabbitai review
⚠️ Action not completed
Already reviewed the last commit. Use
@coderabbitai full reviewto rerun a review of the entire changeset.Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
@coderabbitai review
⚠️ Action not completed
Already reviewed the last commit. Use
@coderabbitai full reviewto rerun a review of the entire changeset.Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — The PR changes production provider health behavior by increasing the default OpenCode version-probe timeout and retaining last-known-good state after a timeout, with focused regression coverage. Because the hardcoded probe timeout is a product default, this change is policy-sensitive despite its limited scope.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Superseding: Macroscope Not approved (eligibility/policy on OpenCode probe-timeout default). Opening a fresh READY redo from upstream main.
macodev00(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
175df7ab-a4fd-4c68-8b91-3bf079503415📥 Commits
Reviewing files that changed from the base of the PR and between 7445aa733ada33e45289e5aa5055f79142556513 and 4f6663b646db53321c244803a90b0cce15ab8254.
📒 Files selected for processing (4)
apps/server/src/provider/Layers/OpenCodeProvider.test.tsapps/server/src/provider/Layers/OpenCodeProvider.tsapps/server/src/provider/Layers/ProviderRegistry.test.tsapps/server/src/provider/Layers/ProviderRegistry.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough#
The OpenCode version probe timeout increases from 4 to 10 seconds. Tests cover delayed probes and hanging probes. Provider snapshot merging preserves ready, versioned OpenCode state after a version-probe timeout.
Changes#
OpenCode version probe timeout handling
apps/server/src/provider/Layers/OpenCodeProvider.ts,apps/server/src/provider/Layers/OpenCodeProvider.test.tsapps/server/src/provider/Layers/ProviderRegistry.ts,apps/server/src/provider/Layers/ProviderRegistry.test.tsPriority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Sequence Diagram(s)#
Suggested reviewers:
t3dotgg🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
#11080].OPENCODE_VERSION_PROBE_TIMEOUTincreases from 4 seconds to 10 seconds. The timeout test verifies the new limit. A new slow-probe test verifie…#11080]. The runtime test delay, timeout assertions, provider snapshot merge logic, and registry tests directly cover slow OpenCode startup and last-known-good state retenti…Full details: Description check
Explanation
The description explains the problem, change, verification, limitations, and test results. It does not include the required Scope and approval section or explain the linked issue's triage and maintainer approval, or why this focused fix qualifies without them.
Resolution
Add a Scope and approval section. Link the triaged issue or approval discussion and identify the maintainer approval comment. If no prior approval is required, explain why this is a focused fix of an obvious bug and provide the relevant scope justification.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.