Repository navigation
fix(antigravity): recover quotas through supported CLI reports - #3607
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 13, 2026, 4:40 PM ET / 20:40 UTC (Revision 5). ClawSweeper reviewWhat this changesAdds a version-checked Antigravity CLI quota-report fallback after failed HTTPS retrieval, preserves account boundaries, and extends parsing, subprocess tests, and documentation. Merge readiness⛔ Blocked before merge - 3 items remain This remains useful work: current main lacks the recovery path, and the earlier correctness findings are resolved. The controlled native demonstration is meaningful, but successful recovery with authenticated agy remains unproven, matching the owner's explicit landing condition. Priority: P1 Review scores
Verification
How this fits togetherCodexBar's Antigravity provider converts local app, CLI, and OAuth responses into usage windows for the menu and command-line output. This change adds another CLI retrieval path while retaining existing source selection and account checks. flowchart TD
A[Usage refresh and account selection] --> B[Existing local HTTPS retrieval]
B -->|Valid response| C[Preserve verified identity]
B -->|Failure| D[Check account eligibility and CLI version]
D -->|Allowed| E[Read structured CLI quota report]
D -->|Rejected| F[Existing provider fallback]
E --> G[Validate and convert quota windows]
C --> H[Menu and CLI usage output]
G --> H
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the bounded, account-aware fallback and establish authenticated quota recovery without changing existing HTTPS success or selected-account behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source and reported traces: current main sends tokenless CLI requests that agy 1.2.2 rejects, and no structured-report recovery exists there. This review did not execute a live reproduction. Is this the best way to solve the issue? Yes: preserving successful HTTPS responses and reusing the existing quota projection through the documented CLI interface is a narrow repair; authenticated integration proof remains outstanding. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d3df0651ac95. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 657f719ebc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let snapshot = try AntigravityStatusProbe.parseQuotaSummaryResponse(Data(result.stdout.utf8)) | ||
| let usage = try snapshot.toUsageSnapshot() | ||
| try AntigravitySelectedAccountGuard.validate(usage, context: context) | ||
| Self.log.debug("Antigravity CLI usage fetched via print report") | ||
| return self.makeResult(usage: usage, sourceLabel: Self.sourceLabel) |
There was a problem hiding this comment.
Preserve identity on the print-report fast path
Whenever agy -p /usage succeeds, this returns the snapshot produced by parseQuotaSummaryResponse, which explicitly sets both accountEmail and accountPlan to nil, bypassing the existing HTTPS path's GetUserStatus identity merge. As a result, users whose refresh now takes this fast path lose the Antigravity account label and plan badge even on older CLI versions where the prior HTTPS fetch supplied them; merge an available identity into the report or retain the identity-enriching path before returning.
Useful? React with 👍 / 👎.
657f719 to
45e64f2
Compare
Preserve successful legacy HTTPS quota and identity responses, then use the supported print report only for explicit CLI or unselected Auto without injected OAuth credentials. Verify the same executable is at least agy 1.1.11 before invoking /usage, require a successful structured usage envelope with known enabled quota, and bound output, execution time, cancellation, and diagnostics. Move test-only dependency defaults out of immutable production wiring and retain existing HTTP parsing behavior. Related to steipete#3586. Identity-free reports do not establish selected OAuth account ownership.
45e64f2 to
dce41db
Compare
|
The maintainer rewrite is pushed at 48e4ef9. It preserves successful HTTPS identity, validates supported print versions before executing Controlled native end-to-end proof used separately built, Developer-ID-signed CodexBar CLI binaries and the exact same synthetic
The returned identity contains only 152 focused tests passed, including real subprocess checks for the credential boundary, unsupported versions, output limits, timeout, and cancellation. Lint and isolated reviews are clean. The final native suite passed all 1,132 selections across 104 groups with zero failures, retries, or timeouts. Current-head CI is fully green, including all three Linux builds and both macOS shards. Positive live-provider proof is still outstanding: real Google-signed agy 1.2.2 attempts on two macOS hosts failed during authentication after about 61 seconds, with zero turns/tokens. A control from the normal home directory failed the same way. Keeping the PR open until a working authenticated CLI response can be verified through CodexBar. |
|
Positive live-account proof for 48e4ef9, tested on macOS 26.6.2 / Apple Silicon with the installed Google-signed agy 1.2.2. This is the real provider, not a fixture or a replacement agy executable. I built that exact PR head without source changes: swift build --disable-keychain --product CodexBarCLI -j 4The resulting CLI is SwiftPM ad-hoc signed. I used the existing signed-in AGY session, removed any The same command was run against the installed 0.60.0 CLI and the newly built PR CLI: codexbar usage --provider antigravity --source cli --format json --no-credits --log-level debug
The baseline exits 0 despite returning offline data, so exit status alone was not used as the pass condition. During both successful PR runs I observed the actual direct child process invoking the installed AGY executable with: The PR run also emitted the Returned window excerpt (quota percentages and reset timestamps redacted): {
"provider": "antigravity",
"source": "cli",
"identity": { "providerID": "antigravity" },
"windows": [
{ "id": "antigravity-quota-summary-gemini-5h", "windowMinutes": 300 },
{ "id": "antigravity-quota-summary-gemini-weekly", "windowMinutes": 10080 },
{ "id": "antigravity-quota-summary-3p-5h", "windowMinutes": 300 },
{ "id": "antigravity-quota-summary-3p-weekly", "windowMinutes": 10080 }
]
}This is an abbreviated projection of The direct official report returned: {
"status": "SUCCESS",
"num_turns": 0,
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"thinking_tokens": 0,
"cache_read_tokens": 0,
"total_tokens": 0
},
"command": { "name": "usage" }
}Full repository validation also passed on the same unchanged head: All validation CLI and test invocations exited. This supplies the requested positive authenticated quota-recovery evidence for explicit CLI mode. It does not claim new selected-account/Auto live coverage or menu UI validation. |
|
Landed as 86a47f8; #3586 is closed. The merge tree matches the reviewed merge preview, and main is pulled and clean. The fix preserves successful legacy identity, then uses the official version-checked structured usage command when eligible. The command owns its authentication; selected/injected Auto accounts cannot borrow its identity-free quota report. Thanks @sobczi for the contribution and @sudoHG for supplying the missing exact-head live integration evidence. Validation on the landed PR head:
Production code is net −3 lines. Changelog and provider documentation are included; this is available on main, not yet a new release. |
Antigravity CLI 1.2.2 stopped answering the legacy local HTTPS quota requests. Preserve any successful HTTPS response first, then recover quotas through
agy -p /usage --output-format jsonwhen the CLI source has no usable HTTPS result.The fallback checks the same executable's version before invoking print mode. Google introduced non-interactive
/usagereports in 1.1.11; older or unknown versions are rejected so a quota read cannot become a model prompt. The parser requires a successfulusagecommand envelope and an enabled bucket with known quota, with bounded output, timeout, cancellation, and no raw stderr in provider diagnostics.Print reports contain no account or plan identity. Explicit CLI mode remains authoritative; Auto only uses the report without a selected token account or injected OAuth credentials. Existing HTTPS identity and account validation are preserved. CodexBar-injected OAuth credentials are removed from the child environment;
agyuses its own authentication. The report runs in a private empty directory. Test-only dependency defaults moved out of production while ownership fields remain immutable, keeping production code net −3 lines.Related to #3586. This does not make identity-free CLI reports valid for a selected OAuth account. Contributor credit remains with Daniel Sobczak (@sobczi).
Verification
agyexecutable and report. The baseline returned a provider error; the corrected CLI returned all four expected session/weekly windows, without borrowing account or plan identity. All owned helper processes exited. This is controlled end-to-end CLI proof, not a claim of live-account quota success.make checkpassed with zero violations. Isolated Codex review found no actionable P0–P2 defects.make testpassed 1,132 selections across 104 groups, all first-pass with zero retries or timeouts (1,373.4 seconds), including the credential-boundary follow-up and incoming CI/test stability change. All nine changed files match the pushed commit; the controlled CLI sources match that same head. Final-head CI passed: lint, Linux x64/ARM64/musl builds, both complete macOS shards, and the aggregate gate.48e4ef9066bb717fd6ea82c31cc607e2877d0c51returning all four known quota windows through the real, Google-signedagy1.2.2. The report includes the observed/usagesubprocess, two successful runs, matching quota percentages/durations, and zero turns/token usage. The contributor also reports all 1,132 full-suite selections passing. This is independent contributor evidence for explicit CLI mode, not a maintainer rerun or proof of selected-account Auto mode.