Skip to content

Conversation

@tbarbugli
Copy link
Member

@tbarbugli tbarbugli commented Nov 10, 2025

Summary by CodeRabbit

  • New Features

    • Exposed participant state on real-time connections to improve participant tracking and join/wait flows in vision/real‑time sessions.
  • Chores

    • Bumped getstream dependency to >=2.5.11 for improved stability and compatibility.

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

The PR bumps the getstream[webrtc,telemetry] dependency and exposes participant state via a new participants property on StreamConnection; the Agent class is updated to use that public ParticipantsState (assigned to self.participants) and related join/wait flows and handler signatures are reformatted.

Changes

Cohort / File(s) Change Summary
Dependency Update
agents-core/pyproject.toml
Updated getstream[webrtc,telemetry] constraint from >=2.5.9 to >=2.5.11.
Stream transport: participants exposure
plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py
Added imports ChannelMemberRequest and ParticipantsState; added public participants property on StreamConnection returning self._connection.participants_state; switched channel member usage to ChannelMemberRequest; minor signature/formatting adjustments.
Agent participant plumbing
agents-core/vision_agents/core/agents/agents.py
Imported ParticipantsState; added public attribute self.participants: Optional[ParticipantsState]; assign self.participants = connection.participants in join; replaced legacy ParticipantJoinedEvent handling with subscriptions to participants state; reformatted several method signatures (_on_track_added, _on_track_removed, join, simple_audio_response) to multiline style and adjusted wait/subscribe/unsubscribe logic.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Agent
  participant StreamConnection
  participant ParticipantsState

  Agent->>StreamConnection: join(call)
  StreamConnection->>StreamConnection: access _connection.participants_state
  StreamConnection-->>Agent: return ParticipantsState (participants property)
  Agent->>ParticipantsState: subscribe / map(on_participants)
  note right of ParticipantsState `#DFF2E1`: participant list updates
  ParticipantsState-->>Agent: participant updates (via subscription)
  Agent->>Agent: set self.participants = ParticipantsState
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay extra attention to:
    • participants property delegation to self._connection.participants_state.
    • self.participants lifecycle handling in join / wait_for_participant (None checks, subscribe/unsubscribe).
    • Reformatted async signatures to ensure no behavioral changes or missed awaits.

Possibly related PRs

Suggested labels

plugin-getstream

Suggested reviewers

  • dangusev
  • tschellenbach

Poem

I tally faces into glass and name them cold,
A thin bright ledger of mouths and listening bones.
The property opens: a small, obedient fold —
Where absent voices gather like fossil tones.
Participants hum, precise, and leave their shadows known.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.25% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Make wait_for_participant resilient' directly describes a main behavioral change in the PR—enhancing the wait_for_participant flow with resilience improvements via the new ParticipantsState handling.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wait-for-participant-fix

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9539376 and 0a6e500.

📒 Files selected for processing (1)
  • plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: unit / Ruff & mypy
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Ruff & mypy
  • GitHub Check: unit / Test "not integration"
🔇 Additional comments (3)
plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py (3)

12-12: LGTM! Imports align with the new functionality.

The new imports support the participants property and updated channel member creation.

Also applies to: 16-16


380-384: Correct and verified usage of ChannelMemberRequest for channel creation.

The change from ChannelMember to ChannelMemberRequest at line 380 correctly follows getstream 2.5.0 API conventions. ChannelMemberRequest is the request/input object sent when creating or adding members, while ChannelMember is the server-side response model returned by APIs. The code properly uses ChannelMemberRequest for the creation input payload and maintains the full ChannelMember type for the update() call at lines 391-401 where the server response is handled.


43-45: Verify that ParticipantsState exposure aligns with intended GetStream usage patterns.

The property exposes a direct reference to an external ParticipantsState object from the GetStream library. Web search indicates GetStream uses reactive state patterns (StateFlow) for participant management, which are designed for external observation. However, explicit thread-safety or immutability guarantees are not documented. Confirm with your GetStream integration that this direct exposure doesn't introduce unintended mutation risks or race conditions in your use cases.


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 and usage tips.

@tbarbugli tbarbugli merged commit cfa581e into main Nov 11, 2025
6 checks passed
@tbarbugli tbarbugli deleted the wait-for-participant-fix branch November 11, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants