mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7544] [MERGED] fix(gemini): always turn Gemini safety filters off #7785
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#7785
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/7544
Author: @SpicyMarinara
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/gemini-safety-off📝 Commits (3)
7435f2afix(gemini): always turn Gemini safety filters off (#7542)0ed7dafdocs(gemini): note that Custom Parameters can set their own safety settingsbf94340Merge branch 'staging' into fix/gemini-safety-off📊 Changes
3 files changed (+52 additions, -4 deletions)
View changed files
📝
docs/connections/providers-reference.md(+2 -0)📝
packages/server/src/services/llm/providers/google.provider.ts(+18 -0)📝
scripts/regressions/provider-compat.regression.ts(+32 -4)📄 Description
Linked issue
Closes #7542
Follow-up: #7552 keeps the unnamed categories Off when Custom Parameters set only some of them.
Why this change
What changed
google.provider.tshas one constant and one helper. Every Google AI Studio and Vertex AIgenerateContent/streamGenerateContentrequest now carriessafetySettingswith thresholdOFFforHARM_CATEGORY_HARASSMENT,HARM_CATEGORY_HATE_SPEECH,HARM_CATEGORY_SEXUALLY_EXPLICITandHARM_CATEGORY_DANGEROUS_CONTENT. Both request builders call it: the chat builder (streaming and non-streaming) and the tool-calling round. The connection test goes through the same chat builder.safetySettingsorsafety_settings, those are kept and Marinara does not add a second copy.OFFis used, notBLOCK_NONE, because the API reference describesOFFas "Turn off the safety filter" and Vertex has restrictedBLOCK_NONEin the past.HARM_CATEGORY_CIVIC_INTEGRITYis marked deprecated in the API reference ("use enableEnhancedCivicAnswers instead").HARM_CATEGORY_JAILBREAKis in the reference but not in the guide's list of adjustable categories. Sending either one could cause a 400 on some catalog model, and there is no way to rule that out without live calls.promptFeedback.blockReason/ finish-reason errors still show Google's reason.docs/connections/providers-reference.md. The translation follow-up is #7543.Routes checked and left unchanged (known gaps)
provider.optionskeyed by provider slug, includinggoogle-ai-studioandgoogle-vertex, each open-ended. Only options for the matched provider are forwarded, and unrecognised keys are dropped. No Gemini safety key is documented under it. The parameters reference names only Mistralsafe_promptand Hyperbolicraw_modeas provider-specific passthroughs. Following the decision not to guess, OpenRouter request bodies are unchanged, so non-Gemini bodies are byte-identical to before.require_parametersis not touched.gemini_image): Google's OpenAI compatibility page documentsextra_body.google.safety_settingsonly for the Images endpoint, not for chat completions. Marinara's Gemini image path posts to/chat/completions, so nothing documented applies there.generateContent, and the Interactions overview says "Custom safety settings are not supported in the Interactions API." Veo usespredictLongRunning, which has nosafetySettingsfield.embedContent) and model listing: safety settings do not apply to these calls.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands the agent ran (results only; the boxes above are for a human to tick):
pnpm check: exit 0.coderabbit review --agent --committed --base-commit origin/staging): 1 minor finding. The docs sentence said "always" even though the user's own Custom Parameters win. Fixed by naming that exception in the docs sentence.node ./scripts/run-regressions.mjs --filter provider-compat: passed. The Gemini 4 Argon request-shape block now pinssafetySettingson AI Studio and Vertex for non-streaming, streaming and the tools round. A new case proves a user's ownsafety_settingsis kept and not doubled. The pinned Gemini 3 bytes now include the safety settings and are otherwise unchanged. Before the expectations were updated, the same block failed on the new field, which shows the request body really changed.--filter provider-caching,generation-parameter-relevance,mari-completion-frames,agent-connection-parameters,game-tool-controls,open-issues,agent-activation(2 files),spatial-context: all passed.fetch.Manual verification notes
safetySettingswithOFFfor the four categories.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs follow-up: #7543 (
[docs-i18n] docs/connections/providers-reference.md).UI evidence (if applicable)
Not applicable (server request bodies only).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.