Skip to content

fix: /answer judge saw empty excerpts when no reranker is configured#31

Open
andreimarinescu wants to merge 1 commit into
mainfrom
fix/judge-empty-excerpt
Open

fix: /answer judge saw empty excerpts when no reranker is configured#31
andreimarinescu wants to merge 1 commit into
mainfrom
fix/judge-empty-excerpt

Conversation

@andreimarinescu

Copy link
Copy Markdown
Collaborator

Problem

/answer's LLM relevance judge uses c.rerankText as the candidate excerpt, but that field is only populated when a reranker runs. With rerank disabled, every candidate is judged against an empty string, scored irrelevant, and dropped — /answer always returns "none were judged relevant" even when retrieval found good candidates.

Found on a local dev instance running without a reranker configured; deployments with a reranker never hit this, which is why it went unnoticed.

Fix

Extract the excerpt choice into judgeExcerpt(): use rerankText when present, otherwise fall back to title + "\n" + retrieval excerpt (the same text the synth prompt already uses). Regression test covers both paths.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

rerankText is only populated when a reranker runs. The /answer judge
used it as the candidate excerpt unconditionally, so with rerank
disabled every candidate was scored against an empty string and
dropped — /answer always returned 'none were judged relevant'.

Fall back to title + retrieval excerpt when rerankText is empty.
@andreimarinescu andreimarinescu force-pushed the fix/judge-empty-excerpt branch from 53d5c46 to 9116f27 Compare July 14, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant