-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
Description
Please read this first
- Have you read the docs? Agents SDK docs
- Have you searched for related issues? Others may have faced similar issues.
Describe the bug
In certain scenarios, the Agents SDK returns the following error:
Example:
openai.NotFoundError: Error code: 404 - {'error': {'message': "Item with id 'rs_3c4caff36e34c099006900f0e3c66481909c15ac262a15b060' not found.", 'type': 'invalid_request_error', 'param': 'input', 'code': None}}
Configuration:
- Store is not set to
False - Using default session management:
SQLiteSession - All items stored in the database are sent back to the agent for each turn
- Multi-agent system architecture with handoffs:
- Agent 1:
gpt-5with minimal reasoning (acts as the triage agent) - Agent 2:
gpt-5with medium reasoning - Agent 3:
gpt-5with low reasoning
- Agent 1:
Issue:
Agent 1 generates an empty reasoning item as shown below:
8|f00b2f3b-770b-4f40-9ca3-ae7700940a19_6555bacd-f286-42b3-9f25-e7a9ae94e3de|{"id":"rs_3c4caff36e34c099006900f0e3c66481909c15ac262a15b060","summary":[],"type":"reasoning"}|2025-10-28 16:36:16
After several steps (including outputs produced by Agent 2 and Agent 3), when Agent 1 regains control and any new message is passed, the error above is triggered.
Debug information
- Agents SDK version:
0.2.8 - Python version: Python 3.11.6
Repro steps
While the code that triggers this error in our system involves multiple agents and handoffs, the following simplified code reproduces the same error:
import asyncio
import random
from agents import (
Agent,
ItemHelpers,
Runner,
enable_verbose_stdout_logging,
function_tool,
)
enable_verbose_stdout_logging()
@function_tool
def how_many_jokes() -> int:
"""Return a random integer of jokes to tell between 1 and 10 (inclusive)."""
return random.randint(1, 10)
ORIGINAL_RS_ID = "rs_07a11282cddc7074006905172505c88198bd41b4889a8d5649"
def mangle_rs_id(original_rs_id: str) -> str:
return original_rs_id[:-2] + "ff"
async def main():
agent = Agent(
name="Joker",
instructions="Call the `how_many_jokes` tool once, and tell that many jokes.",
tools=[how_many_jokes],
model="gpt-5-nano",
)
rs_id = mangle_rs_id(ORIGINAL_RS_ID)
input_list = [
{"content": "We want to hear jokes", "role": "user"},
{
"id": rs_id,
"summary": [],
"type": "reasoning",
},
{
"arguments": "{}",
"call_id": "call_xkkWToQpzfvn0asJfDPo06Wj",
"name": "how_many_jokes",
"type": "function_call",
"id": "fc_07a11282cddc707400690517253a148198a2dad52c744c22ce",
"status": "completed",
},
{
"call_id": "call_xkkWToQpzfvn0asJfDPo06Wj",
"output": "7",
"type": "function_call_output",
},
]
result = Runner.run_streamed(
agent,
input=input_list,
)
async for event in result.stream_events():
if (
event.type == "run_item_stream_event"
and event.item.type == "message_output_item"
):
print(f"-- Message output:\n {ItemHelpers.text_message_output(event.item)}")
if __name__ == "__main__":
asyncio.run(main())Expected behavior
The SDK should not error out, as we are not modifying or altering any reasoning items.