Skip to content

feat: Ollama Cloud model-picker dropdown in settings (+ backend validation scripts)#166

Open
ankitvgupta wants to merge 6 commits into
mainfrom
ankitvgupta/test-minimax-ollama-backends
Open

feat: Ollama Cloud model-picker dropdown in settings (+ backend validation scripts)#166
ankitvgupta wants to merge 6 commits into
mainfrom
ankitvgupta/test-minimax-ollama-backends

Conversation

@ankitvgupta

@ankitvgupta ankitvgupta commented Jun 1, 2026

Copy link
Copy Markdown
Owner

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.tsCOMMON_OLLAMA_MODELS curated list (verified-live :cloud ids), kept in sync with DEFAULT_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 .env loader 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_MODEL so 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 list
  • ollama-dropdown-custom.png — "Custom…" reveals a free-text field
  • ollama-perfeature-dropdown.png — General → feature routing renders the same dropdown

Test plan

  • npm run typecheck ✅ · eslint ✅ · prettier --check ✅ · npm run test:unit1425 passed
  • npm run pre-pr (full): PASS — evals 80/80, agentic-verify clean, real-gmail 5/5
  • Live-verified both dropdown locations: default = GLM 5.2, 7 options + Custom, escape hatch reveals/persists a text id, and typing/selecting a known id collapses back to the dropdown
  • Candidate models validated E2E through both harnesses (tool-calling + streaming + completion) via the included scripts

Notes

  • The Security Audit CI check is red on a pre-existing, repo-wide issue (npm audit --omit=dev --audit-level=high flags transitive prod deps hono + protobufjs; main's own latest CI fails the same check). This PR changes no dependencies — out of scope here; best fixed on main.

Pre-PR verdict: PASS

  • mode: full
  • sha: 7660486
  • generated: 2026-06-16T23:10:47.968Z
Phase Status Duration
eval:analyzer ✅ exit 0 14.5s
eval:features ✅ exit 0 64.1s
agentic-verify ✅ exit 0 133.0s
real-gmail:cached ✅ exit 0 8.5s

Ankit Gupta and others added 2 commits June 1, 2026 18:21
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>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@greptile-apps

greptile-apps Bot commented Jun 1, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces free-text Ollama model id inputs in both Settings locations with a curated dropdown (OllamaModelSelect) backed by a new COMMON_OLLAMA_MODELS list, while preserving a "Custom…" escape hatch for unlisted ids. It also adds four validation/benchmark scripts for minimax-m3 and extracts the shared loadEnv helper into scripts/lib/load-env.mjs.

  • UI: OllamaModelSelect handles the known/custom-mode toggle cleanly, including a useEffect that drops custom mode when an external settings reload resets the value to a curated model id.
  • Scripts: All four scripts now import loadEnv from the shared library instead of duplicating the logic; the search_emails fixture in agentic-minimax.mjs was updated to filter by query terms rather than always returning all entries.
  • Types: COMMON_OLLAMA_MODELS comment is internally consistent with DEFAULT_OLLAMA_MODEL = "glm-5.2:cloud"; the only stale reference is the JSDoc inside OllamaModelSelect.tsx which still says "defaulting to Kimi".

Confidence Score: 5/5

Safe 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.

Important Files Changed

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]
Loading
%%{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]
Loading

Reviews (4): Last reviewed commit: "feat: default Ollama dropdown to GLM 5.2..." | Re-trigger Greptile

Comment thread src/renderer/components/OllamaModelSelect.tsx
Comment thread scripts/agentic-minimax.mjs
Comment thread scripts/agentic-minimax.mjs Outdated
@ankitvgupta

ankitvgupta commented Jun 1, 2026

Copy link
Copy Markdown
Owner Author

✅ Pre-PR verification — PASS

  • mode: full
  • sha: 7660486
  • generated: 2026-06-16T23:10:47Z
Phase Status Duration
eval:analyzer ✅ exit 0 (80/80) 14.5s
eval:features ✅ exit 0 64.1s
agentic-verify ✅ exit 0 133.0s
real-gmail:cached ✅ exit 0 8.5s
Agentic verification — summary

The primary user-visible change is the OllamaModelSelect component that replaces the plain text field with a curated model dropdown when "Ollama Cloud" is selected as a provider. Verified end-to-end against the post-merge state:

  • The dropdown defaults to "GLM 5.2 — z.ai (default)" (glm-5.2:cloud, the current DEFAULT_OLLAMA_MODEL) — captured DOM: currentValue: "glm-5.2:cloud", selected: true.
  • All 7 curated models are present, including minimax-m3:cloud and minimax-m2.7:cloud.
  • Selecting "Custom…" reveals a text input pre-populated with the current model id; selecting a known model again hides the text input.
  • Extensions tab renders correctly. No JS errors observed.

ℹ️ Correction: an earlier revision of this comment (commit dab2f1e, pre-merge) reported "Kimi K2.6 selected by default". That reflected the default before merging main#175 made GLM 5.2 the default DEFAULT_OLLAMA_MODEL. This verification reflects the current 7660486 state (GLM 5.2 default). The earlier comment couldn't be auto-updated because an invalid GH_TOKEN shadowed the gh keyring auth during that pre-pr run.

Ankit Gupta and others added 4 commits June 1, 2026 18:33
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>
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>
@ankitvgupta

Copy link
Copy Markdown
Owner Author

Update: merged main, default Ollama model → GLM 5.2

CI note — Security Audit (pre-existing, not from this PR)

The Security Audit job is red on npm audit --omit=dev --audit-level=high for two transitive production deps — hono and protobufjs — whose advisories were published recently. This PR changes no dependencies (no package.json / package-lock.json diff), and main's own latest CI is failing the same check. This is a repo-wide fix best done on main (a focused npm audit fix) rather than bundled into this UI change. Flagging so it isn't mistaken for a regression here.

@ankitvgupta ankitvgupta changed the title feat: Ollama Cloud model picker dropdown + minimax-m3 backend validation feat: Ollama Cloud model-picker dropdown in settings (+ backend validation scripts) Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant