发布

  • [OPIK-6539] [BE][FE] fix: suppress Gemma reasoning, bump deprecated Gemini/Vertex default models (#6706)

    frostbyte_neo 发布于 2026-05-14 12:57:56 +00:00

    • [OPIK-6539] [BE] fix: suppress Gemma reasoning trace in Gemini responses

    Forces returnThinking=false on the LangChain4j Gemini chat / streaming
    clients so thought=true parts from Gemma 4 are dropped before the
    response text is built.

    Gemma 4 always returns thought parts via Google's AI Studio API, even
    when thinkingConfig.includeThoughts=false (and thinkingBudget=0 is
    rejected as unsupported). LangChain4j's PartsAndContentsMapper#fromGPartsToAiMessage
    has a three-state returnThinking flag — null (default) concatenates
    thoughts into the response text, TRUE returns them as a separate
    field, FALSE discards them. We were on null, which is why the
    reasoning trace showed up at the top of the Playground output for
    gemma-4-31b-it and gemma-4-26b-a4b-it.

    Setting it to FALSE matches existing Gemini 2.5 / 3 behavior, where
    the API itself suppresses thought parts unless the client opts in.

    Implements OPIK-6539: Gemma 4 reasoning trace leaks into Playground
    response body.

    • fix(playground): bump deprecated Gemini/Vertex default models in provider dropdown

    The Gemini provider's hardcoded default was GEMINI_3_PRO
    (gemini-3-pro-preview), which has a past deprecation_date in the
    LiteLLM prices JSON and is therefore excluded from the dropdown by the
    sync script's deprecated-model filter. Result: when a user added the
    Gemini provider with no other providers configured, the Playground
    defaulted to a model that wasn't selectable in the picker. Backend
    routing still worked because the Java enum keeps deprecated entries
    (add-only), so completions kept succeeding while the UI looked broken.

    Vertex AI had the same shape of bug: VERTEX_AI_GEMINI_2_5_PRO_PREVIEW_04_17
    is a dated preview alias replaced by gemini-2.5-pro / gemini-3.1-pro-preview.

    Bumped both defaults to the current top-of-dropdown entry:

    • Gemini: GEMINI_3_PRO -> GEMINI_3_1_PRO
    • Vertex AI: VERTEX_AI_GEMINI_2_5_PRO_PREVIEW_04_17 -> VERTEX_AI_GEMINI_3_1_PRO

    Discovered while reviewing the Gemma reasoning leak (this PR).

    下载附件