fix: rename max_tokens to max_completion_tokens for newer OpenAI models#1828
Open
0xSkybreaker wants to merge 1 commit into
Open
fix: rename max_tokens to max_completion_tokens for newer OpenAI models#18280xSkybreaker wants to merge 1 commit into
0xSkybreaker wants to merge 1 commit into
Conversation
fix: rename max_tokens to max_completion_tokens for newer OpenAI models Newer OpenAI models (gpt-5+, o1, o3, o4) reject max_tokens with HTTP 400: "Unsupported parameter: max_tokens is not supported with this model. Use max_completion_tokens instead." DefaultExecutor now auto-renames max_tokens -> max_completion_tokens for these models, matching the behavior already present in GithubExecutor. Fixes decolua#1745 Co-Authored-By: Claude <noreply@anthropic.com> @
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 #1745 — newer OpenAI models (
gpt-5.4-nano,gpt-5.4-mini,o4-mini, etc.) rejectmax_tokenswith HTTP 400:Fix
DefaultExecutornow auto-renamesmax_tokens→max_completion_tokensfor models matching thegpt-5|o[134]-pattern — the same logic already present inGithubExecutor(open-sse/executors/github.js).Models affected:
gpt-5,gpt-5.4,gpt-5.4-mini,gpt-5.4-nano,o1,o3,o4-mini, and any other GPT-5 / o-series model.Models not affected:
gpt-4o,gpt-4o-mini,gpt-4.1, Claude models, Gemini models, etc. — they continue to usemax_tokensas before.Files changed
open-sse/executors/default.js— addrequiresMaxCompletionTokens()check intransformRequest()🤖 Generated with Claude Code
@