Live API: fractional-second Durations ("7.280s") fail to deserialize, dropping the whole message
メンテナーはふだん 1 日以内に返信
@hemasekhar-p がすでに取り組んでいます。
2026年7月21日 から。
評価
この issue はまだ評価されていません。
説明
Description
CustomDurationDeserializer in JsonSerializable only parses whole-second Duration values (Long.parseLong), but the Gemini Live API server streams fractional-second Durations (e.g. "7.280s", "1.600s", "0.360s"). The parse throws NumberFormatException, which surfaces as:
SEVERE: Error deserializing message
com.google.genai.errors.GenAiIOException: Failed to deserialize the JSON node.
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException:
Cannot deserialize value of type `java.time.Duration` from String "7.280s":
Cannot parse duration from string: 7.280s. Expected format 'Xs'.
Because this happens inside the Live WebSocket read path, the entire server message is dropped. When that message carries the model turn / a function call, the turn is lost — in a voice-agent app the assistant cuts off mid-sentence and no tool call fires.
Impact
Production voice-reception app on gemini-3.1-flash-live-preview (Vertex): ~700 of these errors in 24h across ~190 calls (~3–4 per call). Most calls survive because the read loop resumes on the next message, but an intermittent few break at the worst moment (mid first response / on the transfer tool call).
Root cause
src/main/java/com/google/genai/JsonSerializable.java, CustomDurationDeserializer:
long seconds = Long.parseLong(secondsPart); // rejects "7.280"
return java.time.Duration.ofSeconds(seconds);
Suggested fix
Parse decimal seconds and keep sub-second precision:
double seconds = Double.parseDouble(secondsPart);
return java.time.Duration.ofNanos(Math.round(seconds * 1_000_000_000.0));
(Protobuf google.protobuf.Duration is routinely JSON-encoded with fractional seconds, so this is the expected wire format.)
Versions
- google-genai 1.61.0 (also present in 1.62.0 —
JsonSerializableunchanged) - Model:
gemini-3.1-flash-live-preview, Vertex AI, Live API (BidiGenerateContent) - Java 25
- 主要言語
- Java
- スター
- 398
- フォーク
- 126
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 71
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/java-genai のほかの issue
-
ResponseStream.close() can block on the reader lock before closing the HTTP response対応中かも @hirematha が 3 日前に担当しました。 オープンpriority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
googleapis/java-genai#1372 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Interactions API: GaosClientException.getMessage() only returns "400 . API error occurred" and omits the server error details対応中かも @hemasekhar-p が 27 日前に担当しました。 オープンpriority: p2 type: bug
googleapis/java-genai#1282 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Interactions API: store(false) omits "id", breaking Interaction and InteractionCompletedEvent deserialization対応中かも @hemasekhar-p が 27 日前に担当しました。 オープン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 が 27 日前に担当しました。 オープンpriority: p2 type: bug
googleapis/java-genai#1280 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Gen AI with structured output - `propertyOrdering` in Python vs. Java implementations対応中かも @hemasekhar-p が 81 日前に担当しました。 オープンpriority: p3 type: feature request
googleapis/java-genai#1169 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
googleapis/java-genai の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
intellij-elixir/intellij-elixir#4585 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
MetricsHub/metricshub-community#1474 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
adorsys/keycloak-config-cli#1742 ·
メンテナーはふだん 1 日以内に返信
-
Booking links: POST /api/booking-links with a null element in "availabilityRules" throws NullPointerException and answers 500 instead of 400対応中かも @chibenwa が今日担当しました。 オープンai-driven-fuzzing bug claude Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
linagora/twake-calendar-side-service#1322 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
PathnameExpander incorrectly interprets regex metacharacters in wildcard patterns対応中かも @jiteshkhatri11 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
javapathfinder/jpf-core#662 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信