Bug Description
When a plugin is specified in opencode.json without a version suffix (e.g., \"opencode-gemini-auth\" instead of \"opencode-gemini-auth@1.3.8\"), opencode defaults the version to the string \"latest\". However, this causes a semver parsing error because \"latest\" is not a valid SemVer string.
Location
File: packages/opencode/src/plugin/index.ts
Lines: 57-58
const lastAtIndex = plugin.lastIndexOf(\"@\")
const version = lastAtIndex > 0 ? plugin.substring(lastAtIndex + 1) : \"latest\"
Error Message
{
\"name\": \"UnknownError\",
\"data\": {
\"message\": \"Error: Invalid SemVer: latest\\n\\n at order (unknown)\\n at isOutdated (src/bun/registry.ts:46:19)\\n at processTicksAndRejections (native:7:39)\"
}
}
Reproduction Steps
- Edit
~/.config/opencode/opencode.json
- Specify a plugin without version:
{
\"plugin\": [
\"opencode-gemini-auth\" // Missing @version
]
}
- Run
opencode
- Error occurs on startup
Expected Behavior
Either:
- Skip/ignore plugins without explicit versions
- Use a fallback that doesn't require semver parsing
- Validate versions before passing to semver and fail with a clear error message
Actual Behavior
Defaults version to \"latest\" string, which causes semver to fail with \"Invalid SemVer: latest\"
Root Cause
The code unconditionally defaults to \"latest\" when no version is found. This string is then passed to semver for version comparison, but semver requires valid SemVer format (e.g., 1.2.3, latest is not valid).
Workaround
Specify explicit version:
{
\"plugin\": [
\"opencode-gemini-auth@1.3.8\"
]
}
Notes
This can occur when third-party tools (e.g., tessl/skills installers) rewrite the config and strip version specifiers.
Bug Description
When a plugin is specified in
opencode.jsonwithout a version suffix (e.g.,\"opencode-gemini-auth\"instead of\"opencode-gemini-auth@1.3.8\"), opencode defaults the version to the string\"latest\". However, this causes a semver parsing error because\"latest\"is not a valid SemVer string.Location
File:
packages/opencode/src/plugin/index.tsLines: 57-58
Error Message
{ \"name\": \"UnknownError\", \"data\": { \"message\": \"Error: Invalid SemVer: latest\\n\\n at order (unknown)\\n at isOutdated (src/bun/registry.ts:46:19)\\n at processTicksAndRejections (native:7:39)\" } }Reproduction Steps
~/.config/opencode/opencode.json{ \"plugin\": [ \"opencode-gemini-auth\" // Missing @version ] }opencodeExpected Behavior
Either:
Actual Behavior
Defaults version to
\"latest\"string, which causes semver to fail with\"Invalid SemVer: latest\"Root Cause
The code unconditionally defaults to
\"latest\"when no version is found. This string is then passed to semver for version comparison, but semver requires valid SemVer format (e.g.,1.2.3,latestis not valid).Workaround
Specify explicit version:
{ \"plugin\": [ \"opencode-gemini-auth@1.3.8\" ] }Notes
This can occur when third-party tools (e.g., tessl/skills installers) rewrite the config and strip version specifiers.