Skip to content

v1.8.0 — Gemini 3.x thought-signature fix

Choose a tag to compare

@erain erain released this 08 Jun 21:29
· 25 commits to main since this release

The headline: Gemini 3.x tool calls now work across turns. The default gemini-3.1-pro-preview returns an opaque thoughtSignature on its function calls and requires it echoed back on replay — without it, the second turn of any tool-using conversation died with 400 … Function call is missing a thought_signature in functionCall parts. That's fixed, verified live with a two-turn tool loop.

Changes

  • Round-trip thoughtSignature + includeThoughts (#311, PR #315) — capture the signature from function-call and thought parts (base64 on loop.ContentPart.Signature) and replay it verbatim; send prior thinking back as real thought parts; enable includeThoughts on Gemini 3.x. This is the actual fix for the 400.
  • Synthetic thoughtSignature fallback (#312, PR #316) — when an active-loop model turn reaches Gemini 3.x without a real signature (compacted or pre-fix history), inject the skip_thought_signature_validator sentinel so the request still validates. Scoped to the active loop and Gemini 3.x; real signatures are never overwritten.
  • GOOGLE_GENAI_API_VERSION env knob (#314, PR #317) — pin the API version (e.g. v1alpha) to reach version-gated preview features without a code change.

Verified

go build/vet/test ./... green; gated live tests TestLiveToolLoopRoundTripsSignature, TestLiveSyntheticSignatureFallback, TestLiveSmoke all pass against gemini-3.1-pro-preview.

Notes

Investigation also closed #313 (schema/Unicode sanitization) as verified-unnecessary: Gemini 3.x accepts array-typed type and recursive $ref via parametersJsonSchema, and Go's encoding/json auto-sanitizes invalid UTF-8 — those JS-harness tricks are no-ops on glue's path.

Full Changelog: v1.7.0...v1.8.0