fix(context): apply rerank on embedding and fts5 backends too - #594
Conversation
retrieval.rerank is global config, but _retrieve only ran the rerank
stage on the auto/hybrid branch. an operator who pinned
retrieval.backend to embedding or fts5 and set
retrieval.rerank.enabled: true got no reranking at all, silently — the
setting reads as active in config.yaml and does nothing.
the embedding branch already carries the comment for exactly this class
of bug ("parity with the hybrid path: an operator who opted into recency
gets it regardless of which backend serves the query"); rerank was
missed when that parity was established. same stage, same order —
recency, pages-first, then rerank — on both single-retriever branches.
the substring fall-through is left alone: it is the last-resort scan
after both retrievers came back empty, and it applies none of the three
stages today.
covered by a parametrized regression over both backends; it fails on the
previous code with the unreranked order.
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
retrieval.rerankis global config, but_retrieveonly runs the rerank stage on theauto/hybridbranch. an operator who pinsretrieval.backendtoembeddingorfts5and setsretrieval.rerank.enabled: truegets no reranking at all — silently. the setting reads as active inconfig.yamland does nothing.why this looks like an oversight rather than a decision
the embedding branch already carries the comment for exactly this class of bug:
recency was given parity across branches; rerank was missed at the same seam. nothing in
_configured_rerankscopes the setting to a backend — it readsretrieval.rerankand returns(enabled, top_k)for any caller.the change
same stage in the same order — recency, pages-first, then rerank — on both single-retriever branches.
the substring fall-through is deliberately left alone: it is the last-resort scan after both retrievers came back empty, and it applies none of the three stages today. widening that is a separate decision.
tests
test_context_rerank_applies_on_single_retriever_backends, parametrized overembeddingandfts5. it fails on the previous code with the unreranked order:verification