Bug Report
Environment
- Package version: 0.10.0
- Node version: 22.18.0 (via Volta)
- Error location:
openai/core/error.mjs:41
Error Message
file:///Users/ryotamurakami/.volta/tools/image/packages/@laststance/git-gpt-commit/lib/node_modules/@laststance/git-gpt-commit/node_modules/openai/core/error.mjs:41
return new BadRequestError(status, error, message, headers);
^
BadRequestError: 400 Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.
Description
OpenAI has deprecated the max_tokens parameter in newer API versions and models (particularly the o1 series). The parameter has been renamed to max_completion_tokens.
Suggested Fix
Replace all instances of max_tokens with max_completion_tokens in the OpenAI API calls.
Temporary Workaround
Users experiencing this issue can:
- Use an older model that still supports
max_tokens
- Downgrade to an older version of the package
- Wait for the fix to be released
References