Add on_client_ready method to BaseBrain and WorkflowBrain

- Implement on_client_ready in BaseBrain to handle client-visible state after the app message channel is ready.
- Extend WorkflowBrain with on_client_ready to replay state that may have been emitted before WebRTC data was ready.
- Update pipeline to call on_client_ready when a client connects.
- Enhance tests to verify the correct behavior of on_client_ready in WorkflowBrain.
This commit is contained in:
Xin Wang
2026-07-14 11:20:18 +08:00
parent f74040adf3
commit 2d6ff5b7aa
4 changed files with 48 additions and 0 deletions

View File

@@ -1218,6 +1218,7 @@ async def run_pipeline(
if greeting and not greeting_transcript_sent:
greeting_transcript_sent = True
await queue_transcript("assistant", greeting, time_now_iso8601())
await brain.on_client_ready()
@transport.event_handler("on_client_connected")
async def on_client_connected(_transport, _client):