Repository navigation
fix(diagnose): respect the repo filter and rank candidates from the matched route - #132
Merged
Merged
Conversation
…atched route Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
diagnose_issuedid not obey therepoargument in all result sections.matched_routes[].external_callersshowed callers from all repos. A call withrepo: "hub-prefix"returned callers fromassistant-hub.repo.The semantic candidates were also noise. For an exception message with a matched route (
POST /api/v2/Tools/{id}/publish), the candidates wereSystemToolId, a Pythonmain, and other unrelated symbols. The tool did not show the route handler or the code that the handler calls.Fix
match_routes_and_callersfiltersapi_client_callsbyrepowhenrepois set. Withoutrepo, cross-repo callers stay._find_matching_indexed_filedoes not fall back to other repos whenrepois set.app/services/diagnostic_route_path.py:collect_route_path_symbolsgets the matched route handlers and their callees fromtrace_symbol_path(callees, depth 3). It keeps only calls that resolve to an indexed definition in the repo. Library calls (for exampleExecuteReader) are skipped.keep_semantic_hitdrops search hits from other repos and from test files. When a route matched, it also drops hits in a different language than the route handler.find_semantic_candidatesputs the route call path first, nearest first. Search hits fill the remaining slots. If the call path fillslimit, the tool does not run the search.source(route_handler,route_callee, orsemantic) anddepth. Route-path candidates havescore: null.docs/mcp-tools-and-resources.mdanddocs/reference/mcp-tools.md) describe the new behavior.REQUIREMENTS.mdis regenerated.Tests
tests/test_diagnose_repo_filter_route_candidates.py(SQLite fixture, search is mocked). It copies the reported case: two repos with the same controller, service, and repository chain, and the same route.mainand pass on this branch.main(missing optional packages). The 12 new test cases pass.🤖 Generated with Claude Code