fix(responses): start synthetic stream sequence numbers at 1

Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
Cursor Agent 2026-05-27 00:57:26 +00:00
parent 3b3da793da
commit 7f52f18118
No known key found for this signature in database

View file

@ -1218,7 +1218,7 @@ def _build_synthetic_response_events(
# event types now declare `sequence_number: int = 0` (default), which
# would otherwise serialize as 0 for most events and break the strict
# monotonic ordering guarantee expected by some Responses API clients.
for idx, event in enumerate(events):
for idx, event in enumerate(events, start=1):
try:
event.sequence_number = idx
except (AttributeError, ValueError):