Skip to content

Explain Antigravity location rejections when reading usage - #33420

Closed
gentslava wants to merge 5 commits into
stablyai:mainfrom
gentslava:gentslava/upstream-antigravity-usage-errors
Closed

gentslava wants to merge 5 commits into
stablyai:mainfrom
gentslava:gentslava/upstream-antigravity-usage-errors

Conversation

@gentslava

@gentslava gentslava commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Source and validation

Includes upstream main through 1187abdbc2554f69e281868a83f4ab0ca045276b. The base refresh preserves this PR's feature scope and passed ordinary commit hooks. Validation and visual evidence below retain their stated source revisions. Complete upstream CI remains pending.

Known upstream base issue: Node typechecking at this main revision reports switchedBuild missing in workspace-layout-paired-desktop.test.ts:50. This PR retains that upstream file unchanged; the layout-test repair is separate from its feature scope.

ELI5

When Antigravity says usage is unavailable in your location, show that explanation instead of a misleading refresh error.

What Changed

When agy 1.4.7 rejects a background /usage read because Antigravity is unavailable in the current location, Orca currently discards that explanation and reports “CLI did not report a quota (exit 1)” / “Refresh failed”. Recognize the captured eligibility rejection and show unavailable usage with a fixed, safe explanation from the CLI.

This preserves the existing usage-unavailable wire kind and uses only an optional local classifier reason. It changes no quota source, auth, proxy, CLI flags or network routing. Successful readings, structured-error precedence, timeouts and the model-turn guard retain their behavior. A location rejection does not latch, so a later valid quota response can recover. Arbitrary CLI output is never exposed.

Why

The captured response is a known eligibility rejection, so treating it as an unreadable quota hides the useful explanation. Classifying that exact rejection and returning fixed guidance through the existing unavailable state preserves the established parser and safety guards without exposing arbitrary CLI output.

This corrects diagnosis, not provider availability: the observed CLI still rejects the metadata read on the current route. A working interactive quota view does not establish that the independent background read succeeded; no live quota-retrieval repair is claimed.

Linked Issue

Fixes #33426

Refs #33357.

Visual Proof

English hidden Electron/CDP fixture using the actual production fetcher, UsageRow, ProviderPanel, and canonical CSS with the same sanitized captured eligibility rejection. Before: d58849a7d8d68929bd0e686571678d85e70740af; after: 8262a97354736ee3ee0423c85e8544fa228e83ea (exact Git source snapshots).

Before After
Generic parse error and Refresh failed Usage unavailable with the CLI location explanation
Before on a narrow English light layout After on a narrow English light layout

Source-identified proof and scope. The fixture joins two existing production components for inspection; it is not the global app/provider workflow. No DOM text replacement, image editing, real account data, or provider calls were used.

Testing

Validation: five regression failures before the correction; 184 focused tests across classifier, fetcher, successful parser, service isolation and renderer copy pass, with node/web typechecks, changed-lines quality and normal hooks. A sanitized fixture preserves the real error envelope with zero turns/token use.

  • Local automated and component validation completed; evidence is listed in Testing
  • Automated tests added/updated, or explained why not below

Full-app manual testing is not claimed. On macOS only, an agent-driven hidden production-component fixture plus screenshot inspection verified the exact generic parse/“Refresh failed” before state and unavailable/location-guidance after state. Eight English dark/light and desktop/narrow captures assert no horizontal overflow, page/console errors, attempted HTTP requests, or visible/focused windows. The wrapper was rebuilt before launch, with ORCA_BACKGROUND_LAUNCH=1 and an isolated profile.

To reproduce the automated regression coverage:

ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/rate-limits/antigravity-usage-error.test.ts src/main/rate-limits/antigravity-usage-fetcher.test.ts src/main/rate-limits/antigravity-usage-response.test.ts src/main/rate-limits/service-antigravity-usage.test.ts src/renderer/src/components/status-bar/usage-error-copy.test.ts src/renderer/src/components/status-bar/tooltip.test.ts src/renderer/src/components/status-bar/owner-usage-rate-limits.test.ts --maxWorkers=2

Linux, Windows, SSH/live remote, and native mobile execution were not tested. This corrects diagnosis; actual quota availability remains unresolved.

AI Disclosure

Implementation and review assistance used OpenAI Codex (GPT-6 family) and supervised Codex workers using the runtime default model. Exact worker model IDs were not reported by the runtime. Validation was agent-driven; no human-only review is claimed.

Review

Independent diagnostic review traced the captured zero-turn rejection through classifier, fetcher, and renderer copy; five regressions failed before the correction and the final focused batch passed. The current CodeRabbit review reports no actionable code comments. Its description warning is addressed by this completed template, concrete issue, and before/after proof. The generic docstring-coverage warning is not an executed CI failure: repository AGENTS guidance asks for concise comments only when code does not explain itself, so no blanket docstrings were added to otherwise self-describing functions.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No new wire enum, RPC, retry, process flag, quota source, auth behavior, or platform/workspace assumption is introduced. Existing clients understand unavailable / usage-unavailable and receive the safe explanation through the existing error field. Quota ownership remains on the execution host; folder workspaces and mobile/mixed-version clients retain the existing contract. Security, cross-platform, remote, backwards compatibility, and performance were considered; execution limits are stated above.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — focused local checks are documented above; complete repository gates are assigned to upstream PR CI

