Skip to content

fix(rate-limits): read native Antigravity usage - #1

Open
abti-ai wants to merge 3 commits into
mainfrom
fix/antigravity-native-usage
Open

abti-ai wants to merge 3 commits into
mainfrom
fix/antigravity-native-usage

Conversation

@abti-ai

@abti-ai abti-ai commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1008 $\color{#cf222e}{\Huge{\mathbf{−}}}$​121 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​887
Prod 24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​691 $\color{#cf222e}{\Huge{\mathbf{−}}}$​147 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​544

Summary

Adds native Antigravity quota reporting through agy --print /usage --output-format json, preserving independent Gemini and Claude/GPT quota groups and canonical Used/Remaining presentation.

UI behavior

  • Antigravity has two independent quota groups: Gemini Models and Claude and GPT models.
  • In Compact mode, each group selects its tightest window by usedPercent, with first-in-order/session-first ties.
  • Compact Usage rows show the bare numeric percentage followed by the selected reset countdown, matching the compact status/menu ordering.
  • Compact status/menu summaries show % used or % left followed by the selected reset countdown, with both groups retained.
  • Detailed Usage continues to use 5h/wk; provider flyouts use translated Session/Weekly labels. Unknown windows retain their source label or a duration fallback.

Implementation and safety

Antigravity is fetched independently from Gemini using the trusted CLI resolver and execFileCaptureToTermination, which routes through the shared runProcess/resolveSpawn Windows-safe process runner. It uses fixed argv, direct execution, bounded output/deadline, AbortSignal propagation, and process-tree termination. No credentials are read directly, no shell interpolation is used, and no shell: true path is involved.

The existing 10-second AGY deadline is unchanged.

Validation

Focused renderer, tooltip, parser/fetcher, service, visibility, and shared process-runner tests pass, including tightest-window, per-group independence, tie, localization, copy, ordering, and Used/Remaining cases. Full typecheck, lint pipeline, changed-code checks, formatter, and Electron/Vite build were run.

@abti-ai
abti-ai force-pushed the fix/antigravity-native-usage branch 7 times, most recently from febb377 to 3ac7723 Compare September 15, 2026 07:06
nwparker and others added 3 commits September 15, 2026 00:10
`anti-slop/no-reflect-apply` rejects `Reflect.apply(fn, thisArg, argsArray)`.
It defeats the call-signature checks TypeScript applies to an ordinary call:
the args array is checked as an array, not positionally against the callee's
parameters, so arity and type errors pass silently. Dynamic dispatch belongs
behind a named interface, not behind a reflective call.

Flipped the rule from "off" to "error" and cleared all 17 baseline violations
across `src config tests mobile` (16 sites; one file had two).

Fix pattern: `Reflect.apply(fn, recv, args)` becomes `fn.call(recv, ...args)`,
or a direct method call when the implicit receiver is already the right object.
The receiver is preserved at every site.

Where the callee is a captured built-in whose overloads split on an argument's
shape (`String.prototype.split`, `JSON.stringify`), a call-signature capture no
longer compiles once the args are passed positionally. Those three sites capture
the function through a method-shaped type
(`{ split(separator: unknown, limit?: number): string[] }['split']`), which keeps
the forwarding call checked rather than asserted.

Behaviour notes:
- `diff-section-layout.test.ts` drops a `limit === undefined ? [sep] : [sep, limit]`
  conditional. Equivalent: `String.prototype.split` maps an undefined limit to
  2^32-1, and the `Symbol.split` path forwards undefined either way.
- `workspace-space-compaction.test.ts` forwards `reduce`'s two arguments unchanged,
  so the `arguments.length >= 2` initial-value branch is unaffected.
- `agent-session-history-byte-accounting.test.ts` is the one site where the receiver
  is not literally preserved (`JSON` -> undefined). `JSON.stringify` never reads
  `this` per spec, and restoring `.call(JSON, ...)` would reintroduce the overload
  failure under strictBindCallApply.

No suppression comments added — the rule has zero `oxlint-disable` sites.

`Reflect.apply` still appears at electron.vite.config.ts:159, inside a template
literal of generated bootstrap source. That is string content, not lintable code.
…stablyai#20798)

* fix(repos): preserve unknown Git availability

* fix(git): distinguish binary absence from missing cwd on spawn ENOENT

Node reports ENOENT for both a missing git binary and a missing working directory
during spawn. The fix checks specifically for spawn syscall, then verifies the cwd
exists to disambiguate. This prevents reporting "no Git" when the error is actually
a missing working directory. Centralizes probe logic in a reusable function; other
failures cause rejection so callers preserve the unknown status instead of collapsing
to false.
@abti-ai
abti-ai force-pushed the fix/antigravity-native-usage branch from 3ac7723 to 03bce76 Compare September 15, 2026 07:35
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.

4 participants