Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope'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. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughOpenCode 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. ChangesOpenCode command probe
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to This 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 ReviewSecurity architecture risk: ⚪ Minimal · up to The 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 Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
OpenCode 1.x workspace commands disappear when
command.listtakes more than ten seconds. The timeout becomes a successful empty command list, so the provider registry caches a snapshot containing only the built-in/compactcommand and skips subsequent ordinary refreshes for that workspace.The faulty timeout order is still present on current
mainafter 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/helloalongside/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.