fix: add OLLAMA_HOST fallback and graceful degradation on missing model#72
Merged
yvonnedevlinrh merged 1 commit intoJun 18, 2026
Conversation
689c969 to
49f1b00
Compare
gxmiranda
approved these changes
Jun 18, 2026
gxmiranda
left a comment
There was a problem hiding this comment.
Clean, well-scoped bug fix addressing both issues from #61: OLLAMA_HOST env var fallback and graceful degradation when the embedding model is missing.
Highlights:
DefaultOllamaEndpointconstant eliminates 5 hardcoded endpoint strings- Three-tier fallback chain (
DEWEY_EMBEDDING_ENDPOINT>OLLAMA_HOST> default) with scheme normalization - Graceful degradation to keyword-only mode in both
serveandindexpaths - Doctor now uses
ReadEmbeddingConfig()for consistent endpoint reporting - 10 new tests with mock Ollama servers covering precedence, normalization, and degradation paths
- Complete OpenSpec artifacts (proposal, design, spec, tasks)
- AGENTS.md updated with endpoint resolution precedence documentation
[LOW] Synthesis endpoint (llm/config.go) still uses DEWEY_EMBEDDING_ENDPOINT without OLLAMA_HOST fallback — explicitly deferred as out of scope per proposal. Should be tracked as a follow-up issue.
This review was generated by /review-pr (AI-assisted).
Add ecosystem-standard OLLAMA_HOST env var as a fallback when DEWEY_EMBEDDING_ENDPOINT is not set. When Ollama is reachable but the embedding model has not been pulled, Dewey now logs a warning and continues in keyword-only mode instead of hard-exiting. Changes: - Add DefaultOllamaEndpoint constant and ResolveOllamaEndpoint() helper to embed/config.go with three-tier fallback chain - Convert hard exit to graceful degradation in both serve and index paths (main.go initObsidianBackend, cli.go createIndexEmbedder) - Fix dewey doctor to use ReadEmbeddingConfig() for consistent endpoint reporting instead of direct os.Getenv reads - Update llm/config.go and llm/provider.go to use the constant - Comment out endpoint in dewey init template so OLLAMA_HOST works out of the box for new users - Add 10 new tests covering resolver, degradation, and config precedence Fixes: unbound-force#61 Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
49f1b00 to
340a944
Compare
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
Fixes #61 - Dewey does not read the ecosystem-standard OLLAMA_HOST environment variable and hard-exits when the embedding model is missing. Users who configure Ollama via OLLAMA_HOST (which other tools like
uf doctor respect) found that Dewey always connects to localhost:11434. Additionally, when Ollama is reachable but the embedding model hasn't been pulled, dewey serve exits with a fatal error instead of degrading gracefully to keyword-only mode.
Changes
a URL scheme are normalized with http://.
Testing
Change Artifacts
OpenSpec: openspec/changes/ollama-host-fallback/
##Fixes
#61