-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Open
Copy link
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codebugSomething isn't workingSomething isn't workingtriage
Description
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
Metadata
Metadata
Assignees
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codebugSomething isn't workingSomething isn't workingtriage