[Bug] Antigravity returns HTTP 503 MODEL_CAPACITY_EXHAUSTED for all models when connected to WSL

Problem Description

I’m using Antigravity 1.107.0 on Windows with WSL2 (Ubuntu). When running Antigravity directly on Windows (local workspace), everything works perfectly — all models respond normally. However, when I connect to WSL via the Remote extension, every single model fails with the following error:

HTTP 503 Service Unavailable

{

“error”: {

"code": 503,

"details": \[

  {

    "@type": "type.googleapis.com/google.rpc.ErrorInfo",

    "domain": "cloudcode-pa.googleapis.com",

    "metadata": {

      "model": "gemini-3.1-pro-high"

    },

    "reason": "MODEL_CAPACITY_EXHAUSTED"

  }

\],

"message": "No capacity available for model gemini-3.1-pro-high on the server",

"status": "UNAVAILABLE"

}

}

This error occurs for all models (Gemini, Claude, etc.), not just a specific one. Switching models does not help.

Environment

  • OS: Windows 11 + WSL2 (Ubuntu)

  • Antigravity Version: 1.107.0 (commit 62335c71d47037adf0a8de54e25)

  • Connection: Antigravity on Windows → Remote WSL extension → WSL2 Ubuntu

Root Cause Analysis

After extensive debugging, I found that the issue is not related to actual model capacity — it is caused by the WSL remote session hitting the wrong API endpoint.

When Antigravity connects to WSL, the language server process on the WSL side is launched with:

--cloud_code_endpoint https://daily-cloudcode-pa.googleapis.com

This is the daily/staging endpoint, which has very limited (or no) capacity for regular users. In contrast, when running locally on Windows, the correct production endpoint is used:

--cloud_code_endpoint https://cloudcode-pa.googleapis.com

The root cause lies in the URL selection logic inside main.js (the Tws function in the cloudCode.js module):

javascript

function Tws({isDevMode, isGoogleInternal, isGcpTos, isTierGCPTos, cloudCodeUrlOverride}) {

return cloudCodeUrlOverride ||

       (isGoogleInternal && isDevMode ? AUTOPUSH_URL : 

isGcpTos || isTierGCPTos === true || isTierGCPTos === undefined

? PRODUCTION_URL // “https://cloudcode-pa.googleapis.com

: DAILY_URL) // “https://daily-cloudcode-pa.googleapis.com” ← BUG

}

When connected to WSL remote, the isGcpTos and isTierGCPTos conditions evaluate differently compared to the local Windows context (possibly due to OAuth token state sync issues in the remote scenario), causing the function to fall through to the DAILY_URL instead of PRODUCTION_URL.

Workaround

Add the following setting to your Windows-side Antigravity user settings file (%APPDATA%\Antigravity\User\settings.json):

json

{

“jetski.cloudCodeUrl”: “https://cloudcode-pa.googleapis.com

}

This setting is read as cloudCodeUrlOverride in the URL selection function and takes the highest priority, bypassing the faulty conditional logic entirely.

Important: After adding this setting, you must fully restart Antigravity (not just reconnect to WSL) for the change to take effect, since the setting is read by the Windows main process.

Summary

Scenario Endpoint Used Result
Windows local cloudcode-pa.googleapis.com (production) :white_check_mark: Works
WSL remote (before fix) daily-cloudcode-pa.googleapis.com (staging) :cross_mark: 503 for all models
WSL remote (after fix) cloudcode-pa.googleapis.com (production) :white_check_mark: Works

This appears to be a bug in the endpoint selection logic when Antigravity operates in a remote (WSL/SSH) context. The isTierGCPTos / isGcpTos state does not propagate correctly to the remote session, causing the daily endpoint fallback to trigger for non-Google-internal users.

1 Like

You are amazing! Antigravity is finally usable for me.

I just registered into this forum just to say THANK YOU

I am experiencing the exact same issue with Antigravity on WSL.

While I really appreciate the detailed root cause analysis and the provided workaround, I am actually a bit hesitant to manually apply the cloudCodeUrl override in my settings.json. I’ve seen comments elsewhere suggesting that tampering with these internal endpoint configurations might flag the account or potentially lead to a ban.

Because of that risk, I’m holding off on the workaround. I really hope the official Google team sees this thread and pushes a proper fix for the WSL endpoint routing bug as soon as possible. It’s incredibly frustrating having all the models completely broken on WSL in the meantime!

1 Like

Hello, don’t worry. My current ide version is 1.22.2, and I am also developing the project in wsl2. The error log of the 503 problem encountered recently points to “< b0 > https://cloudcode-pa.googleapis.com ”, not “< b1 > https://daily-cloudcode-pa.googleapis.com ” So I feel that antigravity has really encountered a problem of insufficient capacity recently, and I am currently waiting for a fix.

Try running your Batch API script directly from PowerShell or the Windows Command Prompt (without WSL) to see if the problem persists. If in Windows it works but in WSL it fails, then the problem is purely in your WSL network configuration.

  • > Blockquote

I’m glad my post could help you.

This is indeed quite a headache. Although I hadn’t noticed the specific issue you mentioned, I simply attempted to fix the problem myself. That is precisely why I posted this thread: firstly, in the hope of helping others who might be encountering the same issue; and secondly, in the hope that Google developers might take notice of this potential problem.

I’m glad my post could help you.