Live API: fractional-second Durations ("7.280s") fail to deserialize, dropping the whole message
I maintainer di solito rispondono entro 1 giorno
@hemasekhar-p ci sta già lavorando.
Dal 21/7/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 398
- Fork
- 126
- Merge medio
- 1g 12h
- PR unite (30g)
- 71
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di googleapis/java-genai
-
priority: p2 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
googleapis/java-genai#1372 ·
I maintainer di solito rispondono entro 1 giorno
-
Interactions API: GaosClientException.getMessage() only returns "400 . API error occurred" and omits the server error detailsForse già presa @hemasekhar-p l’ha presa 24 giorni fa. Apertapriority: p2 type: bug
googleapis/java-genai#1282 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Interactions API: store(false) omits "id", breaking Interaction and InteractionCompletedEvent deserializationForse già presa @hemasekhar-p l’ha presa 24 giorni fa. Apertapriority: p2 type: bug
googleapis/java-genai#1281 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Interaction.outputText() always returns Optional.empty() (SDK-computed field is never populated)Forse già presa @hemasekhar-p l’ha presa 24 giorni fa. Apertapriority: p2 type: bug
googleapis/java-genai#1280 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Gen AI with structured output - `propertyOrdering` in Python vs. Java implementationsForse già presa @hemasekhar-p l’ha presa 78 giorni fa. Apertapriority: p3 type: feature request
googleapis/java-genai#1169 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di googleapis/java-genai
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
oracle/graalvm-reachability-metadata#11472 ·
I maintainer di solito rispondono entro 1 giorno
-
OkHttp versions 5.4.0+ no longer include baseline-prof.txtForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
lysine-dev/okhttp#9828 ·
I maintainer di solito rispondono entro 1 giorno
-
status: waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
spring-projects/spring-ai#7269 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
objectionary/hone-maven-plugin#1353 ·
I maintainer di solito rispondono entro 9 giorni
-
ClassNotFoundException: io.netty.channel.kqueue.KQueueEventLoop stack trace printed during native build on main (Netty 4.2 removed the class)Forse già presa @gastaldi l’ha presa oggi. Apertaarea/netty kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
quarkusio/quarkus#57939 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno