Skip to content

Commit 69cc4c0

Browse files
committed
Fix gpt-5-chat-latest model not supported error
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: #2166 Signed-off-by: Md Yunus <admin@yunuscollege.eu.org> Co-authored-by: Md Yunus <admin@yunuscollege.eu.org>
1 parent 3ff5495 commit 69cc4c0

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

pkg/model/provider/openai/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,10 @@ func isResponsesModel(model string) bool {
903903

904904
func isOpenAIReasoningModel(model string) bool {
905905
m := strings.ToLower(model)
906+
// Exclude -chat-latest variants which don't support reasoning parameters
907+
if strings.Contains(m, "-chat-latest") {
908+
return false
909+
}
906910
return strings.HasPrefix(m, "o1") ||
907911
strings.HasPrefix(m, "o3") ||
908912
strings.HasPrefix(m, "o4") ||

pkg/model/provider/openai/thinking_budget_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ func TestIsOpenAIReasoningModel(t *testing.T) {
4040
{"gpt-5-turbo", "gpt-5-turbo", true},
4141
{"GPT-5 uppercase", "GPT-5", true},
4242

43+
// GPT-5 -chat-latest variants - should NOT support reasoning
44+
{"gpt-5-chat-latest", "gpt-5-chat-latest", false},
45+
{"gpt-5-chat-latest with suffix", "gpt-5-chat-latest-2025-10-01", false},
46+
{"GPT-5-CHAT-LATEST uppercase", "GPT-5-CHAT-LATEST", false},
47+
4348
// GPT-4 series models - should NOT support reasoning
4449
{"gpt-4", "gpt-4", false},
4550
{"gpt-4o", "gpt-4o", false},

0 commit comments

Comments
 (0)