v1.8.0 — Gemini 3.x thought-signature fix
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 onloop.ContentPart.Signature) and replay it verbatim; send prior thinking back as realthoughtparts; enableincludeThoughtson Gemini 3.x. This is the actual fix for the 400. - Synthetic
thoughtSignaturefallback (#312, PR #316) — when an active-loop model turn reaches Gemini 3.x without a real signature (compacted or pre-fix history), inject theskip_thought_signature_validatorsentinel so the request still validates. Scoped to the active loop and Gemini 3.x; real signatures are never overwritten. GOOGLE_GENAI_API_VERSIONenv 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