Description
Summary
When ChatClientAgent merges per-request ChatOptions with the agent-level ChatOptions, the Reasoning property is not included in the merge. This means that any ReasoningOptions configured on the agent (e.g. Effort, Output) are silently dropped whenever a caller also supplies their own ChatOptions.
Affected file
src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs — the MergeChatOptions block starting around line 545.
Root cause
The merge block applies all nullable ChatOptions properties using ??=, but Reasoning was missing from the list:
// before fix — Reasoning absent
requestChatOptions.PresencePenalty ??= this._agentOptions.ChatOptions.PresencePenalty;
requestChatOptions.ResponseFormat ??= this._agentOptions.ChatOptions.ResponseFormat;
// Reasoning skipped here
requestChatOptions.Seed ??= this._agentOptions.ChatOptions.Seed;
Code Sample
Create an agent with follow ChatClientAgentOptions:
var agentOptions = new ChatClientAgentOptions
{
ChatOptions = new ChatOptions
{
Reasoning = new ReasoningOptions
{
Effort = ReasoningEffort.ExtraHigh,
Output = ReasoningOutput.Full
}
}
};
Then invoke the agent while also supplying a per-request ChatOptions object. The Reasoning values from agentOptions will not be applied to the request.
var runOptions = new ChatClientAgentRunOptions
{
ChatOptions = new ChatOptions
{
Instructions = "test"
}
};
Error Messages / Stack Traces
Package Versions
Microsoft.Agents.AI v1.0.0
.NET Version
.NET 10
Additional Context
Fix
Add the missing line in the merge block:
requestChatOptions.Reasoning ??= this._agentOptions.ChatOptions.Reasoning;
Impact
Any agent configured with reasoning-capable models that also receives per-request ChatOptions will silently lose its reasoning configuration. The regression is behaviorally silent — no exception is thrown — making it easy to miss.
Description
Summary
When
ChatClientAgentmerges per-requestChatOptionswith the agent-levelChatOptions, theReasoningproperty is not included in the merge. This means that anyReasoningOptionsconfigured on the agent (e.g.Effort,Output) are silently dropped whenever a caller also supplies their ownChatOptions.Affected file
src/Microsoft.Agents.AI/ChatClient/ChatClientAgent.cs— theMergeChatOptionsblock starting around line 545.Root cause
The merge block applies all nullable
ChatOptionsproperties using??=, butReasoningwas missing from the list:Code Sample
Create an agent with follow
ChatClientAgentOptions:Then invoke the agent while also supplying a per-request
ChatOptionsobject. TheReasoningvalues fromagentOptionswill not be applied to the request.Error Messages / Stack Traces
Package Versions
Microsoft.Agents.AI v1.0.0
.NET Version
.NET 10
Additional Context
Fix
Add the missing line in the merge block:
Impact
Any agent configured with reasoning-capable models that also receives per-request
ChatOptionswill silently lose its reasoning configuration. The regression is behaviorally silent — no exception is thrown — making it easy to miss.