Repository navigation
fix(opencode): accept OpenCode release ranges for launch-time model selection - #33307
Merged
Merged
Conversation
…election The model launch gate admitted only 1.18.30, 1.18.32 and 2.0.16, so every later OpenCode release refused a picked model. Upstream's `--model` and `opencode models` (1.x) and the agent/model/config API plus `--standalone` (2.x) are unchanged across 1.18.30..1.19.4 and 2.0.14..2.1.4; replace the exact list with per-major floors. The 2.x before/after probes still fail closed on an unavailable model. Fixes #26611 Co-authored-by: ggbdpq <[email protected]> Co-authored-by: Brennan Benson <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 24, 2026
nwparker
added a commit
that referenced
this pull request
Oct 25, 2026
…op the startup prompt (#33436) OpenCode 2.x model-selection launches require 2.0.19+ (upstream #51938 waits for agent/model before auto-submitting --prompt) or a native-prompt version (2.0.12, 2.0.16), fixing a regression from #33307 where 2.0.14/15/17/18 accepted a picked model but silently dropped the first prompt.
LuweiLiao
pushed a commit
to LuweiLiao/orca
that referenced
this pull request
Oct 25, 2026
…election (stablyai#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 stablyai#26611. Supersedes stablyai#26683, stablyai#31985. Co-authored-by: ggbdpq <[email protected]> (cherry picked from commit d170b5a)
LuweiLiao
pushed a commit
to LuweiLiao/orca
that referenced
this pull request
Oct 25, 2026
…op the startup prompt (stablyai#33436) OpenCode 2.x model-selection launches require 2.0.19+ (upstream stablyai#51938 waits for agent/model before auto-submitting --prompt) or a native-prompt version (2.0.12, 2.0.16), fixing a regression from stablyai#33307 where 2.0.14/15/17/18 accepted a picked model but silently dropped the first prompt. (cherry picked from commit e575cc1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you pick a model for an OpenCode terminal or worker, Orca first checks that the installed OpenCode can actually use it. That check only trusted three exact releases: 1.18.30, 1.18.32 and 2.0.16. Every newer OpenCode, including the current 1.19.4 and 2.1.4, got
capability_unsupported: The execution host cannot verify this OpenCode model launch.This change replaces the three exact releases with a minimum version for each major.Root cause
src/main/opencode/opencode-model-version-policy.tshad aSet(['1.18.30', '1.18.32'])for the 1.x--modelroute, andopencode-model-startup-plan.tshad a hard-codedversion !== '2.0.16'for the 2.x config-overlay route. Neither route depends on anything that changed in upstream after those releases:1.x
--modelroute (passes--model, after checking the model withopencode models). Comparing upstreamv1.18.30withv1.19.4,packages/opencode/src/cli/cmd/models.tsandpackages/tui/src/context/local.tsx(args.modelhandling, :198) have no diff.packages/opencode/src/cli/cmd/tui.ts:81(--model) changed only for the updater (#54409/#54904).2.x config-overlay route (
serveprobe,OPENCODE_CONFIG_CONTENToverlay,--standalone). The code Orca relies on is the same fromv2.0.14throughv2.1.4anddev:agent.liststill returns the selected default agent first (packages/core/src/agent.ts:124at v2.0.14,:103at v2.1.4/dev)./api/model/defaultis still served (packages/protocol/src/groups/model.ts:26).servestill printsserver listening on(packages/cli/src/server-process.ts:163).--standaloneflag is still there (packages/cli/src/commands/commands.ts:16).The parser comment claiming "newer source has a different order" was out of date, so this PR corrects it.
About #26683's "1.18.35 is too old" question: the main test that calls 1.18.35 too old (
acp-structured-launch-resolution-opencode.test.ts:279) is for theopencode2ACP provider, whose minimum is 2.0.14. It has nothing to do with this model gate, so it is not a conflict.What changed
isVerifiedOpenCodeLegacyModelVersion: accepts stable1.x >= 1.18.30(the previous floor).isVerifiedOpenCodeConfigModelVersion: accepts stable2.x >= 2.0.14, the same floor as the opencode2 ACP minimum.opencode modelscheck still refuse a model that isn't available.How verified
I ran a throwaway vitest harness, not checked in, that calls the real
buildExecutionHostAgentStartupPlanagainst real binaries from npm (opencode-darwin-arm64,@opencode/cli-darwin-arm64) plus the installedopencode2.0.16. Each run used isolated XDG dirs.--modellaunch--modellaunch--modellaunch--modellaunch--standalone+ overlay{"model":…,"agents":{"build":{"model":…}}}--standalone+ overlay; the after-probe confirmed the build agent's modelopencode/not-a-modelChecks run:
pnpm tc:node,pnpm test src/main/opencodeplus the related runtime/worker/pty-launch tests (1056 passed), andpnpm run check:code-quality:changed.Risk
Low. The only change is which versions get to run the existing model probes. Remote and WSL are still refused before any probe, and there are no UI or mobile changes. Folder workspaces are unaffected.
OPENCODE_NATIVE_PROMPT_VERSIONS(draft-prompt prefill) is a separate exact list and is not touched here.Credit: @ggbdpq (#26683) for reporting and first fixing 1.18.35, and @brennanb2025 (#31985) for the broader gate analysis. This PR supersedes both.
Fixes #26611