Skip to content

bug(google-vertex): skip_thought_signature_validator sentinel rejected as invalid json #4032

@milton-li

Description

@milton-li

What happened?

Gemini 3 on vertex ai returns 400 Invalid JSON in request body / INVALID_ARGUMENT on the turn that follows a parallel tool-call response.

Root cause is in dist/providers/google-shared.ts. When a Gemini 3 turn has parallel function calls, only the first one carries a thoughtSignature. #1829 added the skip_thought_signature_validator sentinel as the fallback for claude code assistant and antigravity. The sentinel is not recognized by vertex ai.

Steps to reproduce

  1. provider:google-vertex against vertex ai endpoint
  2. model: google/gemini-3.1-pro-preview
  3. prompt that asks the agent to run two parallel bash commands
  4. assistant turn returns 2 functionCall parts with the only the first carrying thoughtSignature
  5. convertMessages replays the assistant turn and substitutes SKIP_THOUGHT_SIGNATURE for the second call's missing signature.
  6. vertex returns: {"error":{"code":400,"message":"Invalid JSON in request body","status":"INVALID_ARGUMENT"}}

Expected behavior

Move the sentinel logic out of the shared convertMessages and into google-gemini-cli.ts only. google.ts and google-vertex.ts call into a sentinel-free version.

Happy to open a pr with regression tests.

Version

0.70.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginprogressIssue is being worked onlast read

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions