Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Summary
With OpenCode 2.0.3 installed, T3 Code reports the OpenCode provider as unavailable:
OpenCode — Unavailable · Failed to execute OpenCode CLI health check: Unable to determine OpenCode version from `opencode --version` output. T3 Code requires OpenCode v1.14.19 or newer.
The CLI itself works fine:
$ opencode --version
opencode v2.0.3
Steps to reproduce
- Install OpenCode 2.x so that
opencode --versionprintsopencode v2.0.3. - In T3 Code, enable OpenCode under Settings > Providers and keep the default
opencodebinary path. - Refresh provider status.
The parser also fails in isolation:
"opencode v2.0.3".match(/\b(\d+\.\d+\.\d+)\b/) // nullExpected behavior
parseGenericCliVersion should return "2.0.3" for opencode v2.0.3, and the health check should not claim that it cannot determine the version. (Whether OpenCode 2 then runs is the separate OpenCode 2 runtime track, see Related.)
Actual behavior
parseGenericCliVersion in apps/server/src/provider/providerSnapshot.ts uses:
output.match(/\b(\d+\.\d+\.\d+)\b/)The leading \b requires a word boundary before the major version, but in v2.0.3 the v and the 2 are both word characters, so there is no boundary and the match fails. The provider then falls into the "Unable to determine OpenCode version" branch even though the CLI is installed and newer than the minimum version.
parseSemver in packages/shared/src/semver.ts already accepts a leading v (replace(/^v/, "")), so the two version parsers are inconsistent.
Impact
Blocks work completely for OpenCode 2.x users: the provider cannot be enabled at all, and the error message hides the real cause. The parser is shared by the OpenCode, Claude, and Grok providers, so this is not OpenCode-specific.
Version or commit
- T3 Code 0.0.40 (desktop)
- Reproduces on main @ 9375c77
- OpenCode 2.0.3 (
opencode --version->opencode v2.0.3)
Environment
- Windows 11, T3 Code desktop 0.0.40
- OpenCode 2.0.3 installed via npm
- The bug is platform independent (pure string parsing)
Logs or stack traces
OpenCode — Unavailable · Failed to execute OpenCode CLI health check:
Unable to determine OpenCode version from `opencode --version` output.
T3 Code requires OpenCode v1.14.19 or newer.
Workaround
Wrap the CLI so that --version prints a bare X.Y.Z and forward every other argument to opencode.
Related
- [Bug]: OpenCode — Unavailable. Failed to execute OpenCode CLI health check on Windows #11650 - same symptom
- feat(server): support OpenCode 2 alongside OpenCode 1 #8207 - OpenCode 2 runtime support (different root cause: the v2 HTTP API)
- A focused fix with unit tests opens right after this report.
Activity