Skip to content

Add support for "max_completion_tokens" for OpenAI endpoint #30

@fahim-choudhury

Description

@fahim-choudhury

OpenCodeReview Version

open-code-review v1.1.12 (fe647bc) linux/amd64 built at: 2026-06-03T01:35:05Z https://github.com/alibaba/open-code-review

Operating System

Linux (x86_64)

Installation Method

npm (global)

LLM Provider

OpenAI

Bug Description

When I run ocr llm test, the following error is observed:

Error: llm request failed: API error 400: Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.

Steps to Reproduce

Here's the configuration in ~/.zshrc

# Open Code Review
export OCR_LLM_URL=https://api.openai.com/v1/chat/completions
export OCR_LLM_TOKEN=$OPENAI_API_KEY
export OCR_LLM_MODEL=gpt-5.4
export OCR_USE_ANTHROPIC=false

Expected Behavior

The tool should support max_completion_tokens and ocr llm test should succeed.

Logs / Error Output

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions