Skip to content

[agents][incident flup] wait for server side agent to join remove before snending data#642

Open
AngeloGiacco wants to merge 1 commit into
mainfrom
angelo/incident-flup
Open

[agents][incident flup] wait for server side agent to join remove before snending data#642
AngeloGiacco wants to merge 1 commit into
mainfrom
angelo/incident-flup

Conversation

@AngeloGiacco

@AngeloGiacco AngeloGiacco commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

i think we can add this for extra safety as a flup to the incident, logic looks reasonable to me. could you take it for a spin locally and see if it works well @kraenhansen ?

Note

Medium Risk
Adds a new pre-send wait/timeout in the WebRTC connection handshake, which could delay or fail connection setup if participant events/identities differ from expectations.

Overview
Prevents WebRTC conversation init messages from being dropped by waiting for a remote participant whose identity contains agent to appear (either already in room.remoteParticipants or via RoomEvent.ParticipantConnected) before sending the initiation/overrides payload, with a 30s timeout.

Updates the LiveKit mocks in WebRTCConnection.test.ts to include remoteParticipants and the ParticipantConnected event so tests align with the new handshake behavior.

Written by Cursor Bugbot for commit 76bb8ce. This will update automatically on new commits. Configure here.

@AngeloGiacco AngeloGiacco changed the title [angelo][incident flup] wait for server side agent to join remove before snending data [agents][incident flup] wait for server side agent to join remove before snending data Mar 31, 2026
@kraenhansen

kraenhansen commented Mar 31, 2026

Copy link
Copy Markdown
Member

I've been unable to reproduce the original issue, so I can't reliably determine if this will fix it. To clarify: You mostly just want me to validate that this doesn't break stuff?

As I see it this change will add the agent's connection to the critical path of starting a session, right? That's not ideal and should be avoided if we'd want to keep things fast and responsive 😬

@AngeloGiacco

Copy link
Copy Markdown
Collaborator Author

would be great yeah :) i dont have rn set up so would like to check it doesnt cause any issues there but otherwise i will get round to it later this week, can always just QA on js otherwise

@AngeloGiacco

AngeloGiacco commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator Author

btw i dont think this would have actually prevented the incident, it was definitely the livekit bug, just looks safer to me

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.

2 participants