fix(opencode): keep workspace commands retryable after probe timeouts #14933
main fromrefs/pull/14933/head·opened View on GitHubProblem#
OpenCode 1.x workspace commands disappear when command.list takes more than ten seconds. The timeout becomes a successful empty command list, so the provider registry caches a snapshot containing only the built-in /compact command and skips subsequent ordinary refreshes for that workspace.
The faulty timeout order is still present on current main after the orchestrator V2 rewrite.
Change#
Apply the SDK-error fallback before the timeout. A slow probe now fails, allowing the registry to preserve cached providers and retry the workspace scan. Ordinary SDK errors retain their existing fallback behavior. The separate OpenCode 2.x path is unchanged.
The driver-level reproduction uses the real OpenCode SDK, recorded 1.18.32 health responses, and a controlled transport that holds the command request open. On main, the probe succeeds after ten seconds with only /compact. With this change, it fails at ten seconds and a subsequent successful response restores /hello alongside /compact. An SDK error still preserves workspace skills and /compact. A live MCP cold start was not exercised.
Scope and approval#
Fixes #13071. Replaces #13264 following the maintainer's request to rebuild and verify the fix against current main.
This is a focused timeout-handling fix in the existing OpenCode 1.x workspace probe, with regression coverage in the current driver test file.
- 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:XS
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
9582490Macroscope's review found this PR approvable — This is a narrowly scoped OpenCode 1.x timeout-handling fix that preserves normal command loading and SDK-error fallback while allowing timed-out probes to be retried. Regression tests cover both the timeout/retry path and the existing fallback behavior.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
🧰 Additional context used
📚 Code guidelines (1)
docs/internals/effect-services.md — configuredNo 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:
d9ca51f9-1873-4bc4-8744-525367c9d795
📥 Commits
Reviewing files that changed from the base of the PR and between 7ff2eabf56d30af15a8ac86b0eb46013a9e910ee and 95824905d64a4e816f0482d6eb45a42fa57d4392.
📒 Files selected for processing (2)
apps/server/src/provider/Drivers/OpenCodeDriver.test.tsapps/server/src/provider/Drivers/OpenCodeDriver.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#
OpenCode command loading now applies a 10-second timeout before falling back to an empty command list. Tests cover a timed-out probe followed by a successful retry, and an SDK error response.
Changes#
OpenCode command probe
Layer / File(s) Summary Command probe timeout and fallback
apps/server/src/provider/Drivers/OpenCodeDriver.ts,apps/server/src/provider/Drivers/OpenCodeDriver.test.tsThe workspace inventory loader applies the timeout before its fallback. Tests check that a timed-out probe can be retried to load commands and skills, and that an SDK error leaves the built-in command and skills available without server-provided commands. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
95824This change keeps workspace commands retryable after a slow probe timeout, and SDK errors keep their existing fallback behavior. No merge-blocking risk was found.
Security Architecture Review#
Security architecture risk: ⚪ Minimal · up to
95824The fix preserves existing cached commands when discovery times out and allows later attempts to recover. No new endpoint, permission, credential use, or material security risk was identified.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
- inferred — The supported exposure change concerns workspace-command availability and cached inventory recovery through the existing OpenCode server connection. The mobile upload and GitHub script paths are unchanged supporting name matches, not demonstrated downstream consumers or additional affected security boundaries.
Trust Boundaries and Controls
- observed — The changed probe uses the existing server URL, workspace directory, password configuration, and command.list operation. It changes how a slow server response is reported; it does not add credential authority, command execution, or a new trust transition.
Resilience and Maintainability Implications
- inferred — Cancellation wiring supports cleanup rather than accumulation of abandoned command requests: the Effect signal reaches command.list and is included in the SDK Request passed to fetch. Existing test sources assert abortion of command inventory requests on interruption. The new driver test itself ignores the signal, so it demonstrates timeout-result and retry semantics rather than physical transport termination.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main fix: keeping OpenCode workspace commands retryable after probe timeouts. Description check ✅ Passed The description includes the problem, change, scope and approval details, and focused verification results. The verification information appears in the Change section instead of a separate Verificatio… Linked Issues check ✅ Passed Issue #13071requires custom OpenCode commands to appear in command suggestions. The PR changes OpenCode 1.x workspace inventory loading so the 10-second timeout is applied before the SDK-error fallba…Out of Scope Changes check ✅ Passed The changed production code and tests support issue #13071. The production change is limited to OpenCode 1.x probe timeout handling. The tests verify retry and fallback behavior. The PR summary report…Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2… ✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Autopilot is currently an internal CodeRabbit preview.
Comment `@coderabbitai help` to get the list of available commands.Note
Written by
claude-opus-5-5on behalf of MariaHi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description.
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes