feat(call): support being in a call from multiple tabs/devices#612
Draft
HexaField wants to merge 1 commit into
Draft
feat(call): support being in a call from multiple tabs/devices#612HexaField wants to merge 1 commit into
HexaField wants to merge 1 commit into
Conversation
Calls were pinned to a single tab per browser: a second tab joining a call hit "You are already in a call in another tab." The whole call + presence stack was keyed by DID, so two sessions of the same agent would collide on one presence entry and one peer-connection slot. Change the unit of call identity from DID to a session key (`did::sessionId`, reusing the per-tab UUID already in sessionStorage) and decouple calls from tab-coordinator leadership. The same agent can now be in a call from several tabs/devices at once. Participant model: every video/screenshare feed renders as its own tile, no-video sessions collapse to a single avatar per person, and audio is deduped to one feed per person (no echo). - types: AgentState gains `did` + `sessionId` - useTabCoordinator: drop call-pinning; leadership now only dedupes general presence - useSignallingService: key presence by session; broadcast when leader OR in a call; dedupe channel/call getters by DID - webrtcStore: session-keyed peer connections, session-precise WebRTC signalling, connect to own other sessions, remove the error toast - call UI: per-session tiles + audio-dedupe mute path - add pure callSessions helper module with unit tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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
Lets the same agent be in a call from multiple tabs/devices at once. Previously a second tab joining a call hit
You are already in a call in another tab.— the call + presence stack was keyed by DID, so two sessions of one agent collided on a single presence entry and a single peer-connection slot.This changes the unit of call identity from DID to a session key (
did::sessionId, reusing the per-tab UUID already insessionStorage) and decouples calls from tab-coordinator leadership.Participant model
Per the agreed design: show every video/screenshare feed separately, dedupe non-video feeds — each person has one representation but all their media is shown.
Changes
AgentStategainsdid+sessionIdcall-pinned/otherTabInCall/setInCall); leadership now only dedupes general presenceleader || inCall;getAgentsInChannel/getAgentsInCalldedupe to one entry per personuseVideoLayout/VideoGrid/MediaPlayer) — per-session tiles (did:sessionId:streamKind) + audio-dedupe mute pathutils/callSessions.ts— pure helpers (sessionKey,shouldInitiate,dedupeByDid,deriveRemoteSessionTiles) with unit testsEdge case (handled)
If a person's only mic-on session has its camera off while another of their sessions shows video, an extra avatar tile is emitted so their audio is never silently dropped (see comment in
deriveRemoteSessionTiles).Testing
callSessionspassvue-tscclean for all touched filesad4m-flux-launch.sh) — not run in this environment🤖 Generated with Claude Code