Skip to content

[Bug]: OpenCode provider flagged Unavailable when CLI version probe exceeds hardcoded 4s #11080

Description

@andybergon

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure (CLI health check path)

Steps to reproduce

  1. Configure the OpenCode provider with a binary that is a thin internal wrapper around the OpenCode CLI. The wrapper runs some startup checks before handing off, which can take a few seconds on a cold cache.
  2. Let that cache go cold (e.g. after it expires) so the next launch hits the slow path.
  3. T3 runs the health check (<binary> --version) with its 4s timeout.
  4. Cold-path startup pushes --version past 4s.

Expected behavior

The provider tolerates realistic CLI cold-start, or the probe timeout is configurable per provider instance. A single slow probe should not flip an otherwise-working, already-versioned provider to Unavailable.

Actual behavior

Probe fails with OpenCode CLI version probe timed out after 4 seconds and the provider flips to Unavailable until the next (warm) probe. OPENCODE_VERSION_PROBE_TIMEOUT = "4 seconds" is a hardcoded literal with no env var or settings override.

Impact

Minor bug or occasional failure (recurs whenever the wrapper's cache goes cold).

Version or commit

0.0.41-nightly.20260909.1439

Environment

macOS (Darwin 25.6.0); OpenCode CLI 1.18.19 invoked via a thin internal wrapper that runs startup checks.

Logs or stack traces

# warm cache
<wrapper> --version  -> ~1-2s
# cold cache (wrapper does startup work first)
<wrapper> --version  -> ~4.7s   # exceeds the 4s probe -> provider marked Unavailable

Workaround

Wrap the binary so --version short-circuits to the raw OpenCode CLI, bypassing the wrapper's startup work.

Suggested fix

Make the version-probe timeout configurable per provider instance (or raise the default, or decouple the version probe from full CLI initialization so a cold start doesn't fail the health check).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions