@@ -287,21 +287,17 @@ def _resolve_cited_items(session_id: str, cited_ids: list[str]) -> list[dict[str
287287 if not cited_ids :
288288 return []
289289 registry = state .read_injected (session_id )
290- registry_by_casefold = {
291- key .casefold (): value for key , value in registry .items ()
292- }
293290 seen_citations : set [str ] = set ()
294291 seen_entries : set [str ] = set ()
295292 resolved : list [dict [str , Any ]] = []
296293 for cid in cited_ids :
297- normalized_cid = cid .casefold ()
298- if normalized_cid in seen_citations :
294+ if cid in seen_citations :
299295 continue
300- seen_citations .add (normalized_cid )
301- entry = _registry_entry_for_citation (registry , registry_by_casefold , cid )
296+ seen_citations .add (cid )
297+ entry = _registry_entry_for_citation (registry , cid )
302298 if not entry :
303299 continue
304- canonical_id = _canonical_registry_entry_id (entry , normalized_cid )
300+ canonical_id = _canonical_registry_entry_id (entry , cid )
305301 if canonical_id in seen_entries :
306302 continue
307303 seen_entries .add (canonical_id )
@@ -333,16 +329,15 @@ def _canonical_registry_entry_id(entry: dict[str, Any], fallback: str) -> str:
333329 source_kind = "profile" if kind == "profile" else str (
334330 entry .get ("source_kind" ) or ""
335331 )
336- return f"{ kind } :{ source_kind } :{ real_id } " . casefold ()
332+ return f"{ kind } :{ source_kind } :{ real_id } "
337333 entry_id = entry .get ("id" )
338334 if isinstance (entry_id , str ) and entry_id :
339- return entry_id . casefold ()
335+ return entry_id
340336 return fallback
341337
342338
343339def _registry_entry_for_citation (
344340 registry : dict [str , dict [str , Any ]],
345- registry_by_casefold : dict [str , dict [str , Any ]],
346341 citation : str ,
347342) -> dict [str , Any ] | None :
348343 """Resolve an exact rank id or a stable dashboard-route citation token.
@@ -353,10 +348,7 @@ def _registry_entry_for_citation(
353348 id (the compatibility path for entries without a real id).
354349 """
355350 if not citation .startswith ("route:" ):
356- entry = registry .get (citation )
357- if entry is not None :
358- return entry
359- return registry_by_casefold .get (citation .casefold ())
351+ return registry .get (citation )
360352 try :
361353 _ , kind , source_kind , real_id = citation .split (":" , 3 )
362354 except ValueError :
0 commit comments