Home/Wiki Errors/Google Antigravity
Google Antigravity / OAuth/Auth

Failed to get OAuth token: state syncing error: key not found - Antigravity

The local token store and the active Google session are out of sync. The IDE can show a signed-in state while background services cannot fetch credentials.

Antigravity failed to get OAuth token state syncing errorAntigravity key not found authInvalid Google Cloud Code Assist credentials
Paste an error to match it against the wiki. / 粘贴报错后自动匹配。

Error text / 报错原文

  • Failed to get OAuth token
  • state syncing error: key not found
  • Invalid Google Cloud Code Assist credentials

What it means

The local token store and the active Google session are out of sync. The IDE can show a signed-in state while background services cannot fetch credentials.

Most common causes

  • Machine sleep or account switch invalidated cached tokens
  • Multiple Google accounts share the same browser profile
  • Cloud Code Assist credentials are stale
  • Account lacks required project or API access

Fastest fix

  • Sign out, fully close the app, and sign in again
  • Clear only Antigravity auth token cache if normal sign-in loops
  • Use the same Google account in browser and IDE
  • Check whether required Google APIs are enabled

Safe fix

  • Use a dedicated work profile for agent IDEs
  • Avoid mixing personal and Workspace accounts in one session
  • Keep audit logs for organization accounts
  • Prefer service accounts for production MCP servers

What not to do

  • Do not store Google OAuth tokens in repo files
  • Do not switch accounts mid-agent run
  • Do not ignore repeated auth failures before destructive tasks

How to confirm the fix

Run the smallest reproducible command first, then retry the agent task only after authentication, quota, and tool discovery are stable.

echo $GOOGLE_APPLICATION_CREDENTIALS
gcloud auth list
gcloud config list account

Related errors

Related tools

Sources