Skip to content

fix(realtime): clean up failed connection attempts - #4189

Merged
seratch merged 2 commits into
mainfrom
fix/realtime-connect-cleanup-ownership
Aug 5, 2026
Merged

fix(realtime): clean up failed connection attempts#4189
seratch merged 2 commits into
mainfrom
fix/realtime-connect-cleanup-ownership

Conversation

@seratch

@seratch seratch commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request takes over and supersedes #4161, which identified a leaked WebSocket and listener task when the initial Realtime session update fails.

It preserves the original cleanup and regression coverage while adding a connection-attempt ownership guard. This prevents overlapping connect() calls from acquiring or replacing connection state while another attempt is in progress. Failed initialization now leaves the model reusable without changing successful connection or SIP behavior.

The original contributor is credited through the commit's Co-authored-by trailer.

Co-authored-by: Shaurya Singh <sshaurya914@gmail.com>
@seratch seratch added this to the 0.19.x milestone Aug 5, 2026

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

Copy link
Copy Markdown

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: b478979c22

ℹ️ 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".

Comment thread src/agents/realtime/openai_realtime.py
Comment thread src/agents/realtime/openai_realtime.py Outdated
Comment thread src/agents/realtime/openai_realtime.py Outdated
@seratch
seratch enabled auto-merge (squash) August 5, 2026 01:25
@seratch
seratch merged commit 81de0d0 into main Aug 5, 2026
9 checks passed
@seratch
seratch deleted the fix/realtime-connect-cleanup-ownership branch August 5, 2026 01:26
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