Repository navigation
fix(opencode): refuse model launches on OpenCode 2.x releases that drop the startup prompt - #33436
Conversation
…op the startup prompt OpenCode 2.0.14-2.0.18 auto-submit --prompt before the agent/model list loads, so the first message is lost (upstream anomalyco/opencode#51938, fixed in 2.0.19). #33307 admitted those releases for model-selected launches; keep them refused unless Orca's startup-prompt plugin covers the release (2.0.16).
|
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 9 minutes. View limit details
No actionable comments were generated in the recent review.
|
…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)
Summary (ELI5)
If you picked a model and started an OpenCode worker with a first message, OpenCode 2.0.14, 2.0.15, 2.0.17 and 2.0.18 opened with the message typed into the box but never sent it, so the worker just sat idle. #33307 started allowing model picks on those versions. This PR refuses model picks on them again, with the same clear "cannot verify" error they showed before #33307. OpenCode 2.0.16 and 2.0.19+ (including 2.1.x) still work.
Root cause
--prompt, prefills the Home composer, and auto-submits it. Before upstream fix(tui): wait for agent and model before auto-submitting --prompt anomalyco/opencode#51938 (commit8c1ce954d0, first released in v2.0.19), the submit effect only waited forlocal.model.ready, so it fired before the agent/model list had loaded and the submit was lost (packages/tui/src/routes/home.tsx:68-78at v2.0.14 vs v2.0.19+, which also waits forcatalogReadyandagent.current()/model.current()).OPENCODE_NATIVE_PROMPT_VERSIONS = ['2.0.12','2.0.16'], using its own startup-prompt plugin (promptMode: 'prefill'). Every other 2.x release getspromptMode: 'unknown', so the launch keeps the bare--promptand relies on OpenCode's own submit.2.0.16to>=2.0.14 <3. That let in 2.0.14/15/17/18, where neither OpenCode's own submit nor Orca's plugin delivers the prompt. This is the P1 brennanb2025 reported on fix(opencode): allow model picks when discovery is unavailable #31985.Change
isVerifiedOpenCodeConfigModelVersionnow also requires a working startup-prompt path: a stable 2.x release>= 2.0.19(OpenCode's own submit works), or a version inOPENCODE_NATIVE_PROMPT_VERSIONS(Orca's plugin). In practice the accepted set is2.0.16plus>=2.0.19 <3. This is a superset of what was accepted before #33307, so no version that worked before #33307 is refused now.Verification (real binaries, isolated HOME/XDG under /tmp/verify-oc2-*,
@opencode/cli-darwin-arm64npm tarballs)A temporary harness (not committed) ran the real
buildExecutionHostAgentStartupPlan/planExecutionHostStartupWithPromptCandidateand thenprepareOpenCodePtyLaunch, and ran the resulting command in a real PTY. A prompt counts as delivered when OpenCode's DB has auserrow insession_messagewith the prompt text.capability_unsupportedReplies hit free-tier/auth 429/401 errors. That doesn't matter for this check: the user message was recorded and the assistant turn ran on the picked model.
pnpm tc:node,pnpm test src/main/opencode/opencode-model-startup-plan.test.ts,pnpm run check:code-quality:changed: pass.Risk / notes
--prompt. Fixing that needs paste/plugin delivery for those releases and is a separate decision.