Repository navigation
fix(google): replay Gemini thought signatures on follow-up turns - #289
Merged
Merged
Conversation
Gemini 3+ (gemini-4-hydrogen on Zen) rejected follow-up turns with MISSING_THOUGHT_SIGNATURE because the Google normalizers dropped the opaque thoughtSignature from response parts and the request builder never sent it back. Signatures are now captured across SSE events, carried through the Copilot Chat transcript as an invisible internal data part, and replayed as trailing parts on the next model turn. Signature-only events are no longer discarded, and history normalization keeps/merges signatures instead of dropping them. Also records the verdicts for the other reported findings (upstream VS Code #336797, gpt-6.2-sol tool arguments, globalState growth) in docs/issues/128.
ltmoerdani
added a commit
that referenced
this pull request
Nov 25, 2026
Bump package.json and package-lock.json to 0.8.2, promote the Unreleased changelog section to 0.8.2 (2026-11-26), and update the architecture map version surface. Documentation: add the PR #289 session record (docs/issues/129), reconcile doc 128 with the merge status and remaining verification gaps, and preserve the globalState limitation and Agent Host caveat notes in the related feature/reference docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gemini 4 Hydrogen on Zen failed on follow-up turns. Google requires the opaque
thoughtSignaturefrom a response to be replayed on the next turn for Gemini 3+ with thinking enabled. Our Google normalizers dropped it and the request builder never sent it back.What changed:
core/routing.tskeeps signatures from stream and full responses, including signature-only events that used to be treated as empty.transports/google.tsandtransports/extractors.tscapture signatures across SSE events and emit one internal transcript part after the stream.chatParts.tscarries that part through Copilot Chat history as an invisible data part.provider/messages.tsreads it back, and history normalization keeps and merges it.request/google.tsreplays each signature as a trailing part on the next model turn, including after tool calls.Checks:
npm run compileclean,npm run lint7/7, 11 new unit tests pass.npm run packageand the E2E retry test were not run here. Live Gemini 4 Hydrogen verification is still pending, so I'd treat this as ready for review rather than confirmed fixed on the model.docs/issues/128-20261126-gemini-thought-signature-and-triage.mdalso records the verdicts for the other reports: Haiku 5.5 compaction is upstream VS Code #336797, thegpt-6.2-solskill loader arguments come from the model, and theglobalStatewarning is older debt. None of those are changed here.