pingdotgg / pingdotgg/t3code

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

Open
#11,080 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug via-triage
Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating OPENCODE_VERSION_PROBE_TIMEOUT and the CLI health-check path that runs the provider's --version probe. Inspect how provider settings and probe failures are handled, then add the requested configurability or adjusted default and cover the timeout behavior with the relevant test if one exists. Done means a realistic cold-start probe no longer incorrectly marks the provider Unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.