feat(voice): add session_host to AgentSession.start() - #6725
Merged
Conversation
theomonnom
force-pushed
the
theo/agent-session-is-primary
branch
4 times, most recently
from
August 6, 2026 06:23
035b7ce to
b82a777
Compare
theomonnom
force-pushed
the
theo/agent-session-is-primary
branch
2 times, most recently
from
August 6, 2026 06:37
4dba1f3 to
f331b19
Compare
Hosting claims the room's `lk.agent.session` topic, of which an `rtc.Room` holds one handler, so a Room that is already a `RemoteSession` client cannot also host. Sharing the topic is not an option either: a host filters no sender and broadcasts with no destination, so it would consume the replies meant for the client and spray events at peers that parse them as requests. The only lever was `is_primary`, reachable solely through a JobContext already holding a different primary session — so a session outside any job context is always the host, and the only escape was shadowing the private `_session_host` attribute. The flag narrows the host gate and nothing else: primary designation, the non-primary recording fallback and init_recording keep running exactly as before, so a non-hosting session under a job is still tracked, still closed at shutdown, and still declines to record over another.
theomonnom
force-pushed
the
theo/agent-session-is-primary
branch
from
August 6, 2026 15:12
f331b19 to
7842cd9
Compare
chenghao-mou
approved these changes
Aug 6, 2026
chenghao-mou
left a comment
Member
There was a problem hiding this comment.
lgtm. same shape as #6137
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.
No description provided.