fix(mcp): report keyword-only and unreranked search results
When semantic search fails or is skipped (embedding endpoint down, expired key, model/prefix/dimension mismatch), search falls back to BM25-only results; when the reranker fails it returns unreranked results. The CLI warns on stderr, but search_code discarded the timings, so MCP agents got degraded results with no signal.
SearchTimingsandHybridTimingsgainsemantic_fallback: Option<String>, set on every BM25-only fallback path inSearchContext::searchand when the vector arm errors. BM25-only by request (SearchContext::bm25_only()) staysNone.search_codemerges timings across queries and addswarning: semantic search unavailable (...)andwarning: reranker unavailable (...)ahead of the stale-index warning in the existing notice block. Multi-query wording says "at least one query".- CLI output is unchanged (default JSON is still a bare array; the
reranker unavailablestderr line stays). - Docs: mcp.md, troubleshooting.md (new "Keyword-only results" section), whats-new.md (v2.1.1 entry, also covering #296).
Checked end to end: vera mcp against an index built with a different model now returns the notice block naming the mismatch.
Summary by cubic
MCP search_code results now say when they are degraded, so agents can tell keyword-only or unreranked results from a full hybrid search.
When vector search failed or was skipped (embedding endpoint down, expired key, model/prefix/dimension mismatch), search fell back to BM25-only results, and reranker failures returned unreranked results. The CLI warned on stderr, but search_code discarded the timings, so MCP agents saw no signal.
SearchTimingsandHybridTimingsnow carrysemantic_fallback: Option<String>, set on every BM25-only fallback path but not when BM25-only was requested.search_codemerges timings across queries and prependswarning: semantic search unavailable (...)orwarning: reranker unavailable (...)to the existing stale-index notice block; in multi-query searches the wording notes that at least one query was degraded rather than implying all results were.- CLI output is unchanged; docs add a "Keyword-only results" troubleshooting section.
retrieval.rrf_know applies to ordinary search as well as multi-query merging, with the default unchanged.
Summary by CodeRabbit
- New Features
- Search results now indicate when semantic search falls back to keyword-only results or reranking is unavailable. Multi-query searches clarify when a fallback affected at least one query.
- The
retrieval.rrf_ksetting now applies to standard searches as well as multi-query result merging.
- Documentation
- Added guidance on interpreting search warnings and troubleshooting keyword-only results.