bench: fix find_symbol exact-match against nested properties.name#674
Open
DvirDukhan wants to merge 1 commit into
Open
bench: fix find_symbol exact-match against nested properties.name#674DvirDukhan wants to merge 1 commit into
DvirDukhan wants to merge 1 commit into
Conversation
Smoke #3 revealed cg find-symbol --name <exact> returned [] for symbols the graph clearly contained (cg auto-complete --prefix found the same symbol with full file:line+docstring). Root cause: the filter compared item['name'] to the requested name, but the /api/auto_complete payload nests the symbol name under item['properties']['name'] (FalkorDB node properties), so the top-level lookup always returned None and nothing matched. Fix: prefer item['properties']['name'], fall back to item['name'] for flatter shapes the unit tests pass in. Added a regression test that uses the real payload structure. Verified end-to-end against the live FastAPI service: cg find-symbol --repo pytest-dev__pytest-6202__code_graph \ --name getmodpath # -> [{id:2714, labels:[Function], properties:{name,path,doc,...}}] This was the bug that made the smoke #3 code_graph agent burn 3 of 5 cg calls retrying exact-name lookups before falling back to auto-complete. With this fix, an agent doing the natural workflow (find-symbol -> get-neighbors -> note-edit) should land far fewer wasted calls. Also: norecursedirs in [tool.pytest.ini_options] to keep pytest from walking into per-instance bench worktrees that ship their own pytest sources (was breaking host pytest's AST rewriter on import). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
galshubeli
approved these changes
May 27, 2026
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
bench/agents/code_graph_adapter.py::find_symbolalways returned[]for exact-name lookups against the live/api/auto_completeendpoint, because it filtered on a top-levelnamefield that doesn't exist in the real response payload.The real
/api/auto_completepayload returns FalkorDB node shape:{ "id": ..., "labels": [...], "properties": { "name": "...", "path": "...", "doc": "...", ... } }The adapter was filtering
item.get("name") == name, which never matched.Fix
Filter checks
item["properties"]["name"]first, then falls back to top-levelname(for backward compat with older unit-test fixtures).Verification
test_find_symbol_reads_nested_properties_namecg find-symbol --name getmodpathnow returns the function record with path + line range, where before it returned an empty listNotes
/api/auto_completeendpoint is unaffecteddvirdukhan/benchmark-planbecause the affected file only exists there (benchmark suite not yet merged to staging)Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com