Skip to content

google-antigravity: generic 400 invalid argument on first replay of freshly captured thoughtSignature (no sentinel-only retry) #7907

Closed as not planned

Description

@visualbridge7188

Summary

Two turns in one Codex Desktop thread failed with Provider error 400: Antigravity invalid request: Request contains an invalid argument. on google-antigravity/gemini-3.8-flash. The same thread served 200s on the same model immediately before and (minutes later) on the identical input payloads. Evidence below points at the thoughtSignature replay cache supplying an invalid value on the first replay of a freshly captured entry, with no retry fallback.

Environment

  • opencodex 2.93.0 (npm install, bundled Bun runtime), macOS
  • Client: Codex Desktop (Responses ingress) routed through the local proxy
  • Provider: google-antigravity (OAuth, cloud-code-assist), model gemini-3.8-flash

Failed requests

time (local) request id outcome
20:12:53 ocx-9fbb9c906d42c117ccb6d2719a64a45e 400, failureCause=payload-rejected, failureStage=headers-only, resendPermission=refused-futile
20:14:22 ocx-d796b0061cb30ab673dac9954bd2499c 400, same fields

Both failures occurred on the request that first replayed a just-captured signature: request 2 of a turn (history + one new tool-call round) and request 7 of the retry turn (history + notion tool round). The 6 requests between them (replaying already-once-replayed signatures) returned 200. Switching the same history to zai/glm-5.3-flash returned 200 immediately.

Evidence that the payload content is not the cause

I restored the client-side input arrays from ~/.opencodex/responses-state.json and re-posted them to the local proxy with the same model and effort:

  • failed request 1 input (items 0..63) → HTTP 200 (about 1h later)
  • failed request 2 input (items 0..83) → HTTP 200 (about 1h later)

The only component that differed between the failing moments and the passing replays is the state of ~/.opencodex/antigravity-replay.json: the freshly captured entries for the new function calls existed at failure time and had aged out (1h TTL) by replay time, so the replays went out via the THOUGHT_SIGNATURE_BYPASS sentinel path instead of the replay-injection path.

Analysis

Suggested fix

  1. On upstream 400 invalid_request / payload-rejected for the google family, retry once with all replay-injected thoughtSignature values stripped (sentinel-only path) before surfacing the error. Currently resendPermission: refused-futile blocks the retry even though the sentinel variant provably passes.
  2. Add optional debug logging of each injected signature's provenance (captured-at ms, call-key hash, length) so a bad entry can be identified when this recurs.

Happy to provide ocx logs get output for the two request ids if useful.

Activity

  1. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    Issue closed: use an issue template

    Thanks for taking the time to submit this issue. It was closed automatically because it was not opened with a recognized issue template (Bug report, Feature request, Documentation, or Provider compatibility). Freeform and API-opened issues cannot skip this check.

    • This issue does not use a recognized issue template.

    Please edit the issue to add:

    • Open a new issue with the Bug report, Feature request, Documentation, or Provider compatibility template.
    • Or edit this issue so the body uses the template section headings for the kind of report you are filing.

    See the Contributing guide for details.

    Once the report passes the automated checks, it will be reopened automatically unless a maintainer has changed its state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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