feat: Ollama Cloud model-picker dropdown in settings (+ backend validation scripts)#166
feat: Ollama Cloud model-picker dropdown in settings (+ backend validation scripts)#166ankitvgupta wants to merge 6 commits into
Conversation
Validate the new minimax-m3:cloud model end-to-end through both agent harnesses and characterize its quality/speed on Ollama Cloud: - test-minimax-claude-sdk.mjs Claude Agent SDK + Ollama routing smoke (tool call) - test-minimax-opencode.mjs OpenCode + Ollama routing smoke (tool call) - bench-minimax.mjs single-shot quality + TTFT/throughput, both transports - agentic-minimax.mjs multi-step tool-chaining + cross-model speed comparison Each mirrors the exact routing the providers build (env remap for the Claude SDK path; ollama-cloud provider registration for OpenCode). Not wired into CI — they require OLLAMA_API_KEY and hit real Ollama Cloud. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Switching open-source models required hand-typing model ids in two places. Replace both free-text inputs — Extensions → Ollama Cloud "Default Model", and the per-feature override in General → feature routing — with a curated dropdown of common Ollama Cloud models, defaulting to Kimi K2.6. A "Custom…" option reveals a text field for any other model id, so new models (e.g. minimax-m3) stay reachable without maintaining an allowlist. When a saved value isn't in the curated list, the field opens in custom mode showing what's stored, so existing hand-typed configs don't break. - COMMON_OLLAMA_MODELS curated list in shared/types.ts (verified-live :cloud ids) - reusable OllamaModelSelect component (dropdown + custom escape hatch) - wired into ExtensionsTab (default model) and SettingsPanel (per-feature) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR replaces free-text Ollama model id inputs in both Settings locations with a curated dropdown (
Confidence Score: 5/5Safe to merge — the UI changes are additive and both callsites supply non-empty defaults, so the new dropdown has no empty-value edge cases in production. The scripts are not in CI and require a key to run. The component logic is correct, the shared loadEnv extraction is straightforward, and both callsites guard against empty values. The only finding is a stale JSDoc comment ("defaulting to Kimi") that contradicts the actual first entry in COMMON_OLLAMA_MODELS (GLM 5.2), which has no runtime impact. No files require special attention. The stale comment is in OllamaModelSelect.tsx but does not affect behavior.
|
| Filename | Overview |
|---|---|
| src/shared/types.ts | Adds COMMON_OLLAMA_MODELS curated list (7 models); DEFAULT_OLLAMA_MODEL stays glm-5.2:cloud and is correctly kept as the first entry. Types and doc comment are consistent. |
| src/renderer/components/OllamaModelSelect.tsx | New dropdown + custom-mode escape-hatch component. Logic is sound; useEffect correctly resets custom state when value externally becomes a known model. JSDoc "defaulting to Kimi" is stale — actual first/default is GLM 5.2. |
| src/renderer/components/ExtensionsTab.tsx | Swaps bare text input for OllamaModelSelect in the Ollama Cloud Default Model field; initializes with DEFAULT_OLLAMA_MODEL so value is never empty. |
| src/renderer/components/SettingsPanel.tsx | Replaces bare text input with OllamaModelSelect for per-feature Ollama model override; falls back to DEFAULT_OLLAMA_MODEL when no saved value, so value is always non-empty. |
| scripts/lib/load-env.mjs | New shared .env loader extracted from the four benchmark scripts. Parses KEY=VALUE lines, strips outer double-quotes, respects existing env vars. Single-quoted values are not stripped but this is an intentional scope limitation. |
| scripts/agentic-minimax.mjs | Multi-step agentic test across both harnesses and 3 models. Fixture search_emails now correctly filters by query terms. Not part of CI; requires OLLAMA_API_KEY. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User opens Settings / Extensions] --> B{Saved value\nin COMMON_OLLAMA_MODELS?}
B -- Yes --> C[Select shows curated option]
B -- No + non-empty --> D[inCustomMode = true\nSelect shows Custom…\nText input revealed]
C --> E{User picks Custom…}
E -- Yes --> D
D --> F{External settings reload\nresets value to known id?}
F -- Yes --> G[useEffect fires\ncustom = false\nDropdown resumes]
F -- No --> D
C --> H{User picks different\ncurated model}
H --> I[onChange fires with new id\nParent state updated]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[User opens Settings / Extensions] --> B{Saved value\nin COMMON_OLLAMA_MODELS?}
B -- Yes --> C[Select shows curated option]
B -- No + non-empty --> D[inCustomMode = true\nSelect shows Custom…\nText input revealed]
C --> E{User picks Custom…}
E -- Yes --> D
D --> F{External settings reload\nresets value to known id?}
F -- Yes --> G[useEffect fires\ncustom = false\nDropdown resumes]
F -- No --> D
C --> H{User picks different\ncurated model}
H --> I[onChange fires with new id\nParent state updated]
Reviews (4): Last reviewed commit: "feat: default Ollama dropdown to GLM 5.2..." | Re-trigger Greptile
✅ Pre-PR verification — PASS
Agentic verification — summaryThe primary user-visible change is the
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- OllamaModelSelect: clear custom mode when value is externally reset to a curated model id, via an effect on [value]. Previously the sticky custom flag could leave the select showing "Custom…" with a curated id in the text box. Verified live: typing/selecting a known id now collapses to the dropdown. - agentic-minimax search_emails: make the fixture genuinely query-driven (match query terms against subject/sender) instead of a hardcoded "acme" branch that ignored the query. - extract the duplicated loadEnv helper into scripts/lib/load-env.mjs and import it from all four minimax scripts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…max-ollama-backends
Following the merge of #175 (GLM 5.2 as DEFAULT_OLLAMA_MODEL), update the curated dropdown list to match: GLM 5.2 is now the default-first entry, the "(default)" label moves off Kimi, and glm-5.2:cloud is added so the active default actually renders as a dropdown option (it was absent, which would have forced the field into "Custom…" mode). MiniMax M3 / M2.7 remain in the picker. Dropped the now-superseded glm-4.6 entry. Verified live: the Default Model field selects "GLM 5.2 — z.ai (default)" and MiniMax remains selectable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update: merged
|
Summary
Switching the open-source (Ollama Cloud) model used to require hand-typing model ids into free-text boxes in Settings. This PR replaces those inputs with a curated dropdown of common Ollama Cloud models, defaulting to GLM 5.2 (the current
DEFAULT_OLLAMA_MODEL), with a "Custom…" escape hatch for any other id. The same picker is used in both places that take an Ollama model.It also adds the backend validation/benchmark scripts that were used to evaluate candidate models (GLM, MiniMax, Kimi) end-to-end through both agent harnesses.
Changes
Feature (UX):
shared/types.ts—COMMON_OLLAMA_MODELScurated list (verified-live:cloudids), kept in sync withDEFAULT_OLLAMA_MODEL. GLM 5.2 is the default-first entry; MiniMax M3 / M2.7, Kimi K2.6 / K2-Thinking, Qwen3 Coder, DeepSeek are also selectable.OllamaModelSelect.tsx— reusable dropdown + custom-id escape hatch. Falls back to custom mode when the stored value isn't curated (so pre-existing hand-typed configs don't break), and drops back to the dropdown when the value is reset to a curated id.ExtensionsTab.tsx— Ollama Cloud "Default Model" → dropdown.SettingsPanel.tsx— per-feature Ollama model override → dropdown.Scripts (local only; require
OLLAMA_API_KEY, not in CI):scripts/test-minimax-claude-sdk.mjs/test-minimax-opencode.mjs— routing smoke tests (tool-calling) for the Claude Agent SDK + OpenCode harnesses over Ollama Cloud.scripts/bench-minimax.mjs— single-shot quality + TTFT/throughput across both transports.scripts/agentic-minimax.mjs— multi-step tool-chaining + cross-model speed comparison.scripts/lib/load-env.mjs— shared.envloader for the above.Why a curated list + custom hatch
The list is a convenience, not an allowlist — new models ship on Ollama Cloud constantly, so "Custom…" keeps any id reachable. The default-first entry tracks
DEFAULT_OLLAMA_MODELso the active default always renders as a real option rather than dropping into custom mode.Screenshots
Verified live via CDP in demo mode (local copies in
.context/):ollama-dropdown-glm-default.png— Default Model = "GLM 5.2 — z.ai (default)", MiniMax still in the listollama-dropdown-custom.png— "Custom…" reveals a free-text fieldollama-perfeature-dropdown.png— General → feature routing renders the same dropdownTest plan
npm run typecheck✅ ·eslint✅ ·prettier --check✅ ·npm run test:unit→ 1425 passed ✅npm run pre-pr(full): PASS — evals 80/80, agentic-verify clean, real-gmail 5/5Notes
Security AuditCI check is red on a pre-existing, repo-wide issue (npm audit --omit=dev --audit-level=highflags transitive prod depshono+protobufjs;main's own latest CI fails the same check). This PR changes no dependencies — out of scope here; best fixed onmain.Pre-PR verdict: PASS
full7660486