Skip to content

Fix gpt-5-chat-latest model not supported error#2171

Closed
yunus25jmi1 wants to merge 1 commit intodocker:mainfrom
yunus25jmi1:fix/gpt-5-chat-latest-reasoning
Closed

Fix gpt-5-chat-latest model not supported error#2171
yunus25jmi1 wants to merge 1 commit intodocker:mainfrom
yunus25jmi1:fix/gpt-5-chat-latest-reasoning

Conversation

@yunus25jmi1
Copy link
Contributor

Description

Fixes issue #2166 where the gpt-5-chat-latest model was incorrectly treated as a reasoning model, causing a 400 Bad Request error due to the unsupported reasoning.summary parameter.

Root Cause

The isOpenAIReasoningModel() function in pkg/model/provider/openai/client.go was returning true for all models starting with gpt-5, but the -chat-latest variants are non-reasoning models that don't support the reasoning.summary parameter.

Changes

pkg/model/provider/openai/client.go

  • Updated isOpenAIReasoningModel() to exclude models containing -chat-latest in their name
  • Added comment explaining the exclusion

pkg/model/provider/openai/thinking_budget_test.go

  • Added test cases for gpt-5-chat-latest and similar variants to ensure they're correctly identified as non-reasoning models

Verification

  • ✅ All existing tests pass
  • ✅ New test cases for gpt-5-chat-latest variants pass
  • ✅ Race detector tests pass (go test -race)
  • ✅ go vet passes with no issues
  • ✅ gosec security scan passes
  • ✅ Code is properly formatted (gofmt)

Testing

The fix was verified with:

  • Unit tests for TestIsOpenAIReasoningModel including new test cases
  • Full test suite (go test ./... -short)
  • Race detector (go test -race)
  • Security scanning with gosec

Related Issue

Fixes #2166

@yunus25jmi1 yunus25jmi1 requested a review from a team as a code owner March 19, 2026 14:11
Exclude gpt-5-chat-latest variants from reasoning model detection to prevent
sending unsupported reasoning.summary parameter.

The gpt-5-chat-latest model variant does not support the reasoning.summary
parameter, causing 400 Bad Request errors when the Responses API is used.

Fixes: docker#2166

Signed-off-by: Md Yunus <admin@yunuscollege.eu.org>
@yunus25jmi1 yunus25jmi1 force-pushed the fix/gpt-5-chat-latest-reasoning branch 2 times, most recently from d043d19 to 3ca8c33 Compare March 19, 2026 14:20
@yunus25jmi1
Copy link
Contributor Author

Closing to recreate with proper attribution details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openai/gpt-5-chat-latest not supported

1 participant