Repository navigation
fix(desktop): prevent terminal realtime session resurrection - #9791
Merged
Merged
Conversation
Member
Author
|
Monitor follow-up for PR #9791:
|
Synchronously clear transport readiness and detach the task on the session queue before delivering a terminal error to the controller, preventing close-to-send races. Tests: - xcrun swift test --package-path Desktop --filter RealtimeHubSessionInputLifecycleTests/testOpenAITransportCloseImmediatelyMakesSessionNonSendableBeforeControllerTeardown - xcrun swift test --package-path Desktop --filter RealtimeHub
Guard terminal sessions at start, transport-open, and provider-readiness boundaries so queued setup acknowledgements cannot re-open a closed session or flush its buffers.\n\nTests:\n- xcrun swift test --package-path Desktop --filter RealtimeHubSessionInputLifecycleTests/testTerminalOpenAISessionDoesNotResurrectFromLateReadiness\n- xcrun swift test --package-path Desktop --filter Realtime
Git-on-my-level
force-pushed
the
fix/realtimehub-close-send-race
branch
from
July 15, 2026 12:09
a896d05 to
2ae9c45
Compare
Member
Author
|
Rebased PR #9791 onto latest What changed: No code changes — only a clean rebase of the existing 3 commits onto the current upstream main. The PR's fix (clear transport readiness and detach the task before delivering the controller error callback) is unchanged. Verification:
|
Member
Author
|
Monitor pass complete for PR #9791.
|
kodjima33
approved these changes
Jul 15, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Qualifying bug fix (root cause stated, scoped, tested, CI green).
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.
Summary
Fixes #9666.
A terminal RealtimeHub transport error previously posted to the main-actor controller before the physical session was made non-sendable. Queued audio or commit work could therefore attempt a WebSocket send during the close-to-controller-teardown window.
This change clears transport readiness and detaches the task on the session queue before delivering the controller callback.
Product invariants affected
Durable guard
RealtimeHubSessionInputLifecycleTests.testOpenAITransportCloseImmediatelyMakesSessionNonSendableBeforeControllerTeardownfailed before the repair and passes after it.Verification
xcrun swift test --package-path Desktop --filter Realtime— 117 passedmake preflight— pending this PR metadata