Repository navigation
Conversation
…4 / Claude 5.5 usage
…K-110) Use the selected generation endpoint for both quota APIs; keep streaming clients alive before response headers and report committed failures through SSE instead of silent failover EOF.
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.
Antigravity Gemini usage can stay at 0% (or a stale weekly value) while generation consumes a different endpoint's quota. Separately, large streaming requests can hit a reverse proxy's 60-second idle timeout before upstream response headers arrive, before the existing stream-reader keepalive starts.
This PR completes the earlier quota-display work in #8157 and adds the missing response-header keepalive stage. It is built directly on upstream
mainat8f2cbb53d; it does not merge the fork's main branch.Quota behavior
fetchAvailableModelsandretrieveUserQuotaSummaryfromresolveAntigravityForwardBaseURL(account), following the endpoint-alignment approach in @Achordchan's fix(antigravity): fetch quotas from the forwarding endpoint #8214. A successful response from another endpoint must not conceal the selected endpoint's quota or errors; fixed-endpoint probes do not redirect or fall back across endpoints.disabledbuckets, and retain model-level fallback when quota summary retrieval is unavailable.The endpoint mismatch was observed with one paid account using the same token/project: prod returned Gemini weekly used 7.004% / 5h 0%, while daily returned 37.684% / 5h 2.902%. Claude values agreed across endpoints. No credentials or account-specific configuration are included.
Streaming behavior
This extends #7643 / #7637, which handle silence after upstream headers have been received. The motivating production trace showed repeated approximately 34 MB requests failing at 60 seconds with Nginx
upstream timed out ... while reading response header; a small request on the same account succeeded in 5.7 seconds.Relationship to existing work
Validation
On this clean upstream-based branch:
go test -tags=unit ./internal/pkg/antigravity -count=1go test -race -tags=unitfor the new quota endpoint cases and header keepalive/error/cancellation cases.go vet ./internal/pkg/antigravity ./internal/service ./internal/handlerandgo build ./cmd/server.vue-tsc -b,vite build, and ESLint on changed production frontend files.git diff --checkpassed.The quota/header fixes were deployed in the fork and passed service health checks; the original large production conversation has not been replayed after deployment. The pre-existing two-minute first-content limit is unchanged (checked by the stream reader after headers arrive). This PR does not add keepalives during retry backoff or change that timeout policy.