Skip to content

fix: rename max_tokens to max_completion_tokens for newer OpenAI models#1828

Open
0xSkybreaker wants to merge 1 commit into
decolua:masterfrom
0xSkybreaker:fix/openai-max-completion-tokens
Open

fix: rename max_tokens to max_completion_tokens for newer OpenAI models#1828
0xSkybreaker wants to merge 1 commit into
decolua:masterfrom
0xSkybreaker:fix/openai-max-completion-tokens

Conversation

@0xSkybreaker

Copy link
Copy Markdown

@

Summary

Fixes #1745 — newer OpenAI models (gpt-5.4-nano, gpt-5.4-mini, o4-mini, etc.) reject max_tokens with HTTP 400:

"Unsupported parameter: max_tokens is not supported with this model.
Use max_completion_tokens instead."

Fix

DefaultExecutor now auto-renames max_tokensmax_completion_tokens for models matching the gpt-5|o[134]- pattern — the same logic already present in GithubExecutor (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 use max_tokens as before.

Files changed

  • open-sse/executors/default.js — add requiresMaxCompletionTokens() check in transformRequest()

🤖 Generated with Claude Code
@

@
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>
@
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.

Bug: max_tokens not supported for newer OpenAI models (gpt-5.4-nano, gpt-5.4-mini, etc.)

1 participant