How to fix Agent terminated due to error

Gemini 3.1 High/Low frequently crashes with:

Agent terminated due to error

Claude (Opus/Sonnet) and Gemini 3 Flash work fine on the same setup.

Anyone else having this issue?

full error =>

Trajectory ID: 3ccfa07c-9343-44a0-887a-1b11d8f9…

Error: HTTP 503 Service Unavailable

Sherlog:

TraceID: 0xa0ec238abc557…

Headers: {“Alt-Svc”:[“h3=\”:443\“; ma=2592000,h3-29=\”:443\“; ma=2592000”],“Content-Length”:[“525”],“Content-Type”:[“text/event-stream”],“Date”:[“Thu, 07 May 2026 07:17:46 GMT”],“Server”:[“ESF”],“Server-Timing”:[“gfet4t7; dur=1321”],“Vary”:[“Origin”,“X-Origin”,“Referer”],“X-Cloudaicompanion-Trace-Id”:[“a0ec238abc557…”],“X-Content-Type-Options”:[“nosniff”],“X-Frame-Options”:[“SAMEORIGIN”],“X-Xss-Protection”:[“0”]}

{

“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"

  },

  {

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

    "retryDelay": "13s"

  }

\],

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

"status": "UNAVAILABLE"

}

}

bro it just happened to me last week, sometimes its the MCP, sometimes or most of the times actually its the chats folder, i dont remeber the exact folder to chats from antigravity, but i completely ereased the content inside and obviously did a backup before, but that solves the problem to me, or maybe now gemini its a little bit inconsistent, beacause im programming a front end, not much context in the chat and keep broking to me, like infinite (Thinking…) loading, i ispend 18 minutes waiting for him to think and just gave up