fix(opencode): address review feedback on the 2.2.5 pin

Document ocm 0.6.x as requiring OpenCode 2.2.5, matching its
@opencode/theme peer, and make the package compatibility test check
bounded peer ranges instead of treating them as one version.

Linked servers on another 2.x release keep the neutral version notice,
while a different major version is shown as unsupported again through
a shared version badge.

The Docker build now fails when the bundled OpenCode is below the
supported minimum, and the entrypoint falls back to the bundled version
as the floor when OPENCODE_MIN_VERSION is unset instead of discarding
every persisted binary.
This commit is contained in:
Chris Scott committed 2026-11-06 09:43:35 -05:00
1 parent 807c7cb896
commit bf7c6cdbac
10 files changed
+65 -24

No files matched your search

+14 -2
View File
@@ -460,14 +460,26 @@ exit 1`)
expect(curlLog()).toHaveLength(0)
})
it('treats every persisted binary as unsupported when the minimum version is unknown', () => {
it('treats every persisted binary as unsupported when neither the minimum nor the bundled version is known', () => {
mkdirSync(join(stubDir, 'home/.opencode/bin'), { recursive: true })
writeBinary(join(stubDir, 'home/.opencode/bin'), '2.0.15')
const res = runOpenCodeSection(`${installPrelude()}\nreconcile_persisted_opencode`, {
OPENCODE_MIN_VERSION: '',
OPENCODE_BUNDLED_VERSION: '',
})
expect(res.status).toBe(0)
expect(existsSync(homeBinPath())).toBe(false)
})
it('falls back to the bundled version as the floor when the minimum is unset', () => {
mkdirSync(join(stubDir, 'home/.opencode/bin'), { recursive: true })
writeBinary(join(stubDir, 'home/.opencode/bin'), '2.0.15')
const res = runOpenCodeSection(`${installPrelude()}\nreconcile_persisted_opencode`, {
OPENCODE_MIN_VERSION: '',
})
expect(res.status).toBe(0)
expect(existsSync(homeBinPath())).toBe(false)
expect(res.stdout).toContain('Persisted OpenCode 2.0.15 is usable; retaining it')
expect(existsSync(homeBinPath())).toBe(true)
})
it('removes a malformed persisted home binary and selects the bundled binary without downloading', () => {