Skip to content

Fix turn stream data parsing for sequence numbers - #14

Merged
chiragjn merged 1 commit into
mainfrom
cj-fix-sse-turn-stream-data
Jul 28, 2026
Merged

Fix turn stream data parsing for sequence numbers#14
chiragjn merged 1 commit into
mainfrom
cj-fix-sse-turn-stream-data

Conversation

@chiragjn

@chiragjn chiragjn commented Jul 28, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Changes the turn streaming code path and tightens sequence_number to non-optional; malformed SSE ids now raise instead of being silently omitted.

Overview
Turn streaming now goes through the raw create_turn / subscribe_to_turn HTTP responses and shared SSE helpers so each yielded TurnStreamData carries a real sequence number from the SSE id field (instead of always None).

New _sse_helpers adds parse_sequence_number (strict, aligned with TypeScript), plus sync/async iterators that parse TurnStreamingEvent payloads, skip bad events with warnings, and fail on missing/invalid SSE ids. TurnStreamData.sequence_number is now a required int, matching use with after_sequence_number on resubscribe.

Reviewed by Cursor Bugbot for commit e044f99. Bugbot is set up for automated code reviews on this repo. Configure here.

@chiragjn
chiragjn merged commit 8be2b32 into main Jul 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant