fix: skip embedding models when auto-detecting Ollama provider - #1
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()selectedollamaModels[0]blindly. The CLI then errored on every file with a confusing400 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
pickOllamaChatModel()inproviderDetector.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.null, so the CLI prints the friendly "Set up one of these options" instructions instead of failing cryptically.Verification
npm test— 123 tests pass (10 files)npm run typecheck— cleannomic-embed-text:latest,qwen2.5-coder:1.5b,qwen2.5-coder:7b: now detectsqwen2.5-coder:1.5band generates docs successfully