fix(mcp): honesty signals for zero-exact search and filename-only get_symbol#770
Conversation
…_symbol search_codebase on an identifier query now reports exact_match (true/false) with a note when no indexed symbol matches exactly, so the agent does not anchor on a fuzzy neighbour that merely ranks first. get_symbol resolves a filename-only or partial-path id (answer.py::get_answer) via a suffix rung on the file path, mirroring get_context's basename ladder, and returns path-qualified suggestions on a total miss instead of a bare not-found.
|
✅ Health: 7.7 (unchanged) 📋 At a glance Files & modules (2)
🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)
🔎 More signals (2)🔥 Hotspots touched (4)
1 more
🔗 Hidden coupling (2 files)
📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-11 02:42 UTC |
What
Two MCP tool-surface fixes so an agent gets an honest signal instead of a confident-but-wrong answer it will read around.
search_codebase exact-match signal
An identifier-shaped query that matches no symbol exactly used to return fuzzy neighbours with nothing to distinguish them from a real hit. It now carries
exact_match: true|false, plus a shortnotewhen there is no exact match, so the agent does not anchor on whatever ranked first. The score cliff already existed internally; this surfaces it.get_symbol filename-only resolution
get_symbol("answer.py::get_answer")(a bare filename or partial path rather than the full indexed path) dead-ended on "not found". It now resolves via a suffix rung on the file path, matching any file whose path ends with that segment on the leaf name, mirroring get_context's basename ladder. A total miss returnssuggestions(real path-qualified ids) the caller can retry with.Tests
TestExactMatchSignal(exact/fuzzy/mode routing) in test_search.py.