Skip to content

fix(ctx_search): label the BM25 fallback when the dense index is missing - #1261

Merged
yvgude merged 2 commits into
yvgude:mainfrom
andig:fix/1259-semantic-fallback-label
Jul 27, 2026
Merged

fix(ctx_search): label the BM25 fallback when the dense index is missing#1261
yvgude merged 2 commits into
yvgude:mainfrom
andig:fix/1259-semantic-fallback-label

Conversation

@andig

@andig andig commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #1259

action=semantic (no mode) and ctx_compose resolve to BM25 ranking, but reported it as Semantic search (BM25). A calling agent reads that as "semantic search ran", not "semantic search was unavailable". mode=dense already fails fast with an actionable build hint; the default path did not.

Change

When no mode was requested and embeddings.bin is absent (dense enabled in config, never built), the header names the degradation and the one command that fixes it:

Lexical search (BM25 — dense index not built, run: lean-ctx index build-semantic): "query" (6 results from 18556 indexed chunks)

Compact/TDD header gets semantic_search(bm25,dense-not-built,K).

The BM25 fallback itself stays — it beats erroring out. Only the label was wrong.

Test

dense_availability_tests::missing_embeddings_bin_is_reported_as_degraded

🤖 Generated with Claude Code

andig and others added 2 commits July 25, 2026 12:57
action=semantic (no mode) and ctx_compose resolve to BM25 ranking, but
reported it as "Semantic search (BM25)" — a calling agent reads that as
"semantic search ran", not "semantic search was unavailable". mode=dense
already fails fast with an actionable build hint; the default path did not.

When no mode was requested and embeddings.bin is absent (dense enabled but
never built), the header now names the degradation and the fix:

  Lexical search (BM25 — dense index not built, run: lean-ctx index build-semantic)

Explicit mode=bm25 is unchanged — that is not a degradation. The check is a
file-existence test, no embedding-engine load on the search path.

Fixes yvgude#1259

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@yvgude
yvgude merged commit e9c22dc into yvgude:main Jul 27, 2026
25 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ctx_search action=semantic and ctx_compose degrade to BM25 silently when the dense index is missing

2 participants