Repository navigation
fix(native-chat): keep the model picker on an agent's first chat - #27327
AmoabaKelvin wants to merge 1 commit into
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established; the change is mergeable after normal checks. Pre-merge checks |
|
A chat opened before its agent's first model listing finished took the host's empty at-rest answer as final and hid the picker.
1f6a593 to
b43a52f
Compare
|
Closing: fixed on main by #26116. When the model list finishes loading, the chat now reads its options again, so the picker comes back on an agent's first chat. Checked on main (36913fd) with OpenCode 1.19.0 on a fresh profile: the first and second OpenCode chats list all 10 models, and a first Codex chat shows model and effort. On the first chat the picker still disappears for about a second before it returns. |
ELI5
The first time you open a chat for an agent like OpenCode, Orca has to fetch that agent's model list, which takes about a second. The new chat asked "what are my options?" before the fetch finished, got "no models" back, and hid the model picker for good. Now Orca answers "I don't know yet", and the picker fills in when the list arrives.
What Changed
Before. On the first OpenCode chat for an account, the
Modelpill appeared for under half a second and then vanished. It stayed gone until you switched tabs and came back. Later chats were fine, because the list was saved by then.After. The
Modelpill stays, and about a second later it lists the agent's models.Mechanism.
modelsUnknown. When the picker sees it, it stays on the agent's built-in list (for OpenCode, the quietModelpill) and keeps the saved model's fallback effort choices, so the fetched list can still fill it.This started with #26587, which stopped the host from naming a placeholder model in that answer.
Why
The host is the only side that knows whether "no models" means "none" or "not fetched yet", so it should say which. The picker code is shared, so desktop and mobile both get the fix from one rule.
Alternatives considered:
Visual Proof
No attachments. Observed in a dev build on a fresh profile, OpenCode 1.18.35:
Modelpill at ~0.5s, gone by ~0.9s, still gone at 12s.Modelpill stays; opening it lists 11 OpenCode models.Testing
Dev build on a fresh profile (macOS), OpenCode 1.18.35: first and second chats keep the pill and list 11 models; a first Codex chat shows its model and effort.
Same check on OpenCode 2.0.26: the pill stays as the
Modelplaceholder. The list does not fill before the first message, because 2.0.26 rejectsopencode models --verboseand the fetch fails. That is a separate bug, not changed here.New test: a "no list yet" answer followed by the fetched list fills the picker. It fails without the fix.
New test: a saved model outside the built-in list keeps its effort picker when the host has no list.
The host test for a chat at rest now asserts the flag.
pnpm lint,pnpm tcand the three audits pass. Related test areas pass (shared, native-chat, claude, codex, acp, pi, mobile session).I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
modelsUnknownis a new optional field. An older client ignores it. A new client on an older host never receives it, so that pairing keeps the old behaviour until the host updates.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)