fix(agents-realtime): preserve assistant audio transcripts in history updates#1
Open
fix(agents-realtime): preserve assistant audio transcripts in history updates#1
Conversation
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.
Motivation
contentor use theaudiocontent type were overwriting previously known assistant transcripts, making it appear that assistant messages were deleted or repeated in session history.Description
audioentries the same asoutput_audiowhen merging assistant updates so transcripts are preserved when incoming updates omit them.contentwhen an incoming assistant update has an emptycontentarray to avoid losing previously-rendered text/transcript.removeAudioFromContentalso strips audio payloads for theaudioentry type (setaudio: null) so audio binary data is consistently removed when requested.audiopayloads, and add a changeset for@openai/agents-realtime.Testing
bash .codex/skills/code-change-verification/scripts/run.shwhich executespnpm build,pnpm -r build-check,pnpm lint, andpnpm test; the run failed during TypeScript compilation with pre-existing errors inpackages/agents-coreandpackages/agents-realtime/src/realtimeSession.ts.pnpm changeset:validatewhich failed in this environment due to Git ref resolution (git merge-base main HEAD) because themainref is not available.packages/agents-realtime/test/utils.test.tsfor the new behaviors (these tests were added but the full verification suite could not complete due to the TypeScript/git issues above).Codex Task