-
Notifications
You must be signed in to change notification settings - Fork 117
fix(plugins:getstream): handle CallEnded event #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded an event handler in StreamEdge to subscribe to and forward CallEndedEvent notifications, enabling proper event propagation when calls terminate within the getstream plugin. Changes
Sequence DiagramsequenceDiagram
participant SFU as SFU Event Source
participant StreamEdge
participant EventManager as Event Manager<br/>(Downstream)
SFU->>StreamEdge: CallEndedEvent emitted
rect rgb(200, 220, 240)
StreamEdge->>StreamEdge: _on_call_ended() invoked
note over StreamEdge: Event handler triggered
StreamEdge->>EventManager: Forward CallEndedEvent<br/>with plugin_name="getstream"
end
EventManager->>EventManager: Subscribers notified
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py (1)
252-257: Solid fix! Event forwarding will allow clean exit.The implementation correctly handles and forwards the
CallEndedEvent, which addresses the root cause described in issue #195. The agent's_audio_consumer_taskloop will now receive the event and exit cleanly.Consider these optional enhancements for richer context:
- Forward the
reasonfrom the SFU event (available asevent.reasonper the CallEndedEvent definition) using thekwargsfield- Add a logging statement for observability, similar to other event handlers in this file
Example refinement:
async def _on_call_ended(self, event: sfu_events.CallEndedEvent): + logger.info(f"Call ended, reason: {event.reason}") self.events.send( events.CallEndedEvent( plugin_name="getstream", + kwargs={"reason": event.reason} if event.reason is not None else None, ) )
📜 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.
📒 Files selected for processing (1)
plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py (3)
agents-core/vision_agents/core/events/manager.py (2)
subscribe(301-373)send(435-479)agents-core/vision_agents/core/edge/events.py (1)
CallEndedEvent(38-43)agents-core/vision_agents/core/edge/sfu_events.py (1)
CallEndedEvent(613-643)
🔇 Additional comments (1)
plugins/getstream/vision_agents/plugins/getstream/stream_edge_transport.py (1)
89-89: LGTM! Subscription registered correctly.The event subscription follows the established pattern and will properly register the handler for
sfu_events.CallEndedEvent.
dangusev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @m0reA1 , great find!
Approved and merged
fixed #195
Summary by CodeRabbit