Skip to content

fix(index): pass index_provider to apply_code_rag_retriever#3240

Merged
bug-ops merged 1 commit intomainfrom
3239-code-rag-index-provider
Apr 19, 2026
Merged

fix(index): pass index_provider to apply_code_rag_retriever#3240
bug-ops merged 1 commit intomainfrom
3239-code-rag-index-provider

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 19, 2026

Summary

  • apply_code_rag_retriever in src/runner.rs was receiving provider.clone() (main chat provider) instead of index_provider (the dedicated embed provider from config.index.embed_provider)
  • When the two providers use different embedding dimensions (e.g., OpenAI 1536 vs nomic-embed-text 768), every code RAG retrieval attempt failed with a Qdrant dimension mismatch, silently falling back to no code context injection
  • Fix: clone index_provider before passing it to apply_code_indexer, then pass index_provider.clone() to apply_code_rag_retriever — both now share the same embed provider, consistent with how the index collection was populated

Test plan

  • cargo build succeeds
  • cargo +nightly fmt --check passes
  • cargo clippy --workspace -- -D warnings passes
  • 294 unit tests pass (cargo nextest run -p zeph --bins)
  • Live session test with index.embed_provider = "ollama-embed" and main provider OpenAI — verify no dimension mismatch errors in logs

Closes #3239

apply_code_rag_retriever was receiving provider.clone() (the main chat
provider) instead of index_provider (the dedicated embed provider
resolved from config.index.embed_provider). When the two providers use
different embedding dimensions this caused a Qdrant dimension mismatch
on every code RAG retrieval attempt, silently falling back to no code
context injection.

index_provider is now cloned before apply_code_indexer so both the
indexer and the retriever share the same embed provider — consistent
with how the index collection was originally populated.

Closes #3239
@github-actions github-actions Bot added bug Something isn't working size/XS Extra small PR (1-10 lines) labels Apr 19, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 19, 2026 12:21
@bug-ops bug-ops merged commit 8a7423b into main Apr 19, 2026
32 checks passed
@bug-ops bug-ops deleted the 3239-code-rag-index-provider branch April 19, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/XS Extra small PR (1-10 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(index): apply_code_rag_retriever uses main provider instead of index embed provider

1 participant