Skip to content

fix(realtime): make session cleanup deterministic#3767

Merged
seratch merged 3 commits into
mainfrom
fix/realtime-cleanup-ownership
Jul 9, 2026
Merged

fix(realtime): make session cleanup deterministic#3767
seratch merged 3 commits into
mainfrom
fix/realtime-cleanup-ownership

Conversation

@seratch

@seratch seratch commented Jul 9, 2026

Copy link
Copy Markdown
Member

This pull request resolves #3334 by coordinating Realtime session cleanup through a single session-owned task.

It awaits cooperative background-task cancellation before transport shutdown, prevents late work from mutating closed-session state, protects shared cleanup from caller cancellation, and avoids a reentrant wait cycle when a tracked task calls close() while cleanup is already waiting for that task. Public APIs remain unchanged.

@seratch seratch added this to the 0.18.x milestone Jul 9, 2026
@seratch

seratch commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: ce3081589f

ℹ️ 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/session.py
@seratch seratch force-pushed the fix/realtime-cleanup-ownership branch from ce30815 to 7991168 Compare July 9, 2026 11:22

@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: 7991168556

ℹ️ 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/session.py
@seratch seratch enabled auto-merge (squash) July 9, 2026 11:34
@seratch seratch merged commit 70c447e into main Jul 9, 2026
9 checks passed
@seratch seratch deleted the fix/realtime-cleanup-ownership branch July 9, 2026 11:34
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.

Realtime cleanup should await cancelled background tasks

1 participant