mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7560] [MERGED] fix(gemini): no final AI turn or penalties for Argon and Gemini 3.6+ Flash on every route #7797
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7797
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7560
Author: @SpicyMarinara
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/gemini-request-shapes📝 Commits (1)
32861dbfix(gemini): no final AI turn or penalties for Argon and Gemini 3.6+ Flash on every route📊 Changes
6 files changed (+305 additions, -29 deletions)
View changed files
📝
packages/server/src/services/llm/providers/google.provider.ts(+25 -14)📝
packages/server/src/services/llm/providers/openai.provider.ts(+45 -13)📝
packages/shared/src/constants/generation-parameter-relevance.ts(+3 -0)📝
packages/shared/src/constants/model-lists.ts(+12 -0)📝
scripts/regressions/generation-parameter-relevance.regression.ts(+6 -2)📝
scripts/regressions/provider-compat.regression.ts(+214 -0)📄 Description
Linked issue
Closes #7558
Why this change
Google rejects a Gemini request that ends on an AI turn, and also rejects frequency and presence penalties, for these models:
Marinara only guarded Argon, and only on the native Google and Vertex connections. Several common actions could therefore fail:
Two smaller OpenRouter problems:
What changed
Behaviour that changes for things that worked before:
Fixes:
isGeminiStrictRequestModelinmodel-lists.ts) covers Argon, 3.5 Flash-Lite and 3.6 to 3.8 Flash. Both native Google and the OpenAI-compatible path use it.reasoning_detailsback unmodified, within the same tool loop only. Saved chat history is still filtered at the route, so #1097 stays fixed.chat()keeps a past AI turn that has saved Gemini parts but no text, as the tools path already does.What stays Argon-only: the temperature, top-p and top-k removal, the thinking levels and streaming. Google documents those differently for the Flash models: it ignores their samplers rather than rejecting them, and Marinara never sends
minimalorthinkingBudgetto them.Bodies that do not change:
Both sets are pinned byte for byte, and I checked them against a capture from staging.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent. Each passed locally; nothing was sent to Google, OpenRouter or any running instance:
pnpm checknode ./scripts/run-regressions.mjs --filter scripts/regressions/provider-compat.regression.tsnode ./scripts/run-regressions.mjs --filter scripts/regressions/generation-parameter-relevance.regression.tsnode ./scripts/run-regressions.mjs --filter past-reasoning-historynode ./scripts/run-regressions.mjs --filter agent-activationnode ./scripts/run-regressions.mjs --filter spatial-contextnode ./scripts/run-regressions.mjs --filter open-issuesLocal CodeRabbit (
coderabbit review --agent --committed --base-commit adcfe6d76) reviewed all 6 files and reported 0 findings. The GitHub CodeRabbit check on the first push said "Review rate limited", so it has not reviewed yet.The provider bodies were checked against a stubbed
fetch(PROVIDER_LOCAL_URLS_ENABLED=true). The new cases fail on staging's provider code and pass on this branch. The panel parity check fails if the new panel rule is removed.Manual verification notes
Manual verification needed:
google/gemini-4-argon, press Send with an empty box after a reply in Roleplay. Confirm the reply continues without an error.google/gemini-4-argon, use a preset with an Assistant Prefill. Confirm the reply continues the prefill without an error.gemini-3.8-flash, do the same empty Send and the same prefill. Confirm both work, and that the penalty sliders are hidden for that model.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/connections/providers-reference.mddoes not describe prefill or penalty handling, so this PR changes no docs and adds nothing to #7543.Sources
reasoning_detailsback during tool calling: https://openrouter.ai/docs/guides/best-practices/reasoning-tokens🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.