Repository navigation
Conversation
The root command accepted --model but dropped it before the TUI started, so `opencode --model <id> --prompt ...` silently ran on the configured default model. Pass the flag through to the TUI args, where the existing args.model handling parses it and selects the model — matching the run path's behavior.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Hi, following up on this one more time. The fix is small -- it adds a --model/-m flag to the TUI entry and passes it through to the existing model resolution, so the TUI no longer silently drops it. CI has been green since it was opened. Would a review be possible sometime this week? Happy to rebase on the latest v2 or adjust anything. |
|
We need this for v2 as well. NeuroSquad (a desktop app that runs OpenCode in terminal panes) starts each pane with a chosen |
|
Closing for now: I've hit the repository's open pull request limit, so I need to free a slot. The branch and this discussion stay in place, and I'll reopen this once a slot frees up. |
Issue for this PR
Fixes #47172
Type of change
What does this PR do?
opencode --model <id> --prompt ...accepted the flag on the root command but dropped it before the TUI started, so the session silently ran on the configured default model — the requested id was never mentioned or validated. Therunpath already resolves and validates the same flag.--model(with-malias) on the root command paramsargs.modelhandling parses it and selects the model, warning on malformed values — matching therunpathHow did you verify your code works?
--helpon the root entry now lists--model, -mbun typecheckinpackages/cliandpackages/tuibun testinpackages/cli(259 passing) andpackages/tui(2 pre-existing timeouts in dialog-shell-output tests reproduce on a clean baseline, unrelated)Checklist
Supersedes #47699 — the PR head fork was accidentally deleted on 2026-09-09 (not intentional, see the notification comment there); re-filing so the review can continue. Original conversation: #47699