Skip to content

[Bug]: Google Antigravity 400 missing thought_signature on historical tool calls (cockpit-tools) #2125

Closed

Description

@agentHits

Client or integration

Codex App

Area

Provider adapter

Summary

When using google-antigravity (gemini-3.7-flash / thinking models) with subscriptions / accounts imported via the cockpit-tools integration module, multi-turn sessions with tool usage continuously crash with upstream HTTP 400 errors indicating that historical functionCall parts are missing the required thought_signature.

This error breaks and interrupts tasks repeatedly across different execution tools and multi-agent coordination steps:

  • Provider error 400: Antigravity 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:exec' , position 133. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
  • Provider error 400: Antigravity 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:wait' , position 238. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
  • Provider error 400: Antigravity 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:collaboration__wait_agent' , position 262. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.

Expected behaviour:
The proxy should preserve and replay all thought_signature tokens for historical functionCall items across turns, context compaction, and multi-agent subtasks so that upstream Gemini Antigravity reasoning models accept the tool call history.

Reproduction

  1. Import Google Antigravity account credentials via the cockpit-tools integration format (ocx account import google-antigravity --format cockpit-tools).
  2. Start OpenCodex (v2.26.0) with google-antigravity configured.
  3. In Codex App (Desktop), select google-antigravity/gemini-3.7-flash and start a multi-step task involving tool execution and agent coordination.
  4. Execute several turns with tool invocations (default_api:exec, default_api:wait, default_api:collaboration__wait_agent).
  5. As conversation history grows or is replayed (positions 133, 238, 262), upstream rejects the request with HTTP 400 due to missing thought_signature.

Version

2.26.0

Operating system

macOS 15.5

Provider and model

google-antigravity / gemini-3.7-flash

Logs or error output

Provider error 400: Antigravity 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:exec` , position 133. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.

Provider error 400: Antigravity 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:wait` , position 238. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.

