fix: skip reasoning.summary for o1-pro and gpt-5-chat models#2173
Merged
dgageot merged 1 commit intodocker:mainfrom Mar 19, 2026
Merged
Conversation
Exclude gpt-5-chat* variants from isOpenAIReasoningModel since they are non-reasoning chat models. Add supportsReasoningSummary helper to avoid sending reasoning.summary to o1-pro models which reject that parameter. Fixes docker#2165 Fixes docker#2166 Assisted-By: docker-agent
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
No bugs detected in this PR. The changes correctly implement conditional logic to skip reasoning.summary for models that don't support it (o1-pro and gpt-5-chat variants), while maintaining support for reasoning.effort on o1-pro. The implementation includes:
- Proper case-insensitive string handling
- Comprehensive test coverage for both helper functions
- Clear separation of concerns between reasoning model detection and summary support
- Appropriate debug logging
The fix addresses the reported API rejection issues for these specific models.
rumpl
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2165 and #2166.
The OpenAI API rejects
reasoning.summaryforo1-proandgpt-5-chat-latestmodels. This PR fixes both issues:gpt-5-chat-*variants are excluded fromisOpenAIReasoningModelsince they are non-reasoning chat models and should not receive any reasoning parameters.o1-proremains classified as a reasoning model (soreasoning.effortstill works), but a newsupportsReasoningSummaryhelper skips settingreasoning.summaryfor it.Changes
isOpenAIReasoningModel: early returnfalseforgpt-5-chat*prefixsupportsReasoningSummaryfunction: returnsfalseforo1-pro*modelsCreateResponseStream: conditionally setsreasoning.summaryonly when supportedisOpenAIReasoningModelandsupportsReasoningSummary