Repository navigation
fix(antigravity): fail a bare RESOURCE_EXHAUSTED once when quota is nearly full - #503
Merged
Merged
Conversation
… caps and retry delays out of it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Google's Cloud Code service now rejects some request content (the Code Mode prompt containing
tools.opencode.session_move) with an instant bare429 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(noErrorInforeason) 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:CONTENT_BLOCKEDreason, so the error is classified as a non-retryable content-policy rejection and fails once;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 asQUOTA_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 typecheckpackages/core:session-antigravity-error.test.ts+provider-antigravity.test.ts(15 pass),bun typecheck. The new end-to-end case assertsContentPolicyand that it is not retryable.bun run checkpassed.Visual