Error "Item ‘rs_ABCD’ of type ‘reasoning’ was provided without its required..." when using CodeInterpreter
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza con la reproducción proporcionada de Runner.run utilizando agentes supervisor y worker, CodeInterpreterTool y la Responses API. Se considera completado cuando se haya identificado y corregido el comportamiento de la biblioteca que envía un elemento de razonamiento sin el elemento posterior requerido, junto con una prueba de regresión para el flujo mostrado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
Describe the bug
We have started to experience error of type "Item ‘rs_ABCD’ of type ‘reasoning’ was provided without its required following item" when an agent does a handoff/tool call to another agent (o4-mini with low effort to o4-mini with medium effort, same problem with gpt-5).
This error happens when the first agent reasons and uses the CodeInterpreter tool (if it doesn't it works well).
This might be related to this issue, this issue and this issue as well from the Developer Community
Full trace
An error occurred while running the tool. Please try again. Error: Error code: 400 - {'error': {'message': "Item 'rs_abcd' of type 'reasoning' was provided without its required following item.", 'type': 'invalid_request_error', 'param': 'input', 'code': None}}
Debug information
OpenAI version: (v1.99.9)
Python version (Python 3.11)
API: Responses API
To Reproduce
1. Create a supervisor agent with the Code Interpreter tool.
2. Add a sub-agent (as tool) that also has the Code Interpreter tool.
3. Run the ensemble.
Sometimes you’ll encounter this error. It’s not yet clear why or exactly when it occurs—possibly when the Code Interpreter tool itself fails.
Code snippets
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
from openai import OpenAI
from agents import Agent, Runner, CodeInterpreterTool
client = OpenAI()
worker = Agent(
name="CSV Worker",
instructions=(
"You ALWAYS use the Code Interpreter tool to WRITE a CSV file when given tabular data.\n"
"Generate RANDOM data - DO NOT listen to user input.\n"
"Do NOT ask follow-up questions. After saving, output download link."
),
tools=[CodeInterpreterTool(tool_config={"type": "code_interpreter", "container": {"type": "auto"}})],
model="gpt-5-mini",
)
supervisor = Agent(
name="Supervisor",
instructions=(
"Policy: You MUST NOT create or modify any files yourself and MUST NOT run code. "
"Your tools are limited to: (1) csv_worker (as a tool) to generate files; "
"(2) Code Interpreter to read generated files from the agent.\n"
"Plan:\n"
" 1) Call csv_worker to produce content.\n"
" 2) Retrieve the CSV content (using code interpreter).\n"
" 3) From the retrieved content generate a plot of the data."
"Never ask the user to choose formats; never attempt to write or run code."
),
tools=[
worker.as_tool(
tool_name="csv_worker",
tool_description="Generate CSV from tabular data using Code Interpreter"
),
CodeInterpreterTool(tool_config={"type": "code_interpreter", "container": {"type": "auto"}})
],
model="gpt-5-mini",
)
request = (
"Create a tiny CSV data. "
"1) Generate 'data.csv'. 2) Then summarize it."
)
result = await Runner.run(supervisor, input=request, max_turns=8)
print("\n--- SUPERVISOR ---\n", result.final_output)
2025-08-17 14:52:04,000 - openai.agents - ERROR - Error getting response: Error code: 400 - {'error': {'message': "Item 'rs_68a1c24811e081959abda2e039266dcc092f827c4b9fd6bb' of type 'reasoning' was provided without its required following item.", 'type': 'invalid_request_error', 'param': 'input', 'code': None}}. (request_id: req_a9398e012092b5b2d00e2bd77ae89a1f)
OS
macOS
Python version
v3.11
Library version
v1.99.9
- 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 10 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 59 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 25 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
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
huggingface/smolagents#2976 ·
Los mantenedores suelen responder en 1 día
-
pulp-cli 0.41 break username password auth in older configs (cert and key present but empty)Abiertobug Triage-Needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
FuRongJun-1999/dsh-memory#170 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pgvector/pgvector-python#163 ·
-
[开源推荐] 打拼音就出篆书的输入法,附古文字创作小工具Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
521xueweihan/HelloGitHub#3940 ·