Responses API with code_interpreter returns empty output_text in v2.20.0 (regression from v2.19.0)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #2925 de @roli-lpci — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza ejecutando la reproducción de Python proporcionada con openai-python v2.20.0 y comparando la deserialización de la respuesta de la Responses API con v2.19.0. Rastrea cómo se analiza la respuesta completada y, después, verifica que el uso de code_interpreter preserve el mensaje final y restaure el valor esperado de response.output_text.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
Describe the bug
When using the Responses API with code_interpreter tool and file uploads, response.output_text is always empty in v2.20.0, even though the response status is "completed" and the code_interpreter successfully executes code. The same code works correctly on v2.19.0 and v2.18.0.
To reproduce
Minimal reproduction script:
import json
import os
from openai import OpenAI
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
# Upload a tiny JSON file
data = {"items": [{"name": "A", "value": 10}, {"name": "B", "value": 20}]}
uploaded = client.files.create(
file=("test_data.json", json.dumps(data).encode()),
purpose="assistants",
)
try:
response = client.responses.create(
model="o4-mini",
reasoning={"effort": "low"},
tools=[
{
"type": "code_interpreter",
"container": {"type": "auto", "file_ids": [uploaded.id]},
},
],
instructions="You are a helpful data analyst. Always reply with a final text answer.",
input="Read test_data.json and return the sum of the 'value' column. Reply with just the number.",
max_output_tokens=256,
timeout=120,
)
print(f"Status: {response.status}")
print(f"output_text: {response.output_text!r}")
print(f"Output items: {len(response.output)}")
for i, item in enumerate(response.output):
print(f" [{i}] type={item.type}")
finally:
client.files.delete(uploaded.id)
Expected behavior
response.output_text should contain the model's text answer (e.g. "30"), as it does on v2.19.0.
Actual behavior (v2.20.0)
response.status→"completed"response.output_text→""(empty string)- The
code_interpreter_calloutput item showsstatus="completed"butoutputs=null - No
messageoutput item is present inresponse.output
Typical output on v2.20.0:
Status: completed
output_text: ''
Output items: 2
[0] type=reasoning
[1] type=code_interpreter_call (status=completed, outputs=null)
Working behavior (v2.19.0 and v2.18.0)
Status: completed
output_text: '30'
Output items: 6
[0] type=reasoning
[1] type=code_interpreter_call (status=completed)
[2] type=reasoning
[3] type=code_interpreter_call (status=completed)
[4] type=reasoning
[5] type=message (status=completed)
Version comparison matrix
| openai version | o4-mini + effort=low |
gpt-4.1-mini (no reasoning) |
|---|---|---|
| 2.18.0 | ✅ PASS | ✅ PASS |
| 2.19.0 | ✅ PASS | ✅ PASS |
| 2.20.0 | ❌ FAIL (empty output_text) | ❌ FAIL (empty output_text) |
Environment
- OS: Ubuntu Linux
- Python: 3.12
- openai (broken): 2.20.0
- openai (working): 2.19.0, 2.18.0
Additional context
The issue affects both reasoning models (o4-mini) and non-reasoning models (gpt-4.1-mini), so it is not specific to reasoning effort settings. The regression appears to be in how the SDK handles the response deserialization — the API-side code_interpreter executes correctly, but the final message output item with the text response is missing from the parsed response on v2.20.0.
- Lenguaje dominante
- Python
- Estrellas
- 31.8k
- Forks
- 7.3k
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 131
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- 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 openai/openai-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
openai/openai-python#4022 · 19 comentarios ·
Los mantenedores suelen responder en 1 día
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providersPosiblemente ocupada @mohmedmm la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
openai/openai-python#4017 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Querystring drops explicit empty-string scalar valuesPosiblemente ocupada @sylvesterkaczmarek la tomó hace 32 días. Abiertosdk-breaking-change v4
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
openai/openai-python#3837 ·
Los mantenedores suelen responder en 1 día
-
Define + export `ServiceTiers` string literalPosiblemente ocupada @SparshGarg999 la tomó hace 58 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openai/openai-python#3556 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Empty OPENAI_BASE_URL prevents fallback to default API endpointPosiblemente ocupada @Sehastrajit-S la tomó hace 24 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openai/openai-python#2927 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de openai/openai-python
Issues similares
-
comp/gateway comp/plugins duplicate P3 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NousResearch/hermes-agent#137019 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bot-triaged module: docs triaged
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
new-entry
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BinWang28/audio-ai-hub#194 ·
-
confluence: a paged listing's links re-encode a parameter they carry, where real carries it as sentAbiertofidelity
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día