Live API: fractional-second Durations ("7.280s") fail to deserialize, dropping the whole message
Los mantenedores suelen responder en 1 día
@hemasekhar-p ya está trabajando en esto.
Desde el 21/7/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
- Lenguaje dominante
- Java
- Estrellas
- 398
- Forks
- 126
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 71
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/java-genai
-
ResponseStream.close() can block on the reader lock before closing the HTTP responsePosiblemente ocupada @hirematha la tomó hace 1 día. Abiertopriority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleapis/java-genai#1372 ·
Los mantenedores suelen responder en 1 día
-
Interactions API: GaosClientException.getMessage() only returns "400 . API error occurred" and omits the server error detailsPosiblemente ocupada @hemasekhar-p la tomó hace 25 días. Abiertopriority: p2 type: bug
googleapis/java-genai#1282 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Interactions API: store(false) omits "id", breaking Interaction and InteractionCompletedEvent deserializationPosiblemente ocupada @hemasekhar-p la tomó hace 25 días. Abiertopriority: p2 type: bug
googleapis/java-genai#1281 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Interaction.outputText() always returns Optional.empty() (SDK-computed field is never populated)Posiblemente ocupada @hemasekhar-p la tomó hace 25 días. Abiertopriority: p2 type: bug
googleapis/java-genai#1280 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Gen AI with structured output - `propertyOrdering` in Python vs. Java implementationsPosiblemente ocupada @hemasekhar-p la tomó hace 79 días. Abiertopriority: p3 type: feature request
googleapis/java-genai#1169 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleapis/java-genai
Issues similares
-
status: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
spring-projects/spring-framework#37614 ·
Los mantenedores suelen responder en 1 día
-
azure-spring azure-spring-aad Client
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Azure/azure-sdk-for-java#51046 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
helm-knative-apply.sh fails with Helm 4Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea: triage theme: undefined
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
jhipster/generator-jhipster#35895 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
oracle/graalvm-reachability-metadata#11659 ·
Los mantenedores suelen responder en 1 día