Rewrite `` @ `` segments in a node path using ``id_map``. Path segments encode `` @ ``; when the run_id was an LLM-generated FC id, it gets canonicalized to ``fc-N`` via ``id_map``. Segments without ``@`` and ids not in ``id_map`` pass through unchanged.
(path: str, id_map: dict[str, str])
| 330 | |
| 331 | |
| 332 | def _remap_node_path(path: str, id_map: dict[str, str]) -> str: |
| 333 | """Rewrite ``<name>@<id>`` segments in a node path using ``id_map``. |
| 334 | |
| 335 | Path segments encode ``<node_name>@<run_id>``; when the run_id was an |
| 336 | LLM-generated FC id, it gets canonicalized to ``fc-N`` via ``id_map``. |
| 337 | Segments without ``@`` and ids not in ``id_map`` pass through unchanged. |
| 338 | """ |
| 339 | segments = [] |
| 340 | for seg in path.split("/"): |
| 341 | if "@" in seg: |
| 342 | name, rid = seg.split("@", 1) |
| 343 | if rid in id_map: |
| 344 | seg = f"{name}@{id_map[rid]}" |
| 345 | segments.append(seg) |
| 346 | return "/".join(segments) |
| 347 | |
| 348 | |
| 349 | def _normalize_ids(events: list[AdkEvent]) -> list[AdkEvent]: |
no test coverage detected