Skip to content

bug fix for multimodal-dialog agent and add parameter speaker_id in asr result #239

Closed
songguocola wants to merge 2 commits into
dashscope:mainfrom
songguocola:dev/audio_0701
Closed

bug fix for multimodal-dialog agent and add parameter speaker_id in asr result #239
songguocola wants to merge 2 commits into
dashscope:mainfrom
songguocola:dev/audio_0701

Conversation

@songguocola

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +492 to +495
// Nullify emitter to prevent further data sending
synchronized (MultiModalDialog.this) {
conversationEmitter = null;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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().

Suggested change
// 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();
}

@songguocola songguocola closed this Jul 1, 2026
@songguocola songguocola deleted the dev/audio_0701 branch July 1, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant