bug fix for multimodal-dialog agent and add parameter speaker_id in asr result #239
bug fix for multimodal-dialog agent and add parameter speaker_id in asr result #239songguocola wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces robust connection management, graceful shutdown, and resource cleanup. Key changes include adding a speaker ID to sentences, implementing a graceful stop with a 30-second timeout and an idempotent close in MultiModalDialog, and enhancing OkHttpWebSocketClient to handle cancellations and retries safely. Additionally, OkHttpWebSocketClientForAudio is refactored to reduce code duplication. The reviewer recommended clearing DialogBuffer during close() in MultiModalDialog to prevent memory leaks and release buffered objects immediately.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // Nullify emitter to prevent further data sending | ||
| synchronized (MultiModalDialog.this) { | ||
| conversationEmitter = null; | ||
| } |
There was a problem hiding this comment.
When close() is called, the dialog session is being terminated. Any pending audio or text frames currently buffered in DialogBuffer will never be sent. To prevent memory leaks and release references to potentially large ByteBuffer objects immediately, we should clear DialogBuffer inside the synchronized block of close().
| // Nullify emitter to prevent further data sending | |
| synchronized (MultiModalDialog.this) { | |
| conversationEmitter = null; | |
| } | |
| // Nullify emitter and clear buffer to prevent further data sending and release memory | |
| synchronized (MultiModalDialog.this) { | |
| conversationEmitter = null; | |
| DialogBuffer.clear(); | |
| } |
No description provided.