Skip to content
Changelog

GPT-5 and GPT-6 keep their reasoning through tool calls on Responses

October 8, 20261 min read

Agno's OpenAIResponses._using_reasoning_model() now matches IDs starting with gpt-6 next to o3, o4-mini and gpt-5, and OpenRouterResponses matches openai/gpt-5 and openai/gpt-6 next to openai/o3 and openai/o4. That check decides how Agno sends the turn that returns a tool result.

For a reasoning model on OpenAI, Agno stores the response and continues from its previous_response_id, so the API still holds the reasoning item each tool call is tied to. OpenRouter is stateless, so Agno asks for reasoning.encrypted_content and replays that item with the call. When the check missed a model, the follow-up went out with neither and could fail with a missing reasoning-item error.

We built the request after one lookup tool call, with a stored response ID and an encrypted reasoning item on the assistant message, and printed the parameters each class sends.

# Before (real output)
OpenAIResponses(id='gpt-6-sol')._using_reasoning_model() -> False
OpenRouterResponses(id='openai/gpt-5.6-luna')._using_reasoning_model() -> False
OpenRouterResponses(id='openai/gpt-6-sol')._using_reasoning_model() -> False
OpenAIResponses gpt-6-sol follow-up: {'store': None, 'previous_response_id': None, 'include': None}
OpenRouterResponses openai/gpt-6-sol follow-up: {'store': False, 'previous_response_id': None, 'include': None}
 
# Now (real output)
OpenAIResponses(id='gpt-6-sol')._using_reasoning_model() -> True
OpenRouterResponses(id='openai/gpt-5.6-luna')._using_reasoning_model() -> True
OpenRouterResponses(id='openai/gpt-6-sol')._using_reasoning_model() -> True
OpenAIResponses gpt-6-sol follow-up: {'store': True, 'previous_response_id': 'resp_previous', 'include': None}
OpenRouterResponses openai/gpt-6-sol follow-up: {'store': False, 'previous_response_id': None, 'include': ['reasoning.encrypted_content']}

gpt-5 IDs on OpenAIResponses already matched and behave as before.

See the OpenRouter tool use cookbook, and learn more about OpenAI Responses and OpenRouter Responses in the documentation.

Frequently asked questions

IDs that start with o3, o4-mini, gpt-5 or gpt-6, so gpt-6-sol and gpt-6.1-sol both qualify.

IDs that start with openai/o3, openai/o4, openai/gpt-5 or openai/gpt-6. Other OpenRouter IDs, including openai/gpt-oss-20b, keep the non-reasoning path.

Agno did not recognise the model as a reasoning model, so the request that returned the tool result went out without the reasoning state the call belongs to. Upgrading fixes it with no code change.

Shipped around the same time