You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI Answer stops working on 23 October: the gpt-3.5-turbo default shuts down, and its replacement rejects max_tokens #402
When no model is set, the AI Answer pipeline stage and the OpenAI plugin default to gpt-3.5-turbo with 300 max tokens (plugins/pipelines/ai_answer.go:109-122, plugins/openai/util.go:30-32). OpenAI shuts down gpt-3.5-turbo on 23 October 2026 and names gpt-5.6-terra. BuildChatGPTBody always sends the limit as max_tokens (plugins/openai/util.go:1267), and terra replies:
Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.
The same applies to anyone who sets a gpt-5* model in their config today, since max_tokens is always sent.
Fix — either one (both tested live with your default prompt):
One line each: default to gpt-4.1-mini (not retiring; accepts max_tokens) in ai_answer.go:109 and util.go:30.
Support the replacement: send the limit as max_completion_tokens for gpt-5* models. With 300, terra answered normally.
// If maxTokens is passed, inject it in the request body
if maxTokens != nil {
- requestBodyAsMap["max_tokens"] = *maxTokens+ if strings.HasPrefix(model, "gpt-5") {+ requestBodyAsMap["max_completion_tokens"] = *maxTokens+ } else {+ requestBodyAsMap["max_tokens"] = *maxTokens+ }
}
I'd like to work on this issue. I'll investigate the existing OpenAI request construction, determine the most compatible fix for gpt-5* models while preserving existing behavior, and add the necessary regression tests.
Thanks for offering, @nisatsama! Since I had the fix ready and tested live from writing this issue, I've opened it as #403 so it's in before the 23rd. Reviews welcome.
Activity
nisatsama commentedon Oct 6, 2026
I'd like to work on this issue. I'll investigate the existing OpenAI request construction, determine the most compatible fix for
gpt-5*models while preserving existing behavior, and add the necessary regression tests.Lakshya-0910 commentedon Oct 6, 2026
Thanks for offering, @nisatsama! Since I had the fix ready and tested live from writing this issue, I've opened it as #403 so it's in before the 23rd. Reviews welcome.