Describe the bug
OpenAI models with reasoning capabilities will return reasoning messages in responses. OpenAIResponseAgent does not remove reasoning messages in subsequent API call after a tool call, causing an API error:
HTTP 400 (invalid_request_error: )
Parameter: input
Item with id 'rs_***' not found. Items are not persisted when `store` is set to false. Try again with `store` set to true, or remove this item from your input.
To Reproduce
Steps to reproduce the behavior:
- Create
OpenAIResponseAgent with a reasoning model (GPT-5, o4-mini, ...) and tools
- Send a message to agent that triggers a tool call
- See error
Expected behavior
Reasoning messages should be removed in subsequent API call after a tool call.
Screenshots
N/A
Platform
- Language: C#
- Source: NuGet Microsoft.SemanticKernel.Agents.OpenAI 1.61.0-preview
- AI model: OpenAI:GPT-5
- IDE: Visual Studio
- OS: Windows
Additional context
N/A
Describe the bug
OpenAI models with reasoning capabilities will return reasoning messages in responses.
OpenAIResponseAgentdoes not remove reasoning messages in subsequent API call after a tool call, causing an API error:To Reproduce
Steps to reproduce the behavior:
OpenAIResponseAgentwith a reasoning model (GPT-5, o4-mini, ...) and toolsExpected behavior
Reasoning messages should be removed in subsequent API call after a tool call.
Screenshots
N/A
Platform
Additional context
N/A