When using AzureOpenAIResponsesClient with ChatAgent.run(), the reasoning parameter is silently ignored and not sent to the Azure OpenAI Responses API. This prevents access to reasoning summaries from GPT-5 series models.
Environment
- Python: 3.11
- agent-framework: 1.0.0b251001
- Model: gpt-5-mini (Azure OpenAI)
- API Version:
preview
- Endpoint:
/openai/v1/responses
Minimal Reproduction
import asyncio
import json
from agent_framework import ChatAgent
from agent_framework.azure import AzureOpenAIResponsesClient
from azure.identity import AzureCliCredential
async def main():
client = AzureOpenAIResponsesClient(
credential=AzureCliCredential(),
deployment_name="gpt-5-mini",
endpoint="https://YOUR-RESOURCE.openai.azure.com",
api_version="preview"
)
# Intercept payload to see what's sent
original_create = client.client.responses.create
async def capture(**kwargs):
print("Payload:", json.dumps(kwargs, indent=2, default=str))
return await original_create(**kwargs)
client.client.responses.create = capture
agent = ChatAgent(chat_client=client, instructions="You are helpful.")
thread = agent.get_new_thread()
# Pass reasoning parameter
result = await agent.run(
"What is 2+2?",
thread=thread,
reasoning={"effort": "medium", "summary": "auto"} # IGNORED!
)
# Check response
response = result.raw_representation.raw_representation
has_summary = any('Reasoning' in type(i).__name__ and i.summary
for i in response.output)
print(f"Has reasoning summary: {has_summary}") # False
asyncio.run(main())
Expected Behavior
Payload should include:
{
"model": "gpt-5-mini",
"input": [...],
"reasoning": {
"effort": "medium",
"summary": "auto"
}
}
Response should contain: ResponseReasoningItem with populated summary field.
Actual Behavior
Payload sent (reasoning missing):
{
"model": "gpt-5-mini",
"input": [...],
"store": false
}
Response: No reasoning summary generated.
Root Cause
ChatOptions (_types.py) has no reasoning parameter
_prepare_options() (openai/_responses_client.py) does not extract or forward reasoning to the API
Proof
Tested three scenarios:
- Direct OpenAI SDK: ✅ reasoning sent, summary received
- Agent Framework (unpatched): ❌ reasoning NOT sent, NO summary
- Agent Framework (patched): ✅ reasoning sent, summary received
The fix works when reasoning is manually added to the payload.
Workaround
Monkeypatch _prepare_options():
original_prepare = client._prepare_options
def patched_prepare(messages, chat_options):
opts = original_prepare(messages, chat_options)
if hasattr(chat_options, 'additional_properties'):
if 'reasoning' in chat_options.additional_properties:
opts['reasoning'] = chat_options.additional_properties['reasoning']
return opts
client._prepare_options = patched_prepare
# Then use additional_properties to pass reasoning
result = await agent.run(
"...",
additional_properties={"reasoning": {"effort": "medium", "summary": "auto"}}
)
Impact
Users cannot access reasoning summaries from Azure OpenAI reasoning models (GPT-5 series) through Agent Framework, despite this being a documented feature of the Responses API.
Suggested Fix
Add reasoning parameter to:
ChatOptions.__init__()
_prepare_options() to forward it to the API payload
ChatAgent.run() signature
Full investigation with evidence: Available upon request (payload captures, assertions, tools+reasoning coexistence tests).
When using
AzureOpenAIResponsesClientwithChatAgent.run(), thereasoningparameter is silently ignored and not sent to the Azure OpenAI Responses API. This prevents access to reasoning summaries from GPT-5 series models.Environment
preview/openai/v1/responsesMinimal Reproduction
Expected Behavior
Payload should include:
{ "model": "gpt-5-mini", "input": [...], "reasoning": { "effort": "medium", "summary": "auto" } }Response should contain:
ResponseReasoningItemwith populatedsummaryfield.Actual Behavior
Payload sent (reasoning missing):
{ "model": "gpt-5-mini", "input": [...], "store": false }Response: No reasoning summary generated.
Root Cause
ChatOptions(_types.py) has noreasoningparameter_prepare_options()(openai/_responses_client.py) does not extract or forwardreasoningto the APIProof
Tested three scenarios:
The fix works when
reasoningis manually added to the payload.Workaround
Monkeypatch
_prepare_options():Impact
Users cannot access reasoning summaries from Azure OpenAI reasoning models (GPT-5 series) through Agent Framework, despite this being a documented feature of the Responses API.
Suggested Fix
Add
reasoningparameter to:ChatOptions.__init__()_prepare_options()to forward it to the API payloadChatAgent.run()signatureFull investigation with evidence: Available upon request (payload captures, assertions, tools+reasoning coexistence tests).