MAINT: Unify OpenAI realtime event routing - #2319
Merged
romanlutz merged 3 commits intoAug 4, 2026
Merged
Conversation
Centralize OpenAI realtime event aliases and response delta accumulation while keeping atomic soft-finish and streaming barge-in termination policies in their existing owners. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be81055b-39ed-494c-94ca-c7656200a344
Pin shared event classification, provider aliases, atomic termination fallbacks, and streaming state guards with focused regression cases. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be81055b-39ed-494c-94ca-c7656200a344
…ime-event-routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
OpenAI realtime atomic and streaming paths independently classified the same provider events and accumulated audio/transcript deltas, making alias handling prone to drift. This change introduces a private shared classifier/accumulator while deliberately keeping termination and state ownership in their existing paths.
Atomic receiving retains its soft-finish timing, first-event stale-response heuristic, failed-response validation, and connection-close fallback. Streaming retains per-turn futures, response-ID stale filtering, committed-audio callbacks, cancellation/truncation, and barge-in semantics. Public APIs and connection lifecycles are unchanged.
Tests and Documentation
Added focused regression coverage for provider aliases, lifecycle and unknown events, empty deltas, atomic timeout and connection-close behavior, stale response IDs, streaming state guards, missing payloads, commit callbacks, and pre-item cancellation.
origin/main.ty, pre-commit hooks, andgit diff --checkpass.Documentation: N/A. This is an internal behavior-preserving refactor with no public API or usage changes.
JupyText: N/A. No documentation notebooks changed.