fix(context): honor retrieval.backend config instead of hardcoding embeddings#102
Merged
plind-junior merged 1 commit intoMay 27, 2026
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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
context._retrievenow readsretrieval.backendfromconfig.yamland dispatches accordingly, instead of always running embeddings first regardless of config (bug:_retrieveignoresretrieval.backendsconfig and hardcodes embeddings-primary #92).embeddingas a recognized backend;vouch initwritesretrieval.backend: auto; README/ROADMAP/CHANGELOG updated to match real behavior.Root Cause
src/vouch/context.py:32calledindex_db.search_semantic(embedding) unconditionally before FTS5/substring, ignoring config entirely. Meanwhilevouch initwroteretrieval.backends: ["fts5", "substring"]— a list that didn't even contain"embedding"and was never read. So the config knob was decorative and the README/ROADMAP claim ("Default stays FTS5; embeddings opt-in") was wrong.Fix
_configured_backend(store)readsretrieval.backend(auto|embedding|fts5|substring, defaultauto), with back-compat for a legacyretrieval.backendslist (first recognized entry wins)._retrievedispatches:auto= embedding → FTS5 → substring (degrades to FTS5 when embeddings extras aren't installed);embedding/fts5/substringpin a single path. Mirrorskb_searchbackend semantics; preserves the existingsqlite3.Errorfallback._starter_confignow writesretrieval.backend: auto.Test Plan
tests/test_retrieval_backend.py(5 tests, env-independent — monkeypatchessearch_semanticso no numpy/sentence-transformers needed)test_backend_fts5_skips_embeddingandtest_backend_substring_onlyfail on the parent commit, pass with the fixtest_crystallize_cli_partial_failures_shows_warning) that also fails on cleanupstream/test(environment-sensitive_whoami())Closes #92