Skip to content

fix(realtime): defer response.create until the previous turn finishes#1127

Merged
seratch merged 3 commits intomainfrom
fix/realtime-response-create-sequencing
Mar 25, 2026
Merged

fix(realtime): defer response.create until the previous turn finishes#1127
seratch merged 3 commits intomainfrom
fix/realtime-response-create-sequencing

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Mar 24, 2026

This pull request fixes a realtime race where follow-up turns could send response.create immediately after response.cancel, before the previous response reached response.done. That could violate the server's single-active-response constraint and break guardrail/tool-driven recovery flows.

The change adds a transport-level response.create sequencer for the realtime transports, routes automatic follow-up requests through that sequencer, and keeps WebRTC audio playback completion separate from response lifecycle completion. It also adds regression coverage for deferred follow-up creates after interrupt, queued manual creates, rejected pending creates, and the response.output_audio.done edge case.

see also: openai/openai-agents-python#2763

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 24, 2026

🦋 Changeset detected

Latest commit: 5ae24e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents-realtime Patch
@openai/agents Patch
@openai/agents-core Patch
@openai/agents-openai Patch
@openai/agents-extensions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added this to the 0.8.x milestone Mar 24, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17a11844d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch seratch merged commit 36a368b into main Mar 25, 2026
6 checks passed
@seratch seratch deleted the fix/realtime-response-create-sequencing branch March 25, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant