Skip to content

Fix registered local models missing from the chat picker - #40

Merged
XYAIStudio merged 2 commits into
mainfrom
cursor/fix-local-models-chat-picker-f4cd
Sep 17, 2026
Merged

XYAIStudio merged 2 commits into
mainfrom
cursor/fix-local-models-chat-picker-f4cd

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Root cause

Model-page register (Ollama tag / GGUF) could succeed while the conversation picker still could not list or invoke those models.

Three separate gaps stacked:

  1. Resolved/usable filters required a real API key and base URL. LocalServiceCard and empty-key Ollama rows were dropped from GET /providers/resolved and ProviderStore.is_model_ref_usable, so the picker never showed them (or send rejected the ref).
  2. Two create paths. Recommended install wrote a provider named ollama (kind=ollama) without enabling it; GGUF register wrote Ollama (Local). LocalServiceCard created a third row with all models disabled and enabled=false. Chat never saw a usable local catalog.
  3. Frontend did not refresh. Chat loaded models only on mount/focus. After register, the recommended-install path also called the dead /models API (404), so the UI treated a successful backend register as “need provider”.

PR #30 only fixed Windows register 500s. This change wires register → catalog → picker → harness 127.0.0.1:11434.

What changed

  • upsert_ollama_model is the single write path: enable the Ollama row, fill api_key=ollama + http://127.0.0.1:11434/v1, mark the model enabled, set ollama_service_enabled.
  • list_resolved_models / ProviderStore fill those defaults so local refs are listed, usable, and built into harness configs. ollama/<tag> aliases resolve to the existing local row.
  • Chat listens for octop:models-changed after Models-page register/install.
  • If Ollama is down, stream errors classify as stream_errors.local_runtime (zh+en) with a link to /models, not a silent no-op.

How to verify

  • Register an already-pulled Ollama tag or a GGUF from Models. Open 对话区: the tag appears and can be selected.
  • Send a message: request goes to local Ollama (11434). If the daemon is stopped, the UI shows the start-Ollama guidance.
  • Cloud providers still list and send as before.

Local verification

  • uv run ruff check src tests — passed
  • uv run pytest tests/unit — 2953 passed, 4 skipped
  • npx vitest run on chatStreamError / presetUtils / LocalHardwarePanel / ChatInputActionsRow — 17 passed
  • mypy --strict on touched provider modules — clean
  • npx tsc --noEmit — clean

Checklist

  • Root cause stated
  • zh+en copy for new stream error
  • CHANGELOG updated
  • CI green
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 17, 2026 05:14
Registration now upserts the shared Ollama provider with usable defaults,
turns the local service flag on, and notifies the conversation picker so
desktop GGUF/Ollama tags can be selected and routed to 11434. Unreachable
Ollama shows an actionable error instead of a silent no-op.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 17, 2026 05:20
@XYAIStudio
XYAIStudio merged commit df484f1 into main Sep 17, 2026
5 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/fix-local-models-chat-picker-f4cd branch September 17, 2026 05:51
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.

2 participants