Please read this first
- Have you read the docs?Agents SDK docs
- Have you searched for related issues? Others may have faced similar issues.
Body:
## Summary
When using `OpenAIConversationsSession` with:
- model: `gpt-5.4-mini`
- reasoning: `low` <could be any>
the SDK persists an empty reasoning item shaped like:
```json
{"type":"reasoning","summary":[]}
The Conversations API rejects that item with:
This reproduces during session persistence, not in app-side serialization.
Environment
openai-agents==0.17.0
openai==2.36.0
- Windows
OpenAIConversationsSession
- model:
gpt-5.4-mini
- reasoning:
low
Actual behavior
At the end of a simple run, the session persistence layer attempts to save:
[
{"summary": [], "type": "reasoning"},
{
"content": [
{
"annotations": [],
"text": "Hey! I’m doing well, thanks for asking 😄\nHow can I help you today?",
"type": "output_text",
"logprobs": []
}
],
"role": "assistant",
"status": "completed",
"type": "message",
"phase": "final_answer"
}
]
The Conversations API responds with:
BadRequestError: Error code: 400 - {
"error": {
"message": "Invalid item",
"type": "invalid_request_error",
"param": "item",
"code": "invalid_item"
}
}
Expected behavior
OpenAIConversationsSession should not attempt to persist a reasoning item in a shape the Conversations API rejects.
Either:
- omit this empty reasoning item entirely, or
- normalize it into a valid persisted item shape
Repro characteristics
This reproduces even without attachments or file search. A simple conversational prompt is enough.
In my logs, the rejected payload is:
filter: rejected payload=[{"summary": [], "type": "reasoning"}, {"content": [...], "role": "assistant", "status": "completed", "type": "message", "phase": "final_answer"}]
The item-level retry isolates the failure to the reasoning item:
filter: [0] FAILED type=reasoning err=BadRequestError("Error code: 400 - {'error': {'message': 'Invalid item', 'type': 'invalid_request_error', 'param': 'item', 'code': 'invalid_item'}}")
filter: [0] item={"summary": [], "type": "reasoning"}
Why this looks like an SDK/session persistence issue
This happens inside the OpenAIConversationsSession persistence path when saving run results back into the conversation store.
The item being persisted is already invalid for the Conversations API:
{"type":"reasoning","summary":[]}
So the session layer appears to be replaying/persisting a reasoning artifact that should not be sent as a conversation item in that form.
Minimal repro idea
- create an
Agent
- use
OpenAIConversationsSession
- use
gpt-5.4-mini with reasoning set to low
- run a simple prompt
- at persistence time, session tries to save:
{"type":"reasoning","summary":[]}
- Conversations API rejects it with
invalid_item
Request
Please update OpenAIConversationsSession / session persistence so empty reasoning items are not persisted in an invalid Conversations item shape.
A payload like:
{"type":"reasoning","summary":[]}
should not be sent to conversations.items.create(...).
Please read this first
Body:
The Conversations API rejects that item with:
This reproduces during session persistence, not in app-side serialization.
Environment
openai-agents==0.17.0openai==2.36.0OpenAIConversationsSessiongpt-5.4-minilowActual behavior
At the end of a simple run, the session persistence layer attempts to save:
[ {"summary": [], "type": "reasoning"}, { "content": [ { "annotations": [], "text": "Hey! I’m doing well, thanks for asking 😄\nHow can I help you today?", "type": "output_text", "logprobs": [] } ], "role": "assistant", "status": "completed", "type": "message", "phase": "final_answer" } ]The Conversations API responds with:
Expected behavior
OpenAIConversationsSessionshould not attempt to persist a reasoning item in a shape the Conversations API rejects.Either:
Repro characteristics
This reproduces even without attachments or file search. A simple conversational prompt is enough.
In my logs, the rejected payload is:
The item-level retry isolates the failure to the reasoning item:
Why this looks like an SDK/session persistence issue
This happens inside the
OpenAIConversationsSessionpersistence path when saving run results back into the conversation store.The item being persisted is already invalid for the Conversations API:
{"type":"reasoning","summary":[]}So the session layer appears to be replaying/persisting a reasoning artifact that should not be sent as a conversation item in that form.
Minimal repro idea
AgentOpenAIConversationsSessiongpt-5.4-miniwith reasoning set tolow{"type":"reasoning","summary":[]}invalid_itemRequest
Please update
OpenAIConversationsSession/ session persistence so empty reasoning items are not persisted in an invalid Conversations item shape.A payload like:
{"type":"reasoning","summary":[]}should not be sent to
conversations.items.create(...).