fix: emit RealtimeHistoryUpdated on transcript_delta#3570
Open
jordanchendev wants to merge 1 commit into
Open
Conversation
RealtimeSession updated _history with the accumulated transcript on each transcript_delta event but never emitted RealtimeHistoryUpdated. Every other branch that mutates history (item_updated, item_deleted, transcription_completed) does emit the event, so UI subscribers following the documented history_added / history_updated pattern saw no live transcript changes. Emit RealtimeHistoryUpdated immediately after the history update in the transcript_delta branch, consistent with all other history-mutating paths. Fixes openai#2940
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.
Summary
RealtimeSessionupdated_historywith the accumulated transcript on eachtranscript_deltaevent but never emittedRealtimeHistoryUpdated. Every other branch that mutates history (item_updated,item_deleted,transcription_completed) does emit the event, so UI subscribers following the documentedhistory_added/history_updatedpattern saw no live transcript changes during streaming.This fix emits
RealtimeHistoryUpdatedimmediately after the history update in thetranscript_deltabranch, consistent with all other history-mutating paths.Test plan
test_transcript_delta_emits_history_updatedthat verifies both aRealtimeRawModelEventand aRealtimeHistoryUpdatedare emitted for eachtranscript_deltaevent.test_ignored_events_only_generate_raw_eventsto reflect the corrected behavior (4 events instead of 3:transcript_deltanow produces a raw event + a history update).uv run pytest tests/realtime/ -q→ 256 passedmake format && make lint→ all checks passedIssue number
Closes #2940
Checks
make lintandmake format