Error "Item ‘rs_ABCD’ of type ‘reasoning’ was provided without its required..." when using CodeInterpreter
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia con la riproduzione fornita di Runner.run utilizzando agenti supervisor e worker, CodeInterpreterTool e la Responses API. Il lavoro è completato quando viene identificato e corretto il comportamento della libreria che invia un elemento di ragionamento senza il successivo elemento richiesto, con un test di regressione per il flusso dimostrato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 31.8k
- Fork
- 8k
- Merge medio
- 1g 1h
- PR unite (30g)
- 137
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openai/openai-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openai/openai-python#4022 · 19 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providersForse già presa @mohmedmm l’ha presa 11 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
openai/openai-python#4017 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Querystring drops explicit empty-string scalar valuesForse già presa @sylvesterkaczmarek l’ha presa 34 giorni fa. Apertasdk-breaking-change v4
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
openai/openai-python#3837 ·
I maintainer di solito rispondono entro 1 giorno
-
Define + export `ServiceTiers` string literalForse già presa @SparshGarg999 l’ha presa 60 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
openai/openai-python#3556 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Empty OPENAI_BASE_URL prevents fallback to default API endpointForse già presa @Sehastrajit-S l’ha presa 27 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
openai/openai-python#2927 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openai/openai-python
Issue simili
-
[Bug]: LangGraph Store sync put bypasses namespace validationForse già presa @ktz03 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
volcengine/OpenViking#6050 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunkForse già presa @rodricksz4h5 l’ha presa oggi. Apertaarea/streaming comp/gateway P2 type/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#138245 ·
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS stepForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
correction metadata
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 68/100
acl-org/acl-anthology#10378 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom nameForse già presa @12YYCCYY16 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
prowler-cloud/prowler#13033 ·
I maintainer di solito rispondono entro 1 giorno