(Identified on macOS with M4 chip, in Claude Code v2.1.168)
Working in both Claude Code and Codex, the search_mode field returned by calls of the semantic_search_nodes MCP tool is misleading. It's set to "hybrid" when results are non-empty and "keyword" when results are zero, regardless of which search path actually executed.
Especially concerning is the fact that this leads to "status: ok" being handed to AI agents even when empty results are caused by bugs or the user's own system issues (e.g. Numpy not available -> RuntimeError in _embedding_search).
This is not only confusing to the user but also gives AI agents poor context and sometimes leads to multiple attempts searching with similar queries.
Source (tools/query.py):
search_mode = "hybrid"
if not results:
search_mode = "keyword"
Direct Results:
- A query that matched via FTS5 only (embeddings unavailable or failed) reports "hybrid"
- A query where embeddings silently failed and returned nothing reports "keyword" but "keyword" here means "zero results", not "keyword search ran"
(Identified on macOS with M4 chip, in Claude Code v2.1.168)
Working in both Claude Code and Codex, the search_mode field returned by calls of the semantic_search_nodes MCP tool is misleading. It's set to "hybrid" when results are non-empty and "keyword" when results are zero, regardless of which search path actually executed.
Especially concerning is the fact that this leads to "status: ok" being handed to AI agents even when empty results are caused by bugs or the user's own system issues (e.g. Numpy not available -> RuntimeError in _embedding_search).
This is not only confusing to the user but also gives AI agents poor context and sometimes leads to multiple attempts searching with similar queries.
Source (tools/query.py):
Direct Results: