Before submitting
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 --version prints opencode v2.0.3.
- In T3 Code, enable OpenCode under Settings > Providers and keep the default
opencode binary path.
- Refresh provider status.
The parser also fails in isolation:
"opencode v2.0.3".match(/\b(\d+\.\d+\.\d+)\b/) // null
Expected 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
Before submitting
Area
apps/server
Summary
With OpenCode 2.0.3 installed, T3 Code reports the OpenCode provider as unavailable:
The CLI itself works fine:
Steps to reproduce
opencode --versionprintsopencode v2.0.3.opencodebinary path.The parser also fails in isolation:
Expected behavior
parseGenericCliVersionshould return"2.0.3"foropencode 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
parseGenericCliVersioninapps/server/src/provider/providerSnapshot.tsuses:The leading
\brequires a word boundary before the major version, but inv2.0.3thevand the2are 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.parseSemverinpackages/shared/src/semver.tsalready accepts a leadingv(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
opencode --version->opencode v2.0.3)Environment
Logs or stack traces
Workaround
Wrap the CLI so that
--versionprints a bareX.Y.Zand forward every other argument toopencode.Related