Skip to content

fix(s2s): keep the conversation across socket replacement - #61

Open
WingedGuardian wants to merge 1 commit into
fix/s2s-single-pipeline-ownerfrom
fix/s2s-preserve-replaced-session
Open

WingedGuardian wants to merge 1 commit into
fix/s2s-single-pipeline-ownerfrom
fix/s2s-preserve-replaced-session

Conversation

@WingedGuardian

Copy link
Copy Markdown
Owner

What changes

Replacing a live S2S socket now keeps its logical conversation. The eviction input clears its current socket, closes the old connection and waits for transport teardown before installing the replacement. During that empty-input gap, the old disconnect notification previously triggered the bridge's real session teardown, so the replacement always started fresh.

Use Pipecat's existing notification hook to suppress only that eviction-gap event. Native socket/output cleanup still runs. A genuine current disconnect and a late notification after another socket is installed still delegate normally, preserving the existing stale-socket output restoration.

Closes #51.

Depends on #60 (which depends on #59); this is PR 3 of the three-PR reliability stack. Base: fix/s2s-single-pipeline-owner. Merge #59 and #60 first, then retarget this PR to main and refresh CI before merging.

Validation

  • Real websocket tests with actual bridge event handlers failed before the fix for both cooperative and half-open old sockets: disconnect/reconnect callbacks reset the logical session.
  • Those tests now retain one logical connect through replacement and deliver one real disconnect when the final socket closes.
  • A focused real-handler test preserves stale-output restoration after an old notification. It waits for asynchronous dispatch rather than assuming the callback completed inline.
  • Deliberate mutants that suppress every disconnect or suppress notifications for an already-installed replacement both fail the constraint tests.
  • All 100 stacked S2S tests pass with locked dependencies (Pipecat 1.12.0); Ruff, privacy scan and independent local architect/security audits pass. The inherited CI job runs the suite.
  • Concurrency coverage includes cooperative/half-open replacement and stale-notification restoration; simultaneous third-client admission has not been exercised.

E2E: after merge and an owner-approved deploy, replace a live device socket during a voice conversation and confirm the realtime session and context survive; disconnect the final socket and confirm normal session teardown still occurs.

Use the transport notification hook to suppress the displaced socket
disconnect event after transport cleanup. Keep genuine final disconnects
and exercise cooperative and half-open replacement through real sockets.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3b73703-887a-43d4-8c93-d0a194ad1509

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T02:57:21.936700Z a7ee8b8 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@WingedGuardian

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: a7ee8b89a1

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant