Repository navigation
refactor: unify model selection with the TUI - #387
chriswritescode-dev merged 1 commit into
Conversation
Align the manager's model selection with the OpenCode TUI: one model.json-backed preference store, one provider catalog, one ordering and default-ownership rule, and one set of availability, ref-formatting and variant helpers shared across chat, schedules, agents and the goal auditor. - Add a shared TUI-compatible model-preference module and make the backend model.json store match its format. - Consolidate the frontend provider catalog, availability check, model ref formatter and variant persistence into single owners. - Drive chat, schedule, agent and goal-auditor model lists from a shared useModelSections hook and buildModelSections, following TUI ordering. - Extract a shared ModelCombobox with a taller list, and list models the TUI way in ModelQuickSelect. - Add a shared isRecord util and model-selection comparison helpers.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (82)
💤 Files with no reviewable changes (4)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change centralizes model preferences and reference handling in shared OpenCode utilities. It updates backend model-state routes, replaces the provider catalog shape, adds session-aware model selection, and integrates the catalog and selection controls into model pickers, settings, schedules, and prompt submission. ChangesModel preferences and catalog
Priority: ➖ Normal Estimated code review effort: 5 (Critical) | ~120 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant PromptInput
participant useModelSelection
participant modelStore
participant useSendPrompt
participant useOpenCode
PromptInput->>useModelSelection: passes session and active agent
useModelSelection->>modelStore: reads session and new-session picks
modelStore-->>useModelSelection: returns stored picks
useModelSelection-->>PromptInput: returns resolved model reference
PromptInput->>useSendPrompt: submits the selected model
useSendPrompt->>useOpenCode: synchronizes agent and model
Merge Risk: ⚪ Minimal · up to This refactor unifies model selection across chat, schedules, agents, and the goal auditor. No concrete defect was established in the changed code, and the change appears ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❓ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 62 functions across 50 files. (28 skipped: 28 over the file limit.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Summary
Aligns the manager's model selection with the OpenCode TUI so every surface - chat, schedules, agents, and the goal auditor - reads and writes the same model preferences.
model.jsonstore now matches the TUI format and owns the effective default and variants.Provider), one availability check, one model-ref formatter, and one variant-persistence path replace the previous per-surface implementations.useModelSectionshook andbuildModelSectionsdrive the model lists in chat, schedules, agents, and the goal auditor with TUI ordering; the chatModelQuickSelectlists models the TUI way.ModelCombobox(taller list) is used by schedules and the agent editor.isRecordutil and model-selection comparison helpers.Type of Change
Checklist
pnpm lintpasses locallypnpm typecheckpasses locallypnpm typecheckpasses for cli, frontend and backend.pnpm lintreports 0 errors (41 pre-existingno-explicit-anywarnings, plus one pre-existingexhaustive-depswarning inChangesWalkthroughDialog). Focused suites pass: backendproviders,opencode-model-state,opencode-model-preference,opencode-model-ref(92 tests) and frontend model/combobox/providers/schedules/agent/session suites (359 tests).Summary by CodeRabbit