fix(opencode): accept OpenCode release ranges for launch-time model selection (#33307)

OpenCode model selection accepts per-major floors (1.x >= 1.18.30, 2.x >= 2.0.14; prereleases and 3.x refused) instead of exact version allowlists, so current releases launch with a picked model again. Fixes #26611. Supersedes #26683, #31985.

Co-authored-by: ggbdpq <67929842+ggbdpq@users.noreply.github.com>
This commit is contained in:
Neil
2026-10-24 16:59:04 -07:00
committed by GitHub
co-authored by ggbdpq
parent 2a4f8e65d8
commit d170b5a806
4 changed files with 55 additions and 27 deletions
@@ -71,7 +71,7 @@ export function parseOpenCodeLaunchModelContext(options: {
) {
return null
}
// Installed 2.0.16 returns the selected default first; newer source has a different order.
// OpenCode 2.x `agent.list` returns the selected default agent first.
const primary = agents.data.data.find((item) => item.mode !== 'subagent' && !item.hidden)
const configured = config.data.reduce<string | undefined>(
(value, entry) => entry.info?.default_agent ?? value,