Skip to content

OpenAIConversationsSession persists empty reasoning item {"type":"reasoning","summary":[]} and Conversations API rejects it as invalid #3268

@Hassan90785

Description

@Hassan90785

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:

Invalid item

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(...).


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions