Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): give slow OpenCode version probes more time #11093

Closedmdiniz97(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/11093/headopened View on GitHub

What Changed

Raise the OpenCode version probe timeout from 4s to 10s.

Fixes #11080

Why

A cold wrapper around the OpenCode CLI can exceed the hardcoded four-second --version budget, which flips a healthy provider to "Unavailable" until the next probe. The fix gives slow wrappers room to finish, and covers it with a test where the probe resolves at 5s. The hanging-probe test now asserts the ten-second budget.

Tests: vp test run apps/server/src/provider/Layers/OpenCodeProvider.test.ts (14 passed)

Checklist

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

Summary by CodeRabbit

  • Bug Fixes
    • Increased the OpenCode CLI version-check timeout to 10 seconds.
    • OpenCode installations that respond within the extended timeout are now recognized with a warning status instead of being incorrectly reported as unavailable.
    • Updated timeout messaging to accurately reflect the 10-second limit.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review Change StackReview Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: 56e5caf1-d0db-44f1-8eb4-41434ea49dd1

      📥 Commits

      Reviewing files that changed from the base of the PR and between d29c56a5c404cb0f58d3b2ac41762fa0d0ac28d4 and 5f6e5fd43b7723490f188600629842ee5638075e.

      📒 Files selected for processing (2)
      • apps/server/src/provider/Layers/OpenCodeProvider.test.ts
      • apps/server/src/provider/Layers/OpenCodeProvider.ts

      Included review availability: 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 to 10 seconds. Tests add configurable command delays and verify successful handling of a 5-second delay and timeout handling after 10 seconds.

      Changes

      OpenCode probe behavior

      Layer / File(s)Summary
      Version probe timeout
      apps/server/src/provider/Layers/OpenCodeProvider.ts
      The OpenCode CLI version probe timeout changes to 10 seconds.
      Delayed probe test coverage
      apps/server/src/provider/Layers/OpenCodeProvider.test.ts
      The runtime mock supports configurable version delays. Tests cover a 5-second delayed response and a 10-second timeout.

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

      Suggested reviewers: utkarshusername, yashranaway, maria-rcks

      Merge Risk: ⚪ Minimal · up to 5f6e5

      OpenCode providers now have up to 10 seconds to complete version detection, reducing false Unavailable states for cold-starting wrappers while retaining timeout handling for hung probes. The change is merge-ready.

      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Docstring Coverage✅ PassedNo 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…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the main change: increasing the timeout for slow OpenCode version probes.
      Description check✅ PassedThe description includes the required What Changed and Why sections, explains the problem and solution, links the issue, documents test coverage, and completes the checklist. The UI items are correctl…
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

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

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The production change increases the default local OpenCode version-probe timeout from 4 to 10 seconds, changing timeout and status timing for an existing path. Because this is a product default change, it requires human review under the configured criteria.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

      Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

    5. juliusmarminge closed this

Sign in to join this conversation.