Live API: no way to observe session close or connection errors after setup
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Summary
After a Live session is established, a caller has no way to be notified that it ended. When the server closes the session (e.g. after GoAway) or the WebSocket drops, AsyncLive.GenAiWebSocketClient only logs onClosed/onFailure nothing reaches the receive() message consumer or any future, so the application can't react. receive() itself returns an already-completed future (its Javadoc notes it only signals registration), so it can't carry the signal either.
Root cause
In AsyncLive.GenAiWebSocketClient, once sessionFuture is done (i.e. for the whole active session) these just log:
public void onClosed(WebSocket webSocket, int code, String reason) {
logger.log(Level.INFO, "Live session closed ...");
if (!sessionFuture.isDone()) { sessionFuture.completeExceptionally(...); } // else: only logged
}
public void onFailure(WebSocket webSocket, Throwable t, @Nullable Response response) {
logger.log(Level.SEVERE, "Error during live session", t);
if (!sessionFuture.isDone()) { sessionFuture.completeExceptionally(t); } // else: only logged
}
Impact
Found while building the Gemini Live API integration for langchain4j: the wrapper can't tell the application when a session ends. A listen-only voice agent is never notified that the connection dropped the only signal today is an exception on the next send.
Suggested fix
A backward-compatible overload of receive(...), with onError/onClose invoked from onFailure/onClosed after setup (terminal, mutually exclusive, nullable); the existing receive(Consumer) delegates to it:
public CompletableFuture<Void> receive(
Consumer<LiveServerMessage> onMessage, Consumer<Throwable> onError, Runnable onClose)
Open to a different shape (e.g. a listener interface) if you'd prefer.
Environment
com.google.genai:google-genai 1.62.0, and unchanged on current main (1.65.0-SNAPSHOT). Gemini Live API, Java.
- 主要言語
- Java
- スター
- 398
- フォーク
- 126
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 71
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/java-genai のほかの issue
-
priority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
googleapis/java-genai#1372 ·
メンテナーはふだん 1 日以内に返信
-
Interactions API: GaosClientException.getMessage() only returns "400 . API error occurred" and omits the server error details対応中かも @hemasekhar-p が 24 日前に担当しました。 オープンpriority: p2 type: bug
googleapis/java-genai#1282 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Interactions API: store(false) omits "id", breaking Interaction and InteractionCompletedEvent deserialization対応中かも @hemasekhar-p が 24 日前に担当しました。 オープンpriority: p2 type: bug
googleapis/java-genai#1281 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Interaction.outputText() always returns Optional.empty() (SDK-computed field is never populated)対応中かも @hemasekhar-p が 24 日前に担当しました。 オープンpriority: p2 type: bug
googleapis/java-genai#1280 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Gen AI with structured output - `propertyOrdering` in Python vs. Java implementations対応中かも @hemasekhar-p が 78 日前に担当しました。 オープンpriority: p3 type: feature request
googleapis/java-genai#1169 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
googleapis/java-genai の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
メンテナーはふだん 1 日以内に返信
-
Component: Frontend Component: Web Component Type: Maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
it-at-m/refarch-templates#1944 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
-
GeoSeries scale and skew tests fail with pytest 9.2.0対応中かも @jiayuasu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Preventions: a dose saved without a unit reopens blank, and an unchanged save then erases it対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンpriority: medium Review effort [1-5]: 3 status: needs-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
carlos-emr/carlos#5431 ·
メンテナーはふだん 1 日以内に返信