Commit b0c9ce9
bench: fix find_symbol exact-match against nested properties.name
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>1 parent 13ac345 commit b0c9ce9
3 files changed
Lines changed: 37 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
83 | 103 | | |
84 | 104 | | |
85 | 105 | | |
| |||
0 commit comments