Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Error "Item ‘rs_ABCD’ of type ‘reasoning’ was provided without its required..." when using CodeInterpreter

Abierto
#2,561 7 comentarios 5 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python
Área
api

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

bug
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

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openai/openai-python

Todos los issues de openai/openai-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.