UI-TARS-desktop
UI-TARS-desktop copied to clipboard
Incomplete parameter support: gpt-5 models require max_completion_tokens
Description:
The current implementation already supports switching max_tokens/max_completion_tokens for the o-series (o3, o4-mini, etc.) models.
However, with OpenAI's recent API changes, gpt-5 models now require using max_completion_tokens as well, but the current logic does not include this latest naming.
Attempting to use max_tokens with gpt-5 models leads to:
Error: 400 Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.
Suggested improvement:
Update the logic to include gpt-5 and any future models that require this new parameter name.
Related code reference:
[helper.ts#L47-L52](https://github.com/bytedance/UI-TARS-desktop/blob/7a4ff7482a2d37f77ded35b0316b4c2aea42946b/packages/agent-infra/browser-use/src/agent/helper.ts#L47-L52)