Skip to content

fix(agents-realtime): preserve assistant audio transcripts in history updates#1

Open
adatta02 wants to merge 1 commit intomainfrom
codex/fix-message-deletion-in-session-history
Open

fix(agents-realtime): preserve assistant audio transcripts in history updates#1
adatta02 wants to merge 1 commit intomainfrom
codex/fix-message-deletion-in-session-history

Conversation

@adatta02
Copy link

Motivation

  • Realtime assistant updates that arrive with empty content or use the audio content type were overwriting previously known assistant transcripts, making it appear that assistant messages were deleted or repeated in session history.

Description

  • Treat audio entries the same as output_audio when merging assistant updates so transcripts are preserved when incoming updates omit them.
  • Return the existing assistant content when an incoming assistant update has an empty content array to avoid losing previously-rendered text/transcript.
  • Ensure removeAudioFromContent also strips audio payloads for the audio entry type (set audio: null) so audio binary data is consistently removed when requested.
  • Add unit tests that cover preserving assistant transcripts when incoming content is empty and stripping audio payloads, and add a changeset for @openai/agents-realtime.

Testing

  • Ran the repository verification script bash .codex/skills/code-change-verification/scripts/run.sh which executes pnpm build, pnpm -r build-check, pnpm lint, and pnpm test; the run failed during TypeScript compilation with pre-existing errors in packages/agents-core and packages/agents-realtime/src/realtimeSession.ts.
  • Attempted pnpm changeset:validate which failed in this environment due to Git ref resolution (git merge-base main HEAD) because the main ref is not available.
  • Added unit tests under packages/agents-realtime/test/utils.test.ts for the new behaviors (these tests were added but the full verification suite could not complete due to the TypeScript/git issues above).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant