[PR #7541] [MERGED] fix(google): keep Flash as the default and make Argon's settings honest #7784

Closed
opened 2026-10-24 04:07:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7541
Author: @SpicyMarinara
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/gemini-4-argon-follow-up


📝 Commits (1)

  • 00430d9 fix(google): keep Flash as the default and make Argon's settings honest

📊 Changes

11 files changed (+123 additions, -47 deletions)

View changed files

📝 docs/connections/providers-reference.md (+1 -1)
📝 packages/server/src/routes/generate/dry-run-route.ts (+1 -1)
📝 packages/server/src/routes/generate/raw-route.ts (+1 -1)
📝 packages/server/src/services/generation/generation-parameters.ts (+1 -1)
📝 packages/server/src/services/generation/provider-generation-runtime.ts (+1 -1)
📝 packages/server/src/services/llm/providers/google.provider.ts (+10 -4)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+3 -0)
📝 packages/shared/src/constants/generation-parameter-relevance.ts (+9 -13)
📝 packages/shared/src/constants/model-lists.ts (+12 -4)
📝 scripts/regressions/generation-parameter-relevance.regression.ts (+70 -14)
📝 scripts/regressions/provider-compat.regression.ts (+14 -7)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Refs #7534. That issue was closed when #7536 merged, and this PR follows up on #7536.

Translation follow-up: #7535 (updated with the reworded paragraph, and nothing has been translated yet).

Why this change

A review of the merged Gemini 4 Argon change (#7536) found four problems:

  • The default model for new connections changed. New connections take the first model in the list, and #7536 put gemini-4-argon first, so it became the default for every new Google Gemini and Google Vertex AI connection. Argon fails with free AI Studio keys. On Vertex, the default Base URL uses us-central1, where Argon does not run. The PR body did not mention this change.
  • Argon's "Default" effort button promised behaviour it did not deliver. The button said "Provider default: medium", but the server still treated it as Off. Agents on that setting got no extra room for thinking: 4096 max tokens, compared with 8192 on Medium. Argon still thought at medium, so short agent calls could use the whole budget on thinking. No thinking was shown, and the parameter preview said none. The tooltip was also English-only.
  • Vertex never streamed Argon when an effort was set. Only AI Studio's endpoint was trusted to stream thinking, so Vertex used the buffered endpoint. Google stops a buffered Argon reply at 32,768 tokens, half the 65,536 it allows when streaming, and the reply arrived all at once after the thinking finished.
  • OpenRouter and NanoGPT sent settings Argon rejects. These two services look up google/gemini-4-argon in the same Google list, so after #7536 Argon was a known model there and they sent temperature, top-p and both penalties. Google rejects penalties for Argon with HTTP 400. Before #7536 only max tokens was sent.

What changed

Changes to how things behave now (all limited to Argon, except the default model):

  • New Google Gemini and Vertex AI connections start on gemini-3.8-flash again, as they did before #7536. Argon is now second in the list.
  • Argon has no Off button. A connection or preset saved as Off, or with no level, now sends medium (Google's own default) with thought summaries. Thinking now shows in those chats, agents get the same thinking room as Medium, and the preview says medium. The buttons are Low, Medium and High.
  • On a Google Vertex AI connection, Argon chat replies with thinking now stream, as they already do on AI Studio. Every other model keeps its current endpoint on Vertex.
  • On OpenRouter and NanoGPT, Argon no longer sends temperature, top-p, top-k or penalties, and the panel hides those controls. Custom OpenAI-compatible endpoints still send what the user sets.

Details:

  • packages/shared/src/constants/model-lists.ts: gemini-3.8-flash is first again. resolveProviderReasoningEffort maps Off, none or no level to medium for Argon on google and google_vertex.
  • Four places turn a saved Off into "none" after resolving the level: the generation runtime, dry run, raw route and stored chat options. They now let the mapped level win. For every other model, Off still resolves to nothing, so these places behave as before. Fallback connections do not resolve the level at all (see Not changed).
  • reasoningEffortChoices leaves out Off when Off would send a level. This replaces #7536's "Default (Provider default: medium)" relabel and removes its hard-coded English tooltip.
  • google.provider.ts: supportsGoogleThinkingStreaming also accepts Google's own *.googleapis.com hosts for Argon. Marked ponytail:. Other models on Vertex still buffer thinking turns, and the model check can be dropped once Vertex thought streaming is verified for them.
  • openai.provider.ts: isNoTemperatureModel includes Argon, next to the existing Claude rule. Parameter relevance hides Argon's sampling controls on every provider except custom.
  • docs/connections/providers-reference.md: the timeout advice now names AGENT_CALL_TIMEOUT_MS for agent calls as well as CHAT_GENERATION_TIMEOUT_MS, and says the wait applies to both Google connections.

Not changed

  • Parallel function responses still go out as one user turn per response, with the id and name of the call, in call order. This is how all Gemini models already work, an existing provider-compat assertion pins it, and the reviewer could not show that Argon rejects it without a live request. Changing it would affect every Gemini tool loop. The Game mode check under Manual verification below covers it.
  • Agent JSON calls on a connection with no saved level still ask Argon for none, so Google's default medium applies without extra thinking room. Gemini 3 Pro behaves the same way today. Fallback connections pass their saved Off straight through, as for every provider, so Argon there still thinks at medium but without thought summaries.

Sources:

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands the agent ran locally. Nothing was sent to Google or any other provider; request bodies were captured by a stubbed fetch or a local stub server.

  • pnpm check: passed (exit 0).
  • node ./scripts/run-regressions.mjs --filter <name>: passed for generation-parameter-relevance, provider-compat, agent-activation (2/2), spatial-context, open-issues, codex-reasoning-effort, game-generation-parameters, agent-connection-parameters, nanogpt-glm-reasoning-off, connection-model-list, deepseek-reasoning-output, mistral-reasoning-output, past-reasoning-history, responses-rejected-reasoning and responses-tool-reasoning.
  • Local CodeRabbit (coderabbit review --agent --committed, base 088406bf8): 0 findings.

New regression proof:

  • generation-parameter-relevance: Argon's buttons are low, medium and high only. Off, none and no level resolve to medium. An agent on an Argon connection saved as Off gets the same reasoning and max tokens as one saved as Medium. Gemini 3 keeps its Off. google/gemini-4-argon is probed on OpenRouter and NanoGPT, where the panel must match the request and must hide all five sampling controls. New Google and Vertex connections must not start on Argon.
  • provider-compat: Argon thinking turns stream on Vertex, in both chat and the tools round. Gemini 3.5 Flash thinking turns keep their endpoint on both providers, and their bodies stay pinned byte for byte.
  • Checked against the unfixed code: the relevance regression fails on the Argon buttons. With only the OpenAI provider change undone, it reports OpenRouter and NanoGPT sending temperature, top-p and both penalties. With only the runtime change undone, the agent gets none. provider-compat fails on the Vertex :generateContent URL.

Manual verification notes

Manual verification needed. The agent has not done these; they need real keys.

  • Create a new Google Gemini connection and a new Google Vertex AI connection. Confirm that both start on gemini-3.8-flash.
  • On a Google Vertex AI connection with Base URL https://aiplatform.googleapis.com/v1/projects/<project>/locations/global, select gemini-4-argon with streaming on and reasoning effort High. Send a Roleplay message, and confirm that the thinking and the reply stream in and are not shown all at once at the end.
  • With a paid AI Studio key, select gemini-4-argon and open the reasoning effort row. Confirm it shows Low, Medium and High with no Off or Default button. On a connection that was saved as Off before this change, send a message. Confirm the thinking appears and the parameter preview shows medium.
  • With trackers or another agent turned on, use an Argon connection saved as Off and play a few turns. Confirm the agents return results and do not fail with "Gemini finished without content (MAX_TOKENS)".
  • On OpenRouter (and NanoGPT, if you have it), select google/gemini-4-argon. Confirm the temperature, top-p, top-k and penalty controls are hidden and a message gets a reply.
  • In Game mode on Argon, trigger a turn where the GM rolls two dice or calls two tools at once. Confirm the next round answers and does not return a Google error.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

docs/connections/providers-reference.md changed one sentence. The open translation issue #7535 now carries the new text, so the translators only do this once.

Summary by CodeRabbit

  • Bug Fixes

    • Improved reasoning-effort handling for Gemini 4 Argon so supported effort levels are applied consistently across generation and agent connections.
    • Gemini 4 Argon requests now stream thinking responses on Google and Vertex connections when supported, and omit sampling settings the models do not accept.
    • Updated generation controls to hide unsupported sampling options for non-custom providers.
  • Documentation

    • Clarified timeout guidance for Google connections, including separate settings for chat and agent calls.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7541 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/gemini-4-argon-follow-up` --- ### 📝 Commits (1) - [`00430d9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00430d9786b508c8a3e00787c3489a9989841c26) fix(google): keep Flash as the default and make Argon's settings honest ### 📊 Changes **11 files changed** (+123 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `docs/connections/providers-reference.md` (+1 -1) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+1 -1) 📝 `packages/server/src/routes/generate/raw-route.ts` (+1 -1) 📝 `packages/server/src/services/generation/generation-parameters.ts` (+1 -1) 📝 `packages/server/src/services/generation/provider-generation-runtime.ts` (+1 -1) 📝 `packages/server/src/services/llm/providers/google.provider.ts` (+10 -4) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+3 -0) 📝 `packages/shared/src/constants/generation-parameter-relevance.ts` (+9 -13) 📝 `packages/shared/src/constants/model-lists.ts` (+12 -4) 📝 `scripts/regressions/generation-parameter-relevance.regression.ts` (+70 -14) 📝 `scripts/regressions/provider-compat.regression.ts` (+14 -7) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Refs #7534. That issue was closed when #7536 merged, and this PR follows up on #7536. Translation follow-up: #7535 (updated with the reworded paragraph, and nothing has been translated yet). ## Why this change A review of the merged Gemini 4 Argon change (#7536) found four problems: - **The default model for new connections changed.** New connections take the first model in the list, and #7536 put `gemini-4-argon` first, so it became the default for every new **Google Gemini** and **Google Vertex AI** connection. Argon fails with free AI Studio keys. On Vertex, the default Base URL uses `us-central1`, where Argon does not run. The PR body did not mention this change. - **Argon's "Default" effort button promised behaviour it did not deliver.** The button said "Provider default: medium", but the server still treated it as Off. Agents on that setting got no extra room for thinking: 4096 max tokens, compared with 8192 on Medium. Argon still thought at medium, so short agent calls could use the whole budget on thinking. No thinking was shown, and the parameter preview said `none`. The tooltip was also English-only. - **Vertex never streamed Argon when an effort was set.** Only AI Studio's endpoint was trusted to stream thinking, so Vertex used the buffered endpoint. Google stops a buffered Argon reply at 32,768 tokens, half the 65,536 it allows when streaming, and the reply arrived all at once after the thinking finished. - **OpenRouter and NanoGPT sent settings Argon rejects.** These two services look up `google/gemini-4-argon` in the same Google list, so after #7536 Argon was a known model there and they sent temperature, top-p and both penalties. Google rejects penalties for Argon with HTTP 400. Before #7536 only max tokens was sent. ## What changed **Changes to how things behave now** (all limited to Argon, except the default model): - New Google Gemini and Vertex AI connections start on `gemini-3.8-flash` again, as they did before #7536. Argon is now second in the list. - Argon has no Off button. A connection or preset saved as Off, or with no level, now sends `medium` (Google's own default) with thought summaries. Thinking now shows in those chats, agents get the same thinking room as Medium, and the preview says `medium`. The buttons are Low, Medium and High. - On a Google Vertex AI connection, Argon chat replies with thinking now stream, as they already do on AI Studio. Every other model keeps its current endpoint on Vertex. - On OpenRouter and NanoGPT, Argon no longer sends temperature, top-p, top-k or penalties, and the panel hides those controls. Custom OpenAI-compatible endpoints still send what the user sets. Details: - `packages/shared/src/constants/model-lists.ts`: `gemini-3.8-flash` is first again. `resolveProviderReasoningEffort` maps Off, `none` or no level to `medium` for Argon on `google` and `google_vertex`. - Four places turn a saved Off into `"none"` after resolving the level: the generation runtime, dry run, raw route and stored chat options. They now let the mapped level win. For every other model, Off still resolves to nothing, so these places behave as before. Fallback connections do not resolve the level at all (see Not changed). - `reasoningEffortChoices` leaves out Off when Off would send a level. This replaces #7536's "Default (Provider default: medium)" relabel and removes its hard-coded English tooltip. - `google.provider.ts`: `supportsGoogleThinkingStreaming` also accepts Google's own `*.googleapis.com` hosts for Argon. Marked `ponytail:`. Other models on Vertex still buffer thinking turns, and the model check can be dropped once Vertex thought streaming is verified for them. - `openai.provider.ts`: `isNoTemperatureModel` includes Argon, next to the existing Claude rule. Parameter relevance hides Argon's sampling controls on every provider except `custom`. - `docs/connections/providers-reference.md`: the timeout advice now names `AGENT_CALL_TIMEOUT_MS` for agent calls as well as `CHAT_GENERATION_TIMEOUT_MS`, and says the wait applies to both Google connections. ### Not changed - **Parallel function responses** still go out as one user turn per response, with the id and name of the call, in call order. This is how all Gemini models already work, an existing `provider-compat` assertion pins it, and the reviewer could not show that Argon rejects it without a live request. Changing it would affect every Gemini tool loop. The Game mode check under Manual verification below covers it. - **Agent JSON calls on a connection with no saved level** still ask Argon for `none`, so Google's default medium applies without extra thinking room. Gemini 3 Pro behaves the same way today. Fallback connections pass their saved Off straight through, as for every provider, so Argon there still thinks at medium but without thought summaries. Sources: - https://ai.google.dev/gemini-api/docs/latest-model - https://ai.google.dev/gemini-api/docs/models/gemini-4-argon - https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-argon - https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/guides/gemini-4-argon ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Commands the agent ran locally. Nothing was sent to Google or any other provider; request bodies were captured by a stubbed `fetch` or a local stub server. - `pnpm check`: passed (exit 0). - `node ./scripts/run-regressions.mjs --filter <name>`: passed for `generation-parameter-relevance`, `provider-compat`, `agent-activation` (2/2), `spatial-context`, `open-issues`, `codex-reasoning-effort`, `game-generation-parameters`, `agent-connection-parameters`, `nanogpt-glm-reasoning-off`, `connection-model-list`, `deepseek-reasoning-output`, `mistral-reasoning-output`, `past-reasoning-history`, `responses-rejected-reasoning` and `responses-tool-reasoning`. - Local CodeRabbit (`coderabbit review --agent --committed`, base `088406bf8`): 0 findings. New regression proof: - `generation-parameter-relevance`: Argon's buttons are low, medium and high only. Off, `none` and no level resolve to `medium`. An agent on an Argon connection saved as Off gets the same reasoning and max tokens as one saved as Medium. Gemini 3 keeps its Off. `google/gemini-4-argon` is probed on OpenRouter and NanoGPT, where the panel must match the request and must hide all five sampling controls. New Google and Vertex connections must not start on Argon. - `provider-compat`: Argon thinking turns stream on Vertex, in both chat and the tools round. Gemini 3.5 Flash thinking turns keep their endpoint on both providers, and their bodies stay pinned byte for byte. - Checked against the unfixed code: the relevance regression fails on the Argon buttons. With only the OpenAI provider change undone, it reports OpenRouter and NanoGPT sending temperature, top-p and both penalties. With only the runtime change undone, the agent gets `none`. `provider-compat` fails on the Vertex `:generateContent` URL. ### Manual verification notes Manual verification needed. The agent has not done these; they need real keys. - Create a new **Google Gemini** connection and a new **Google Vertex AI** connection. Confirm that both start on `gemini-3.8-flash`. - On a **Google Vertex AI** connection with Base URL `https://aiplatform.googleapis.com/v1/projects/<project>/locations/global`, select `gemini-4-argon` with streaming on and reasoning effort **High**. Send a Roleplay message, and confirm that the thinking and the reply stream in and are not shown all at once at the end. - With a paid AI Studio key, select `gemini-4-argon` and open the reasoning effort row. Confirm it shows Low, Medium and High with no Off or Default button. On a connection that was saved as Off before this change, send a message. Confirm the thinking appears and the parameter preview shows `medium`. - With trackers or another agent turned on, use an Argon connection saved as Off and play a few turns. Confirm the agents return results and do not fail with "Gemini finished without content (MAX_TOKENS)". - On OpenRouter (and NanoGPT, if you have it), select `google/gemini-4-argon`. Confirm the temperature, top-p, top-k and penalty controls are hidden and a message gets a reply. - In Game mode on Argon, trigger a turn where the GM rolls two dice or calls two tools at once. Confirm the next round answers and does not return a Google error. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/connections/providers-reference.md` changed one sentence. The open translation issue #7535 now carries the new text, so the translators only do this once. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved reasoning-effort handling for Gemini 4 Argon so supported effort levels are applied consistently across generation and agent connections. - Gemini 4 Argon requests now stream thinking responses on Google and Vertex connections when supported, and omit sampling settings the models do not accept. - Updated generation controls to hide unsupported sampling options for non-custom providers. - **Documentation** - Clarified timeout guidance for Google connections, including separate settings for chat and agent calls. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7784
No description provided.