Repository navigation
fix(app): show the model's provider and match TUI model resolution in the composer - #56101
opencode-agent[bot] wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
The change looks sound. I couldn't run it in the browser: Playwright's Chromium won't launch in this environment (missing system library), so I couldn't run the new composer regression test or take screenshots. Could you attach before/after screenshots of the composer model control (normal and an unavailable model)? Type check and the related unit tests (submit.test.ts, test-browser/model-selection.test.ts) pass. Reading the code: the unavailable model is shown only in the session path, and submission stays blocked there. New-session resolution still filters to available models. Always waiting for the agent list fixes the old check, which never waited when custom agents were hidden because visibility depended on that same list.
Public API unchanged: ModelSelection.key(), the composer's model.provider field and the dialog.model.unavailable string are all internal to packages/app.
No blocking concerns.
Related: #52805
The desktop composer only showed a faint provider logo next to the model name, so the same model from two providers looked identical. Combined with a couple of places where desktop resolved the current model differently from the TUI, users read fallbacks as the model "switching randomly".
This aligns the desktop composer's model display with the TUI prompt:
Provider / Model(provider name muted), replacing the faint provider logo. The control is wider so both fit; the model name truncates first and the provider name only past half the width.Provider / model-id (unavailable), like the TUI, instead of collapsing to "Select model". Submission is still blocked until a model is available, as before.ModelSelectionnow exposeskey(): the chosen model before the catalog lookup.New-session resolution order already matched the TUI (pick → agent model → configured → recent → first available), so it is unchanged.
Tests:
bun run typecheck(packages/app)bun test src/composer/submit.test.ts,test-browser/model-selection.test.tsregression/composer.spec.ts(new case: session model waits for its agent instead of showing the recent fallback; verified it fails without the fix),regression/new-session.spec.ts,regression/mobile-model-pickers.spec.ts,user-story/model-selection-flow.spec.tsRequested by: @thdxr (dax via Slack)