mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7569] [MERGED] fix(gemini): hide ignored samplers for the newer Flash models and end user rewrites on the instruction #7803
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#7803
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/7569
Author: @SpicyMarinara
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/gemini-flash-samplers-user-rewrite📝 Commits (3)
eb7ffc8fix(gemini): drop ignored samplers for the newer Flash models and end user rewrites on the instructionf5236d8fix(gemini): keep the user rewrite instruction last and prove it through the routead2e753test(gemini): wait for the database to close before removing the scratch folder📊 Changes
8 files changed (+270 additions, -39 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+16 -2)📝
packages/server/src/services/llm/providers/google.provider.ts(+8 -4)📝
packages/server/src/services/llm/providers/openai.provider.ts(+5 -5)📝
packages/shared/src/constants/generation-parameter-relevance.ts(+3 -6)📝
packages/shared/src/constants/model-lists.ts(+11 -4)➕
scripts/regressions/gemini-user-regeneration.regression.ts(+171 -0)📝
scripts/regressions/generation-parameter-relevance.regression.ts(+1 -0)📝
scripts/regressions/provider-compat.regression.ts(+55 -18)📄 Description
Linked issue
Refs #7558. This is a follow-up to #7560, which closed that issue and was merged before these review fixes were ready.
Why this change
:onlinevariant. On OpenRouter,google/gemini-4-argon:onlinegot the other rules from #7560, but it still showed and sent those sliders.What changed
Behaviour that changes for things that worked before:
google/gemini-4-argon:onlineon OpenRouter. Google ignores these values for those models, so replies should not change. A custom connection still sends them, as it already does for Argon.Name: message") after the rewrite instruction. It is left out, as it already is for impersonation, because both write your message.Code:
isGeminiStrictRequestModelnow drives the sampler rule everywhere it applies: nativeshouldSendParameter, the OpenAI-compatibleisNoTemperatureModel, and the panel. Samplers and penalties now drop together.shouldSendPenaltyParamsalso keeps its own Gemini check (a custom endpoint keeps its penalties). The check changes no request body, but ifisNoTemperatureModelchanges, the penalties still stay out.isGeminiModelinmodel-lists.ts.normalizeGeminiRequestuses it in place of its inline pattern. The generate route uses it to choose the Gemini user-regeneration ending.scripts/regressions/gemini-user-regeneration.regression.tsgoes through the realPOST /api/generateroute. It replaces the source-text check thatprovider-compatused for the route wiring.isGeminiArgonModelnow covers only Argon's thinking rule (thinking cannot be turned off) and Vertex streaming. Its comment says so.Left unchanged, for a separate change:
Individual group chats ending on the previous character's reply— checked and not a problem. A reproduction through the realPOST /api/generateroute (448 runs: 7 connections, Strict on/off, commands on/off, notes, normal and empty Send) found that the next character's request always ends on a user turn: the previous character's reply, then "Respond ONLY as {name}."scopeIndividualGroupMessagesForTargetturns other characters' replies into user messages before post-processing, so the shape described in review only exists in the unscoped array, which is never sent. Only an empty Send in a single-character or Merged chat ends on the AI's turn, which is the intended continue behaviour.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands the agent ran on this branch. Each passed locally. Nothing was sent to Google, OpenRouter, NanoGPT 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 regeneration-contextnode ./scripts/run-regressions.mjs --filter agent-activationnode ./scripts/run-regressions.mjs --filter spatial-contextnode ./scripts/run-regressions.mjs --filter open-issuesAdded for the review fixes in
f5236d8d1andad2e7531a(each passed locally;ad2e7531aonly makes the new regression wait for the database to close before it removes its temporary folder):pnpm checknode ./scripts/run-regressions.mjs --filter scripts/regressions/gemini-user-regeneration.regression.tsnode ./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 scripts/regressions/agent-activation(both files)node ./scripts/run-regressions.mjs --filter scripts/regressions/spatial-contextnode ./scripts/run-regressions.mjs --filter scripts/regressions/open-issuesnode ./scripts/run-regressions.mjs --filterwithgroup-mention-routing,roleplay-regeneration-context,smart-group-decision,prompt.regression,generation-outputandconversationProvider bodies were checked against a stubbed
fetch(PROVIDER_LOCAL_URLS_ENABLED=true). With the previous code in place, the new cases fail::onlineArgon as a mismatch.The route regression uses a local stub server on 127.0.0.1 and a temporary data folder. It regenerates a user message in merged Roleplay and Conversation groups on OpenRouter
google/gemini-3.8-flash, NanoGPTgoogle/gemini-4-argon, nativegemini-4-argonandgemini-3.5-flash, and OpenRouter Llama as a non-Gemini control, with Post-Processing on and off, guided and not. It fails in each of these cases:isGeminiModel(conn.model)removed from the route: "… roleplay Post-Processing on ends on the rewrite instruction". The request ended on "Continue the assistant's reply".shouldSendPenaltyParams: adding!isGeminiStrictRequestModel(model)without the custom exception fails the provider-compat pin "gemini-4-argon chat sends only the samplers it takes" (custom endpoint,frequency_penalty/presence_penaltydropped). The pushed form (isGenericCustomProvider() || !isGeminiStrictRequestModel(model)) passes every pin. With the Gemini line temporarily removed fromisNoTemperatureModel, OpenRouter Argon senttemperatureandtop_pbut still no penalties.The Gemini 3.5 Flash, 3.1 Pro and non-Gemini byte pins from #7560 are unchanged and pass.
Local CodeRabbit (
coderabbit review --agent --committed --base-commit adcfe6d76) ran oneb7ffc8c9before it was moved onto current staging. It reviewed all 7 files and reported 0 findings.Local CodeRabbit (
coderabbit review --agent --committed --base-commit 58cd2e777) ran once on the review-fix commit before the Conversation change. It reported 2 findings, which were the same issue: a merged Conversation group added its reply format after the rewrite instruction. A route reproduction confirmed it, andf5236d8d1fixes it with a regression case. CodeRabbit was not re-run after that fix or afterad2e7531a.Manual verification notes
Manual verification needed:
gemini-3.8-flash, open the preset parameters. Confirm Temperature, Top P, Top K and both penalties are hidden. Send a message and confirm a reply arrives.google/gemini-3.8-flash, regenerate one of your own messages as a new swipe. Confirm the new swipe rewrites your message and does not continue the AI's reply.google/gemini-3.5-flashand confirm the same result.google/gemini-3.8-flash, type a direction in the input box and use the guided regenerate button on one of your own messages. Confirm the new swipe is your rewritten message, not a character's reply. Repeat on Google AI Studio withgemini-3.5-flash.google/gemini-4-argon:online, confirm the Temperature and Top P sliders are hidden.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 Gemini sampler or regeneration handling. This PR changes no docs and adds nothing to #7543.Sources
Read 2026-10-13:
temperature,top_p, andtop_k, which are ignored."): https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/guides/gemini-4-argontemperature,top_p, andtop_kare deprecated and ignored." "Remove these parameters from all requests."): https://ai.google.dev/gemini-api/docs/whats-new-gemini-3.6Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.