@@ -102,15 +102,24 @@ def find_symbol(self, repo: str, name: str) -> list[dict[str, Any]]:
102102
103103 auto_complete returns prefix matches; the agent often wants exact
104104 matches. Doing this client-side keeps the FastAPI surface untouched.
105+
106+ The auto_complete payload nests the symbol name under
107+ `item["properties"]["name"]` (FalkorDB node properties), so we look
108+ there first and only fall back to a top-level `name` for older /
109+ flatter shapes the tests may pass in.
105110 """
106111 payload = self .auto_complete (repo , name )
107112 results = payload .get ("completions" ) or payload .get ("results" ) or payload
108113 if isinstance (results , dict ):
109114 results = results .get ("items" , [])
110- return [
111- item for item in (results or [])
112- if isinstance (item , dict ) and item .get ("name" ) == name
113- ]
115+ out : list [dict [str , Any ]] = []
116+ for item in (results or []):
117+ if not isinstance (item , dict ):
118+ continue
119+ props = item .get ("properties" ) if isinstance (item .get ("properties" ), dict ) else {}
120+ if props .get ("name" ) == name or item .get ("name" ) == name :
121+ out .append (item )
122+ return out
114123
115124 def note_edit (self , repo : str , path : str ) -> dict [str , Any ]:
116125 """Tell code-graph the agent just edited `path`; trigger an
0 commit comments