Skip to content

fix: skip embedding models when auto-detecting Ollama provider - #1

Merged
MarceloAdan73 merged 1 commit into
mainfrom
fix/ollama-embedding-detection
Aug 1, 2026
Merged

fix: skip embedding models when auto-detecting Ollama provider#1
MarceloAdan73 merged 1 commit into
mainfrom
fix/ollama-embedding-detection

Conversation

@MarceloAdan73

Copy link
Copy Markdown
Owner

What

Fixes the Ollama provider auto-detection so it no longer picks embedding-only models (e.g. nomic-embed-text), which fail at runtime with "does not support chat".

Why

On a machine where Ollama is installed with an embedding model as the first installed model, detectProvider() selected ollamaModels[0] blindly. The CLI then errored on every file with a confusing 400 does not support chat, retried 3 times and crashed with a Node assertion on Windows. This is the first-run experience for new users, so it had to be fixed before any public launch.

Changes

  • Added pickOllamaChatModel() in providerDetector.ts (all 5 agents) that filters out embedding/image models (embed, nomic, minilm, mxbai, bge-, gte-, e5-, clip) and returns the first chat-capable model.
  • When only embedding models are installed, detection now returns null, so the CLI prints the friendly "Set up one of these options" instructions instead of failing cryptically.
  • Added unit + integration tests covering: skip-embedding selection, null when only embeddings, and first-non-embedding fallback.

Verification

  • npm test — 123 tests pass (10 files)
  • npm run typecheck — clean
  • End-to-end against a real Ollama with nomic-embed-text:latest, qwen2.5-coder:1.5b, qwen2.5-coder:7b: now detects qwen2.5-coder:1.5b and generates docs successfully

@MarceloAdan73
MarceloAdan73 merged commit 3d5f458 into main Aug 1, 2026
17 checks passed
@MarceloAdan73
MarceloAdan73 deleted the fix/ollama-embedding-detection branch August 1, 2026 03:21
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