Skip to content

fix(antigravity): fail a bare RESOURCE_EXHAUSTED once when quota is nearly full - #503

Merged
shuv1337 merged 2 commits into
integration-v2from
antigravity-no-retry
Nov 18, 2026
Merged

shuv1337 merged 2 commits into
integration-v2from
antigravity-no-retry

Conversation

@shuv1337

@shuv1337 shuv1337 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Google's Cloud Code service now rejects some request content (the Code Mode prompt containing tools.opencode.session_move) with an instant bare 429 RESOURCE_EXHAUSTED, even though quota is untouched. The plugin treated that as a throttle, so every Gemini prompt was retried about 11 times before failing with a misleading quota message.

The change: when Cloud Code sends a bare RESOURCE_EXHAUSTED (no ErrorInfo reason) and the failed model's own 5h quota bucket still has at least 95% left, no other window in that group is exhausted, and there is no retry delay, the plugin now:

  • adds a CONTENT_BLOCKED reason, so the error is classified as a non-retryable content-policy rejection and fails once;
  • leads the message with what is likely happening: "This is likely not quota: at least 95% of this model's quota is unused, so Google probably rejected this request's content. Not retrying; changing the prompt or switching models may help.", followed by the existing quota readout.

These cases still retry: an explicit reason (for example RATE_LIMIT_EXCEEDED), partly used quota, and no quota summary. Real quota exhaustion is still reported as QUOTA_EXHAUSTED. This does not try to get past Google's check; whether to do that is the user's decision.

Evidence for the content rule: ~/.cache/agent-ws/ag-429/findings.md (shuvdev).

No feature flag: this is an error-classification fix. It ships in the next regular release.

Verification

  • packages/antigravity-plugin: bun test (84 pass), bun run typecheck
  • packages/core: session-antigravity-error.test.ts + provider-antigravity.test.ts (15 pass), bun typecheck. The new end-to-end case asserts ContentPolicy and that it is not retryable.
  • The pre-push bun run check passed.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none" stroke="currentColor" font-family="ui-sans-serif,system-ui" font-size="10">
<style>.r{opacity:.25;animation:f 3s infinite}.r2{animation-delay:.3s}.r3{animation-delay:.6s}@keyframes f{0%,100%{opacity:.08}50%{opacity:.25}}@media (prefers-reduced-motion:reduce){.r{animation:none}}</style>
<g class="r"><rect x="10" y="10" width="14" height="14" rx="3"/></g><g class="r r2"><rect x="30" y="10" width="14" height="14" rx="3"/></g><g class="r r3"><rect x="50" y="10" width="14" height="14" rx="3"/></g>
<text x="72" y="21" fill="currentColor" stroke="none" opacity=".5">429 ×11 retries (before)</text>
<rect x="10" y="44" width="14" height="14" rx="3" fill="currentColor" stroke="none"/>
<text x="32" y="55" fill="currentColor" stroke="none">429 once: "likely content, not quota"</text>
</svg>

@shuv1337
shuv1337 merged commit 0fa137a into integration-v2 Nov 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant