Decode Gemini errors sent as a single object, not only as an array
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- swift
- Área
- api, backend-api-design
Línea de trabajo
Read JSONResponseErrorDecoder.decodeErrorResponse(data:) and the existing testAsyncChatsThrowsStatusErrorForSingleGeminiErrorObject test added in #471. First verify whether Gemini's OpenAI-compatible endpoint returns errors as a single object; the issue says this is unconfirmed. If it does, update decoding and the test to expect GeminiAPIErrorResponse; done means the caller receives the Gemini error message for that response.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
JSONResponseErrorDecoder recognizes a Gemini error only when it comes wrapped in an array:
[{"error": {"code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT"}}]
The same error sent as a single object isn't recognized:
{"error": {"code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT"}}
It isn't an APIErrorResponse either, because type is required. So the caller never sees the message:
- Before #471, the body surfaced as a
DecodingErrorabout the expected result type. - With #471, a status of 400 or above surfaces as
OpenAIError.statusError, which carries no body.
The single-object shape is Google's standard API error format, which the native Gemini API uses. Nobody has confirmed yet whether the OpenAI-compatible endpoint ever returns it.
Proposal
- Check whether Gemini's OpenAI-compatible endpoint returns errors as a single object.
- If it does, make
JSONResponseErrorDecoder.decodeErrorResponse(data:)also try a singleGeminiAPIErrorResponse, so the caller gets the message. - Update
testAsyncChatsThrowsStatusErrorForSingleGeminiErrorObject(added in #471) to expect aGeminiAPIErrorResponse.
- Lenguaje dominante
- Swift
- Estrellas
- 2.9k
- Forks
- 519
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 MacPaw/OpenAI
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
Enable batch promptsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
MacPaw/OpenAI#73 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
Los mantenedores suelen responder en 2 días
-
Demo release check 2026-10-27: failures, skips and notesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
MacPaw/OpenAI#478 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 2 días
Todos los issues de MacPaw/OpenAI
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
swiftlang/swift-markdown#299 ·
-
area: agents follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
manaflow-ai/cmux#37234 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug product / functions
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día