Repository navigation
Description
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), modelgemini-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
applyAntigravityReplayinjects the cached signature for matching functionCall parts; when no entry exists,applyAntigravityThoughtSignatureFallbackinjects the validator-bypass sentinel, which upstream accepts.- So an entry that holds an invalid value turns a would-be-accepted request into a blanket 400, and because the failure is classified
payload-rejected/refused-futile, the client never gets the sentinel-only retry that would have succeeded. - 2.93.0 already guards the known
ctc_/toolu_id leak (Antigravity 400 "Base64 decoding failed" when a thread with Claude history switches to a Gemini model (ctc_* signatures forwarded as thoughtSignature) #174), and our error is the generic message rather than theTYPE_BYTES / Base64 decoding faileddetail from Antigravity 400 "Base64 decoding failed" when a thread with Claude history switches to a Gemini model (ctc_* signatures forwarded as thoughtSignature) #174, so this looks like a different corruption mode (capture-side truncation or call-key mismatch) rather than foreign-id forwarding. - I could not capture the exact poisoned entry: TTL expired before investigation and no filesystem snapshot was available. The surviving snapshot does show the turn's signatures with
touchedAtMsin the 20:13:42–20:14:13 window.
Suggested fix
- On upstream 400
invalid_request/payload-rejectedfor the google family, retry once with all replay-injectedthoughtSignaturevalues stripped (sentinel-only path) before surfacing the error. CurrentlyresendPermission: refused-futileblocks the retry even though the sentinel variant provably passes. - 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
github-actions commentedon Oct 28, 2026
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.
Please edit the issue to add:
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.