The final item stays unchecked: the targeted tests/typechecks/changed-lines checks above passed, but a full repository lint/test/build result on this independent PR head is not claimed. Upstream workflows still require maintainer approval. The full-app manual test remains unchecked; the documented hidden component captures have narrower scope.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9931d1a3-e310-4e98-97e9-81bd6297630d
Commits

Reviewing files that changed from the base of the PR and between f179127 and ff883ab.

Files selected for processing: 5
  • src/main/rate-limits/antigravity-usage-error.test.ts
  • src/main/rate-limits/antigravity-usage-error.ts
  • src/main/rate-limits/antigravity-usage-fetcher.test.ts
  • src/main/rate-limits/antigravity-usage-fetcher.ts
  • src/renderer/src/components/status-bar/usage-error-copy.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Walkthrough

The changes classify Antigravity location rejections as usage-unavailable, return an unavailable usage result without exposing diagnostic payloads, and display “Usage unavailable” in the status bar. Tests cover classification, diagnostic precedence, sanitized errors, and parse failures.

Priority: Low

Severity of issue fixed: Low

Merge Risk: Minimal · up to ff883

The change is mergeable after normal checks; no concrete issue requiring a fix before merge remains identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: explaining Antigravity location rejections during usage reads.
Linked Issues check Passed Issue #33426 requires safe handling of the specified Antigravity location rejection. The supplied whole-PR evidence shows that classifyAntigravityUsageFailure recognizes the configured rejection and…
Out of Scope Changes check Passed The changes remain within issue #33426. The source changes classify one known rejection, map it to the existing unavailable state, and display the required safe explanation. The fixture and classifier…
Description check Passed The pull request description follows the required template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI usage, review notes, scope boundaries, platf…
Full details: Linked Issues check

Explanation

Issue #33426 requires safe handling of the specified Antigravity location rejection. The supplied whole-PR evidence shows that classifyAntigravityUsageFailure recognizes the configured rejection and returns usage-unavailable with location-unavailable. The fetcher returns the existing unavailable contract with fixed CLI guidance and no quota data. The renderer labels this state Usage unavailable. Tests cover the captured response, stdout and stderr, structured-error precedence, arbitrary-diagnostic suppression, successful readings, timeouts, model-turn precedence, and later recovery.

Full details: Out of Scope Changes check

Explanation

The changes remain within issue #33426. The source changes classify one known rejection, map it to the existing unavailable state, and display the required safe explanation. The fixture and classifier, fetcher, renderer, and diagnostic tests directly support this behavior. The supplied evidence identifies no unrelated change to quota sources, authentication, routing, retries, wire kinds, or provider availability.

Full details: Description check

Explanation

The pull request description follows the required template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI usage, review notes, scope boundaries, platform limitations, and checklist status. It clearly states that full repository validation and some platform testing remain incomplete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gentslava

Copy link
Copy Markdown
Contributor Author

Completed the repository PR template, linked the specific issue (Fixes #33426; Refs #33357), and added English before/after production-component proof. This corrects the original “no GUI change” claim: the visible status/error changes from generic parse / “Refresh failed” to unavailable usage with the fixed CLI location explanation.

Exact d58849a7 / 8262a973 production fetcher/components and canonical CSS render the same sanitized zero-turn response. Eight hidden macOS Electron/CDP captures passed English, overflow, renderer-error, no-attempted-HTTP-request, and hidden/unfocused-window assertions. Scope is component proof, not repaired provider availability or full-app/remote validation; AI assistance, platform limits, review, skill boundary, and unverified full gates are explicit in the body.

The docstring-coverage item is a generic review warning, not an executed CI failure. Repository AGENTS guidance asks for concise comments only where code does not explain itself, so no blanket docstrings were added to self-describing functions. The 184 focused tests, Node/web typechecks, and changed-lines quality passed; upstream CI still requires maintainer approval.

@gentslava

Copy link
Copy Markdown
Contributor Author

Fixed the CI TypeScript project boundary in f179127. The renderer copy test imported the host fetcher and pulled 20 server modules into the composite web project. The captured CLI rejection → production fetcher → renderer diagnostic regression now lives in the existing tests/e2e/**/*.unit.test.ts suite; the renderer unit test checks the shared ProviderRateLimits contract. Production code, tsconfigs, runtime pixels, and the English visual proof are unchanged.

Validation: the pinned Bun 1.4.4 CI compiler reproduced 20 TS6307 errors before the split; the full pnpm run typecheck:ci --bun-concurrency=1 --bun-threads=2 now passes all four projects (node, web, CLI, process-host tests). All 104 focused tests across six files pass, including the moved integration regression. Changed-line quality reports zero findings, and normal pre-commit lint/format hooks pass.

@gentslava gentslava closed this Oct 27, 2026
@gentslava
gentslava deleted the gentslava/upstream-antigravity-usage-errors branch October 28, 2026 02:22
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.

Antigravity location eligibility rejection is hidden by a generic usage parse error

1 participant