Provider error 400: Antigravity 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:collaboration__wait_agent` , position 262. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.

Redacted configuration

{
  "providers": {
    "google-antigravity": {
      "authMode": "oauth"
    }
  }
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bugSomething isn't working
    providerProvider adapters, OpenAI-compat presets, upstream API quirks
    toolstool_calls, MCP, web-search / sidecar tools
    on Aug 19, 2026
  2. agentHits commented on Aug 19, 2026

    @agentHits
    ContributorAuthor

    CC: @lidge-jun @Ingwannu @Wibias

    Hi maintainers!

    Could you please prioritize investigating and fixing this issue? Currently, running google-antigravity (specifically gemini-3.7-flash via subscriptions imported through cockpit-tools) in OpenCodex v2.26.0 is severely degraded / unusable for real workflows because any multi-turn session with tools quickly fails with HTTP 400 (Function call is missing a thought_signature in functionCall parts).

    The issue reliably interrupts work across different tool calls in long-running tasks and agent workflows:

    1. default_api:exec at position 133
    2. default_api:wait at position 238
    3. default_api:collaboration__wait_agent at position 262

    It appears that when conversation turns are replayed (or after compaction / multi-agent turns), the replay store is not restoring or attaching the required thought_signature to historical functionCall items for this provider/credential scope, causing upstream Google Antigravity to reject subsequent requests.

    Any fix or guidance on this would be greatly appreciated!

  3. lidge-jun commented on Aug 19, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 68 / 80

    cockpit-tools가 범인이 아님. 그거 계정 임포트 포맷임(ACCOUNT_IMPORT_FORMAT). 죽은 곳은 google-antigravity + thinking 모델의 툴 히스토리 리플레이임. 업스트림이 interleave thinking을 stateless로 돌려서, 예전에 나간 functionCall에 thought_signature가 없으면 400임. 리포터 문구가 그거임. default_api:exec 133, wait 238, collaboration__wait_agent 262. 첫 턴이 아니라 히스토리가 커진 다음임.

    이미 있는 장치가 세 겹임. observeAntigravityReplay / applyAntigravityReplay가 name+args로 캐시함(#897). googleToolCallMetadataFromPart가 tool_call_start에 providerMetadata.google.thoughtSignature를 실음(#1735). 클라이언트가 extra_content를 안 메아리치면 src/responses/thought-signature-replay.ts가 call_id로 다시 붙임. 세 겹이 다 첫 emit에서 서명을 봤어야 함. 못 보면 히스토리 재조립(google.ts assistant toolCall 직렬화)이 빈 functionCall을 보냄.

    지금 dev의 구멍은 두 개임. SSE에서 thought 파트랑 functionCall이 청크가 갈라지면 observeAntigravityReplay가 청크마다 pendingThoughtSig를 새로 만들어서 앞 청크 서명이 증발함. 같은 턴에 툴이 두 개면(exec + wait) 첫 콜에서 pendingThoughtSig = undefined로 지워서 둘째부터 빈 값임. #897 주석이 “다음 functionCall 하나랑 페어하고 짝 없는 건 버림”이라서 의도였음. 병렬 툴 턴이랑은 안 맞음.

    extractSignature는 이미 thoughtSignature / thought_signature / extra_content.google.thought_signature를 봄. google.ts 파서는 part.thoughtSignature만 봄. 업스트림이 스네이크만 주면 메타데이터가 tool_call_start에 안 실림. 리플레이 캐시는 채워져도 히스토리 직렬화는 빈 값임.

    점수는 68임. 2.26.0에서 Antigravity 툴 루프가 실제로 죽음. 80 아님. native-main 503(#2108/#2114)이랑은 다른 줄이고, 릴리즈 게이트도 아님. 2.27에 안 넣어도 됨.

    해결방안은 드래프트 #2127 방향임. 스트림 턴 동안 pending을 청크 너머로 들고, 같은 턴 툴 전부 같은 thought 서명을 받게 하고, 파서도 스네이크를 읽게. 콤팩션/멀티에이전트가 메타데이터를 지우는 경로면 그 다음임. Closes #2125는 필드에서 멀티턴 툴 루프 한 번 보기 전엔 이름.

    이 댓글은 grok-bot이 작성했습니다

  4. lidge-jun commented on Aug 20, 2026

    @lidge-jun
    Owner

    Fixed on dev by #2150, merged as 9a78015.

    Verified present on the branch rather than assumed: git log origin/dev shows the merge commit above. These PRs target dev rather than main, so GitHub does not auto-close the linked issue — this closure is manual.

    It ships in the next release cut from dev. Reopen if you still see it after updating.

  5. added a commit that references this issue on Aug 20, 2026
    1adcfde
  6. agentHits commented on Aug 20, 2026

    @agentHits
    ContributorAuthor

    Update: Encountered this issue again on v2.28.0 (fresh turn, default_api:exec at position 6, and long conversation position 364):

    Provider error 400: Antigravity 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:exec` , position 6. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
    
    Provider error 400: Antigravity 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:exec` , position 364. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
    

    Note on position 6: this can happen in fresh short turns if freeform tool calls (default_api:exec) or certain client history items are replayed without having their thought_signature resolved/re-attached from the store at serialization time.

  7. agentHits commented on Aug 20, 2026

    @agentHits
    ContributorAuthor

    Additional reproduction log on v2.28.0:

    Provider error 400: Antigravity 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:exec` , position 381. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
    

    Follow-up PR opened: #2198 to handle matching unwrapped freeform/custom tool arguments ({ input: string } vs parsed functionCall args) in the replay cache.

  8. Ingwannu commented on Aug 20, 2026

    @Ingwannu
    Owner

    Reopening because the v2.28.0 reports show that #2150 did not cover the complete failure surface.

    The earlier Grok review correctly identified the cross-chunk, parallel-call, and snake_case signature paths fixed by #2150. The new position-6 and position-381 reproductions point to a separate boundary: freeform/custom tool arguments can be represented to the client as { input: "<serialized JSON>" } while Antigravity replay observation stores the parsed function arguments. If those representations do not converge before replay lookup, the signature cannot be restored even in a short history.

    I am reviewing #2198 against the current dev head now. I will keep this issue open until the exact PR head has a regression covering the full observe -> client-visible custom tool -> next-request parse -> Google serialization round trip, and all relevant CI is green. A local lookup-only test is not sufficient to close this again.

  9. agentHits commented on Aug 20, 2026

    @agentHits
    ContributorAuthor

    Additional reproductions on v2.28.0

    • Fresh short turn with freeform tool call:
    Provider error 400: Antigravity 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:exec` , position 15. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
    
    • Long-running conversation history replay:
    Provider error 400: Antigravity 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:exec` , position 496. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
    

    Updated PR #2198 with the requested review fixes:

    1. Restores signature on call && matchedKey directly (independent of ck overflow status).
    2. Bounds argsObj.input.trim() to REPLAY_MAX_CANONICAL_ARGS_BYTES before invoking JSON.parse.
    3. Added regression tests covering oversized whitespace-wrapped matching and pre-parse size rejection.
  10. Ingwannu commented on Aug 20, 2026

    @Ingwannu
    Owner

    Confirmed against the current fix candidate in #2198. On exact head 99412cc85a65db31eca92947440d7ef7a03ee97c, the wrapped/freeform replay path now restores the matched signature after alternate parsed-input lookup, and the parser consumes the already bounded trimmed input.

    Maintainer validation on that head:

    • focused replay/history suites: 82/82 passed
    • typecheck: passed
    • privacy scan: passed

    The report therefore has a credible scoped fix, but this issue should remain open for now: #2198 is still draft with its readiness checklist at 0/4 and does not yet have full exact-head cross-platform CI. The same-name/same-arguments occurrence ambiguity noted in the owner/Grok review is a separate low-frequency follow-up and is not blocking this specific v2.28.0 regression fix.

  11. Ingwannu commented on Aug 20, 2026

    @Ingwannu
    Owner

    The reopened v2.28.0 failure surface is now fixed on dev by #2198, merged as 8ba7caa7945946f42d0b06d3bf55707e71232b4f from exact reviewed head 4e89471a7b9390fb8b1575fe528fe26282fa1c9b.

    This follow-up covers the representation mismatch that remained after #2150: client-visible freeform/custom tool arguments wrapped as { input: "<serialized JSON>" } are bounded, parsed, and matched against the observed Antigravity functionCall arguments so the stored thought_signature can be restored. The full observe -> client history -> next-request parse -> Google serialization round trip is covered by the focused suites.

    Final merge evidence: no unresolved review threads, clean merge against current dev, and all exact-head Linux, Windows-shard, macOS, keyring, npm-global, hygiene, typecheck/test, and privacy gates green. Closing as completed. Please reopen with a fresh trace if the missing-signature 400 still occurs on a build containing 8ba7caa79.

  12. agentHits commented on Aug 22, 2026

    @agentHits
    ContributorAuthor

    Fresh reproduction trace (v2.29.0 / subagent and long turn positions)

    Encountered the following missing thought_signature errors on default_api:exec:

    • Position 7: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 7.`
    • Position 9: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 9.`
    • Position 632: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 632.`
    • Position 637: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 637.`

    Note: These occurred during multi-agent / subagent execution turns and deep conversation history. The recent landing of #2328 (fix(responses): scope reasoning replay by conversation) and #2339 (fix(google): preserve stream signature source order) on dev are directly relevant to ensuring subagents without explicit thread headers maintain replay scope.

  13. agentHits commented on Aug 22, 2026

    @agentHits
    ContributorAuthor

    Extended error traces from long-running sessions and multi-turn workflows

    During active use of Antigravity (gemini-3.7-flash), the Function call is missing a thought_signature error recurred at both early positions and deep conversation history:

    • Position 7: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 7.`
    • Position 9: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 9.`
    • Position 632: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 632.`
    • Position 1500: Provider error 400: Antigravity invalid request: Function call is missing a thought_signature in functionCall parts. ... function call \default_api:exec` , position 1500.`

    Root causes & Observations:

    1. Early positions (7, 9): Associated with headerless/subagent requests (addressed by chore: merge train 260821 — land #2281 (Claude Code thought-signature replay) #2328) and freeform input representation mismatches in history (addressed by fix(google): match unwrapped freeform tool arguments in antigravity replay cache #2198).
    2. Deep positions (632, 1500): In deep sessions with hundreds of tool invocations, the legacy default limits (REPLAY_MAX_CALLS_PER_SESSION = 256, REPLAY_TTL_MS = 1h) cause LRU eviction of early historical calls within long active threads. Scaling limits to match the 7-day TTL and higher call capacity of the durable store prevents early history calls from losing their cached signatures in 500+ call sessions.
  14. agentHits commented on Aug 22, 2026

    @agentHits
    ContributorAuthor

    Position 1952 reproduction on v2.31.0

    Provider error 400: Antigravity 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:exec\` , position 1952. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.
    

    Local diagnostic evidence

    I inspected ~/.opencodex/antigravity-replay.json while the error was occurring:

    • Session 607ffc7a377b… had exactly 256 cached calls — the legacy REPLAY_MAX_CALLS_PER_SESSION = 256 cap, with the oldest entries LRU-evicted as new calls arrived.
    • The session was still active (expiresAtMs ~53 min remaining), so TTL was not the cause; pure capacity eviction at 256 calls caused positions >256 to lose their signatures.
    • This matches the position-1827 / position-1500 reports earlier in this thread.

    Fix status

    PR #2375 scales REPLAY_MAX_CALLS_PER_SESSION to 8,192 (and per-session bytes to 8 MiB) to cover these depths. I have verified the fix locally with a 1,500-call regression test that survives snapshot flush/reset/reload under production default limits.

    Requesting review on #2375 when you have a moment — this is actively blocking long-running Antigravity sessions.

  15. added 2 commits that reference this issue on Sep 17, 2026
    104967c
    57aea2a
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

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirkstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions