Skip to content

google-vertex: Codex tool continuation returns 400 when functionCall thought_signature is not replayed #1254

Description

@akazatmd-ctrl

Client or integration

Codex CLI

Provider or upstream service

google-vertex (Vertex AI, service-account JSON / ADC)

OpenCodex version

2.10.2

Endpoint or capability

Codex CLI tool-call continuation through google-vertex/gemini-3.6-flash (/v1/responses translation / tool-call replay)

Current behaviour

Vertex connectivity and authentication are healthy, and tool-free requests succeed, but a Codex turn that invokes a tool fails on the continuation with HTTP 400.

A direct OpenCodex Responses request succeeds:

{
  "model": "google-vertex/gemini-3.6-flash",
  "input": "Reply exactly: VERTEX_OK",
  "stream": false
}

Response:

status: completed
model: gemini-3.6-flash
text: VERTEX_OK

A simple question sent from Codex also succeeds. The failure appears only after a function call, on the subsequent continuation turn.

Expected behaviour

The thought_signature / thoughtSignature returned by Gemini/Vertex for a function call should be preserved and replayed unchanged on the subsequent tool-result continuation, so Codex tool loops can continue successfully.

Minimal redacted request or reproduction

1. Configure a `google-vertex` provider using `adapter: google`, `googleMode: vertex`, and a service-account JSON exposed through ADC / `GOOGLE_APPLICATION_CREDENTIALS`.
2. Select `google-vertex/gemini-3.6-flash` in Codex CLI.
3. Send a tool-free prompt. It succeeds.
4. Send a prompt that requires a shell command or another Codex tool.
5. The function call is emitted, but the continuation fails with HTTP 400 because the prior `functionCall` part is missing its thought signature.

Redacted provider shape:
adapter:      google
googleMode:   vertex
auth:         service-account JSON via ADC
baseUrl:      https://aiplatform.googleapis.com
model:        gemini-3.6-flash

Actual response or error

Provider error 400: Vertex AI invalid request: Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:shell_command`, position 4.

OpenCodex records:
status: 400
error: invalid_request_error
route: explicit-provider
google-vertex/gemini-3.6-flash

Upstream documentation

https://ai.google.dev/gemini-api/docs/thought-signatures

Gemini requires thought signatures associated with function calls to be passed back unchanged in subsequent turns when using tools.

Suggested mapping or implementation notes

This looks like a replay / translation issue rather than a credential or connectivity problem:

  • OpenCodex proxy health is OK.
  • The same google-vertex/gemini-3.6-flash provider succeeds through /v1/responses for a tool-free request.
  • Codex tool-free requests succeed through the same provider.
  • Failure appears only after a function call, on the continuation turn.
  • Vertex explicitly reports that the prior functionCall part is missing its required thought_signature.

This looks related in concept to #897, where Antigravity replay dropped a reasoning signature carried separately from the function call. #897 was fixed for the google-antigravity replay path by #941. The google-vertex path may need the same class of signature preservation/replay, or it may currently bypass that replay cache.

Additional context and attachments

This is a resubmission of #1248 using the repository's Provider or API compatibility issue template after maintainer guidance to use the issue template.

Environment used for the reproduction:

  • Codex: codex-cli 0.145.0
  • OS: Windows 11 x64 (10.0.26200)
  • Model: google-vertex/gemini-3.6-flash

The Vertex project ID, service-account identity, credential path, request IDs, and conversation IDs are intentionally omitted.

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions