fix(core): fix index checking when merging lists (#32431)

**Description:** fix an issue I discovered when attempting to merge
messages in which one message has an `index` key in its content
dictionary and another does not.
This commit is contained in:
John Bledsoe
2025-08-06 12:47:33 -04:00
committed by GitHub
parent 2543007436
commit bc4251b9e0
2 changed files with 6 additions and 1 deletions

View File

@@ -97,7 +97,7 @@ def merge_lists(left: Optional[list], *others: Optional[list]) -> Optional[list]
to_merge = [
i
for i, e_left in enumerate(merged)
if e_left["index"] == e["index"]
if "index" in e_left and e_left["index"] == e["index"]
]
if to_merge:
# TODO: Remove this once merge_dict is updated with special