fix: only call ensureOllamaReady() when using Ollama embedding provider#8
Closed
pineapplestrikesback wants to merge 1 commit intogiancarloerra:mainfrom
Closed
Conversation
The codebase_search handler unconditionally called ensureOllamaReady() regardless of the configured EMBEDDING_PROVIDER. This caused search to fail for OpenAI and Google embedding users because: - OLLAMA_MODE=auto/docker: creates an Ollama Docker container and tries to pull the configured model (e.g. text-embedding-3-large) from Ollama's registry, which fails since it's an OpenAI model - OLLAMA_MODE=external: tries to reach localhost:11434, fails with "Ollama is not reachable" Now ensureOllamaReady() is only called when embeddingProvider === "ollama". For other providers, getEmbeddingProvider() is called to ensure the provider singleton is initialized. Fixes giancarloerra#7
giancarloerra
pushed a commit
that referenced
this pull request
Mar 17, 2026
ensureOllamaReady() was called unconditionally on every search and context operation, causing failures for OpenAI and Google embedding users. Now only called when embeddingProvider is ollama; otherwise the configured provider is initialized via getEmbeddingProvider(). Fixes #7 Co-authored-by: pineapplestrikesback <pineapplestrikesback@users.noreply.github.com>
Owner
|
Merged via squash to main with additional changes:
Issue #7 is auto-closed via the commit message. Thank you for the contribution pineapplestrikesback, well spotted, and much appreciated! |
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.
Summary
codebase_searchfailing for OpenAI and Google embedding usersensureOllamaReady()was called unconditionally on every search, regardless ofEMBEDDING_PROVIDERembeddingProvider === "ollama"; otherwise initializes the configured provider viagetEmbeddingProvider()Fixes #7
Test plan
codebase_searchworks withEMBEDDING_PROVIDER=openaiwithout Ollama installedcodebase_searchstill works withEMBEDDING_PROVIDER=ollama(no regression)