[PR #8270] [MERGED] fix(gemini): tool rounds keep a thought signature, and the refusal names no setting #8257

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8270
Author: @kolacheee
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @kolacheee

Base: staging ← Head: fix/gemini-signature-replay


📝 Commits (3)

  • 1af6e60 fix(gemini): a streamed call keeps its thought signature, and its refusal names no setting
  • bf5f500 fix(openai): a Gemini 3 call sent back unsigned carries Google's placeholder
  • 6af7be0 fix(client): only a missing thought signature gets the not-a-setting hint

📊 Changes

5 files changed (+157 additions, -2 deletions)

View changed files

📝 packages/client/src/lib/generation-parameter-errors.ts (+6 -0)
📝 packages/server/src/services/llm/providers/google.provider.ts (+6 -1)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+37 -1)
📝 scripts/regressions/prompt.regression.ts (+13 -0)
📝 scripts/regressions/provider-compat.regression.ts (+95 -0)

📄 Description

Linked issue

Closes #8269

Why this change

  • Before: a Gemini 3 tool round could go back without the thought signature on its first call (a native stream that sent the signature on a separate part, or an OpenAI-compatible gateway that does not hand back extra_content). Gemini refused the next round with a 400, and the error told players to turn on a "Send for thought_signature" switch that does not exist.
  • After: the signature rides on the round's first call, an unsigned Gemini 3 round over an OpenAI-compatible endpoint carries Google's documented placeholder, and the error says it is not a setting and shows the provider's message.

What changed

  • Native Google streaming: a signature streamed on a part of its own goes on the round's first functionCall when that call came without one (it stays on the text part otherwise).
  • OpenAI-compatible: when none of a Gemini 3 round's calls is signed (and OpenRouter's reasoning_details are not in play), the first call gets extra_content.google.thought_signature: "skip_thought_signature_validator", the value Google documents for calls it did not issue (thought signatures). Signed rounds and other models are unchanged.
  • Generation error hints: a thought signature refusal no longer reads as a missing parameter.

Validation

  • provider-compat and prompt regressions pass locally (new cases for all three; the streaming case fails without the fix), plus game-mode-dice-tool, provider-quiet-tools, past-reasoning-history, provider-caching, game-tool-controls, open-issues
  • Server and client typecheck, eslint and prettier on the changed files
  • 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

Manual verification notes

  • Not run against a live Gemini key yet; covered by mocked endpoints in the regression.

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)

🔄 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/8270 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/gemini-signature-replay` --- ### 📝 Commits (3) - [`1af6e60`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1af6e6041077e2cf5ef6bd7fb716b661e718afa3) fix(gemini): a streamed call keeps its thought signature, and its refusal names no setting - [`bf5f500`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bf5f500b1dde8863926b3c487d9ffa36465cd84f) fix(openai): a Gemini 3 call sent back unsigned carries Google's placeholder - [`6af7be0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6af7be04828869937ce7f2be6f3bbd86de531629) fix(client): only a missing thought signature gets the not-a-setting hint ### 📊 Changes **5 files changed** (+157 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/lib/generation-parameter-errors.ts` (+6 -0) 📝 `packages/server/src/services/llm/providers/google.provider.ts` (+6 -1) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+37 -1) 📝 `scripts/regressions/prompt.regression.ts` (+13 -0) 📝 `scripts/regressions/provider-compat.regression.ts` (+95 -0) </details> ### 📄 Description ## Linked issue Closes #8269 ## Why this change - Before: a Gemini 3 tool round could go back without the thought signature on its first call (a native stream that sent the signature on a separate part, or an OpenAI-compatible gateway that does not hand back `extra_content`). Gemini refused the next round with a 400, and the error told players to turn on a "Send for thought_signature" switch that does not exist. - After: the signature rides on the round's first call, an unsigned Gemini 3 round over an OpenAI-compatible endpoint carries Google's documented placeholder, and the error says it is not a setting and shows the provider's message. ## What changed - Native Google streaming: a signature streamed on a part of its own goes on the round's first functionCall when that call came without one (it stays on the text part otherwise). - OpenAI-compatible: when none of a Gemini 3 round's calls is signed (and OpenRouter's reasoning_details are not in play), the first call gets `extra_content.google.thought_signature: "skip_thought_signature_validator"`, the value Google documents for calls it did not issue ([thought signatures](https://cloud.google.com/vertex-ai/generative-ai/docs/thought-signatures)). Signed rounds and other models are unchanged. - Generation error hints: a thought signature refusal no longer reads as a missing parameter. ## Validation - [x] `provider-compat` and `prompt` regressions pass locally (new cases for all three; the streaming case fails without the fix), plus `game-mode-dice-tool`, `provider-quiet-tools`, `past-reasoning-history`, `provider-caching`, `game-tool-controls`, `open-issues` - [x] Server and client typecheck, eslint and prettier on the changed files - [ ] 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) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Not run against a live Gemini key yet; covered by mocked endpoints in the regression. ## Docs and release impact - [x] 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 04:04:09 +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#8257
No description provided.