Skip to content

[upstream #17200] #17200: Explicit Gemini thinking levels are dropped on Gemini-compatible custom endpoints #391

Open

Description

@berry-13

On a custom endpoint with customParams.defaultParamsEndpoint: google, getGoogleConfig builds the selected thinkingConfig.thinkingLevel, but transformToOpenAIConfig drops it through googleExcludeParams (packages/api/src/endpoints/openai/transform.ts) and never sends reasoning_effort. The gateway then uses the model's default level, so a user's low or high choice has no effect.

This is on dev for every Gemini 3+ model on that path (3.5 to 3.8 Flash, 3.1 Pro), not only Gemini 4 Argon. Google's OpenAI compatibility maps reasoning_effort to thinking_level (Argon: minimal and low to LOW, medium to MEDIUM, high to HIGH; https://ai.google.dev/gemini-api/docs/openai), so the fix is to translate an explicit thinkingLevel into reasoning_effort on that path, and to send nothing when it is unset so the model default applies.

Raised by Codex on LibreChat-AI#17200 (the Gemini 4 Argon support PR); deferred because the code path predates that PR and affects every Gemini 3+ model.

Activity

  1. added
    bugSomething isn't working
    readyreviewctl followups state
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: packagesreviewctl followups statebugSomething isn't workingreadyreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions