Error "Item ‘rs_ABCD’ of type ‘reasoning’ was provided without its required..." when using CodeInterpreter
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
supervisor エージェントと worker エージェント、CodeInterpreterTool、Responses API を使用した、提供されている Runner.run の再現から始めてください。完了条件は、必要な後続アイテムなしで reasoning item を送信するライブラリの動作を特定して修正し、提示されたフローの回帰テストを追加することです。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 31.8k
- フォーク
- 8k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 137
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openai/openai-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openai/openai-python#4022 · コメント 19 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(auth): SubjectTokenProviderError drops response and duplicates error message in workload identity providers対応中かも @mohmedmm が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#4017 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Querystring drops explicit empty-string scalar values対応中かも @sylvesterkaczmarek が 34 日前に担当しました。 オープンsdk-breaking-change v4
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
openai/openai-python#3837 ·
メンテナーはふだん 1 日以内に返信
-
Define + export `ServiceTiers` string literal対応中かも @SparshGarg999 が 60 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#3556 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Empty OPENAI_BASE_URL prevents fallback to default API endpoint対応中かも @Sehastrajit-S が 26 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-python#2927 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
openai/openai-python の issue をすべて見る
似ている issue
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunk対応中かも @rodricksz4h5 が今日担当しました。 オープンarea/streaming comp/gateway P2 type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#138245 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS step対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
correction metadata
難易度 2/5 1時間未満 初心者へのやさしさ 68/100
acl-org/acl-anthology#10378 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom name対応中かも @12YYCCYY16 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
prowler-cloud/prowler#13033 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
graygarbage/HermesKey#23 ·