openclaw - 💡(How to fix) Fix [Bug]: google-antigravity provider broken: API deprecated version 1.21.9, internal token refresh corrupts credential cache [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74314Fetched 2026-04-30 06:25:37
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Author
Timeline (top)
commented ×1labeled ×1

The **google-antigravity** provider stopped working on 2026-04-29. Two separate bugs:

Bug 1: Antigravity API deprecated version 1.21.9

The sandbox endpoint daily-cloudcode-pa.sandbox.googleapis.com now rejects
requests with User-Agent antigravity/1.21.9 with HTTP 200 but body:

"This version of Antigravity is no longer supported. Please upgrade to receive the latest features."

Versions 1.25.0+ are accepted. The DEFAULT_ANTIGRAVITY_VERSION in
@mariozechner/pi-ai is hardcoded to 1.21.9 and needs to be bumped.

Workaround: Set env var PI_AI_ANTIGRAVITY_VERSION=1.25.0 in the gateway
service (e.g. in systemd unit file).

Models that respond with 1.25.0:

  • gemini-3-flash only working
  • gemini-2.5-pro 503 (no capacity on sandbox)
  • gemini-3.1-pro-preview 404

Bug 2: Internal token refresh corrupts runtime credential cache

After any auth failure, openclaw marks the provider as failed and stores a bad
state in runtimeAuthStoreSnapshots (in-memory Map). Even after the OAuth token is refreshed externally (or via the built-in timer), the gateway
continues to fail with:

FailoverError: Invalid Google Cloud Code Assist credentials. Use /login
to re-authenticate.

This happens because resolveApiKeyForProfile returns null (expired/failed
state from the runtime snapshot), causing JSON.parse(null) to throw in the provider code at google-gemini-cli.js:230.

The only recovery is a full gateway restart. The on-disk auth-profiles.json
is correctly updated by token refresh, but the in-memory snapshot is never
invalidated after a failure.

Expected: gateway should clear the runtime snapshot for a provider after
a successful token refresh, allowing recovery without restart.

Error Message

POST https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse
User-Agent: antigravity/1.21.9 darwin/arm64

HTTP 200:
data: {"response": {"candidates": [{"content": {"parts": [{"text": "This version of
Antigravity is no longer supported. Please upgrade to receive the latest features."}]}}]}}

13:05:16 [WARN] stuck session: state=processing age=136s queueDepth=1
13:05:20 [WARN] auth profile failure state updated
13:05:20 [ERROR] lane task error: error="FailoverError: Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate."
13:05:20 [WARN] model fallback decision
13:05:20 [ERROR] Embedded agent failed before reply: Invalid Google Cloud Code Assist credentials.

// After token refresh (timer ran at 13:09:42, new token written to auth-profiles.json):
13:10:28 [WARN] auth profile failure state updated
13:10:28 [ERROR] lane task error: error="FailoverError: Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate."
// Same error despite fresh token — confirms in-memory cache not invalidated

Token refresh log (/tmp/openclaw-token-refresh.log):
google-antigravity token refreshed, expires in 3599s (1777461581174)
google-antigravity token refreshed, expires in 3599s (1777464341480) ← ran at 13:09, still failed at 13:10

Root Cause

This happens because resolveApiKeyForProfile returns null (expired/failed
state from the runtime snapshot), causing JSON.parse(null) to throw in the provider code at google-gemini-cli.js:230.

Fix Action

Fix / Workaround

"This version of Antigravity is no longer supported. Please upgrade to receive the latest features."

Workaround: Set env var PI_AI_ANTIGRAVITY_VERSION=1.25.0 in the gateway
service (e.g. in systemd unit file).

Bug 1: All requests to daily-cloudcode-pa.sandbox.googleapis.com return
HTTP 200 but with body:

"This version of Antigravity is no longer supported. Please upgrade to
receive the latest features."
The gateway logs FailoverError: Invalid Google Cloud Code Assist credentials
and falls back to the next model

Code Example

POST https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse                                                                                                                                               
  User-Agent: antigravity/1.21.9 darwin/arm64                                                    
                                                                                                                                                                                                                                                
  HTTP 200:                                                                                                                                                                                                                                   
  data: {"response": {"candidates": [{"content": {"parts": [{"text": "This version of                                                                                                                                                           
  Antigravity is no longer supported. Please upgrade to receive the latest features."}]}}]}} 

13:05:16 [WARN] stuck session: state=processing age=136s queueDepth=1                                                                                                                                                                       
  13:05:20 [WARN] auth profile failure state updated                                                                                                                                                                                            
  13:05:20 [ERROR] lane task error: error="FailoverError: Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate."                                                                                                         
  13:05:20 [WARN] model fallback decision                                                                                                                                                                                                       
  13:05:20 [ERROR] Embedded agent failed before reply: Invalid Google Cloud Code Assist credentials.                                                                                                                                            
                                                                                                                                                                                                                                                
  // After token refresh (timer ran at 13:09:42, new token written to auth-profiles.json):                                                                                                                                                      
  13:10:28 [WARN] auth profile failure state updated                                                                                                                                                                                            
  13:10:28 [ERROR] lane task error: error="FailoverError: Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate."                                                                                                         
  // Same error despite fresh token — confirms in-memory cache not invalidated                                                                                                                                                                  
                                                                                                                                                                                                                                                
  Token refresh log (/tmp/openclaw-token-refresh.log):                                                                                                                                                                                        
  google-antigravity token refreshed, expires in 3599s (1777461581174)                                                                                                                                                                          
  google-antigravity token refreshed, expires in 3599s (1777464341480)  ← ran at 13:09, still failed at 13:10
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

                                                                                                                                                                                                                                                                     The `**google-antigravity**` provider stopped working on 2026-04-29. Two separate bugs:

Bug 1: Antigravity API deprecated version 1.21.9

The sandbox endpoint daily-cloudcode-pa.sandbox.googleapis.com now rejects
requests with User-Agent antigravity/1.21.9 with HTTP 200 but body:

"This version of Antigravity is no longer supported. Please upgrade to receive the latest features."

Versions 1.25.0+ are accepted. The DEFAULT_ANTIGRAVITY_VERSION in
@mariozechner/pi-ai is hardcoded to 1.21.9 and needs to be bumped.

Workaround: Set env var PI_AI_ANTIGRAVITY_VERSION=1.25.0 in the gateway
service (e.g. in systemd unit file).

Models that respond with 1.25.0:

  • gemini-3-flash only working
  • gemini-2.5-pro 503 (no capacity on sandbox)
  • gemini-3.1-pro-preview 404

Bug 2: Internal token refresh corrupts runtime credential cache

After any auth failure, openclaw marks the provider as failed and stores a bad
state in runtimeAuthStoreSnapshots (in-memory Map). Even after the OAuth token is refreshed externally (or via the built-in timer), the gateway
continues to fail with:

FailoverError: Invalid Google Cloud Code Assist credentials. Use /login
to re-authenticate.

This happens because resolveApiKeyForProfile returns null (expired/failed
state from the runtime snapshot), causing JSON.parse(null) to throw in the provider code at google-gemini-cli.js:230.

The only recovery is a full gateway restart. The on-disk auth-profiles.json
is correctly updated by token refresh, but the in-memory snapshot is never
invalidated after a failure.

Expected: gateway should clear the runtime snapshot for a provider after
a successful token refresh, allowing recovery without restart.

Steps to reproduce

Environment

  • OpenClaw: 2026.4.26
  • @mariozechner/pi-ai: 0.70.2 (same bug in 0.70.6)
  • Provider: google-antigravity

Expected behavior

DEFAULT_ANTIGRAVITY_VERSION should be updated to 1.25.0 or higher (or made dynamically configurable without requiring a manual env var override)

fter a successful token refresh, the gateway should clear the stale runtime credential snapshot for the affected provider, allowing recovery without a full restart.

Actual behavior

Bug 1: All requests to daily-cloudcode-pa.sandbox.googleapis.com return
HTTP 200 but with body:

"This version of Antigravity is no longer supported. Please upgrade to
receive the latest features."
The gateway logs FailoverError: Invalid Google Cloud Code Assist credentials
and falls back to the next model

Bug 2: After an auth failure, runtimeAuthStoreSnapshots retains the bad
credential state. Subsequent requests fail immediately with:

FailoverError: Invalid Google Cloud Code Assist credentials. Use /login
to re-authenticate.
This happens even after a successful token refresh (confirmed: new token written
to auth-profiles.json, errorCount reset to 0, but gateway still fails).
Only a full gateway restart resolves it.

OpenClaw version

2026.4.26

Operating system

Ubuntu 22.04.5 LTS, Linux 5.15, x86_64

Install method

npm global

Model

google-antigravity/gemini-3-flash all 3+

Provider / routing chain

openclaw -> google-antigravity -> daily-cloudcode-pa.sandbox.googleapis.com

Additional provider/model setup details

Regression: last known good 2026-04-28 (~15:39 UTC, confirmed via auth-state.json lastUsed timestamp). First known bad: 2026-04-29 ~05:21 UTC
(lastFailureAt timestamp in auth-state.json).

Workaround for Bug 1: set env var PI_AI_ANTIGRAVITY_VERSION=1.25.0 in gateway
service. With this, gemini-3-flash responds correctly. gemini-2.5-pro returns
503 (no capacity on sandbox).

Workaround for Bug 2: restart the gateway after every token refresh. We added
a systemctl --user restart openclaw-gateway call at the end of the token refresh script as a stopgap.

Tested @mariozechner/pi-ai versions 0.70.2 through 0.70.6 — antigravity code
is identical across all versions, neither bug is fixed in 0.70.6.

Logs, screenshots, and evidence

POST https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse                                                                                                                                               
  User-Agent: antigravity/1.21.9 darwin/arm64                                                    
                                                                                                                                                                                                                                                
  HTTP 200:                                                                                                                                                                                                                                   
  data: {"response": {"candidates": [{"content": {"parts": [{"text": "This version of                                                                                                                                                           
  Antigravity is no longer supported. Please upgrade to receive the latest features."}]}}]}} 

13:05:16 [WARN] stuck session: state=processing age=136s queueDepth=1                                                                                                                                                                       
  13:05:20 [WARN] auth profile failure state updated                                                                                                                                                                                            
  13:05:20 [ERROR] lane task error: error="FailoverError: Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate."                                                                                                         
  13:05:20 [WARN] model fallback decision                                                                                                                                                                                                       
  13:05:20 [ERROR] Embedded agent failed before reply: Invalid Google Cloud Code Assist credentials.                                                                                                                                            
                                                                                                                                                                                                                                                
  // After token refresh (timer ran at 13:09:42, new token written to auth-profiles.json):                                                                                                                                                      
  13:10:28 [WARN] auth profile failure state updated                                                                                                                                                                                            
  13:10:28 [ERROR] lane task error: error="FailoverError: Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate."                                                                                                         
  // Same error despite fresh token — confirms in-memory cache not invalidated                                                                                                                                                                  
                                                                                                                                                                                                                                                
  Token refresh log (/tmp/openclaw-token-refresh.log):                                                                                                                                                                                        
  google-antigravity token refreshed, expires in 3599s (1777461581174)                                                                                                                                                                          
  google-antigravity token refreshed, expires in 3599s (1777464341480)  ← ran at 13:09, still failed at 13:10

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Update the DEFAULT_ANTIGRAVITY_VERSION to 1.25.0 or higher and clear the runtime credential snapshot after a successful token refresh to resolve the issues with the google-antigravity provider.

Guidance

  • Update the DEFAULT_ANTIGRAVITY_VERSION in @mariozechner/pi-ai to 1.25.0 or higher to resolve Bug 1.
  • Set the env var PI_AI_ANTIGRAVITY_VERSION=1.25.0 in the gateway service as a temporary workaround for Bug 1.
  • Clear the runtime credential snapshot for the affected provider after a successful token refresh to resolve Bug 2.
  • Restart the gateway after every token refresh as a temporary workaround for Bug 2.

Example

No code snippet is provided as the issue does not require a code change, but rather a version update and a change in the runtime credential snapshot handling.

Notes

The issues are specific to the google-antigravity provider and are caused by a deprecated API version and a corrupted runtime credential cache. The workarounds provided can help mitigate the issues until a permanent fix is implemented.

Recommendation

Apply the workaround by setting the env var PI_AI_ANTIGRAVITY_VERSION=1.25.0 and restarting the gateway after every token refresh, as updating the DEFAULT_ANTIGRAVITY_VERSION may require a new release of @mariozechner/pi-ai.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

DEFAULT_ANTIGRAVITY_VERSION should be updated to 1.25.0 or higher (or made dynamically configurable without requiring a manual env var override)

fter a successful token refresh, the gateway should clear the stale runtime credential snapshot for the affected provider, allowing recovery without a full restart.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING