Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 11:31 AM ET / 15:31 UTC (Revision 6). ClawSweeper reviewWhat this changesAdds a macOS fallback that retrieves Antigravity quotas using the selected account’s credentials in an isolated temporary home, with tests, documentation, and runtime evidence. Merge readiness✅ Ready for maintainer review This remains useful: main and v0.65.0 still lack selected-account CLI reports. The updated runtime evidence resolves the previous proof request, and no blocking introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherCodexBar combines Antigravity’s local app, CLI, and OAuth sources to display account usage. This change lets the CLI report serve a selected Google account while preserving account-scoped OAuth fallback. flowchart TD
A[Selected Google account] --> B[Existing local probes]
B -->|Cannot provide matching usage| C[Private credential staging]
C --> D[Isolated agy usage command]
D -->|Success| E[Selected account quota display]
C -->|Failure| F[Account scoped OAuth fallback]
D -->|Failure| F
F --> E
Before mergeNone. 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. Technical reviewBest possible solution: Provide selected-account quotas through private per-run CLI staging while retaining OAuth recovery and the existing explicit-source behavior. Do we have a high-confidence way to reproduce the issue? Not applicable as a new account-scoped retrieval capability; current source confirms the intentional fallback restriction, and supplied macOS traces demonstrate the added path. Is this the best way to solve the issue? Yes. The implementation follows the owner’s narrower staging requirements, reuses existing parsing and process handling, and avoids the predecessor’s persistent credential homes and login-client changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against efaee7a37213. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
…teipete#3662) In Auto mode a selected or injected Google account suppresses the identity-free ambient agy report, which drops model-scoped quota detail that only the print command exposes. Run the same print scoped instead: stage the account's OAuth tokens as agy's file-token payload in a fresh private HOME under the per-user temp dir, verify the staged id_token claim against the selected account before launch, and spawn agy with an allowlist environment plus SSH_TTY so it uses file storage and never touches the OS keyring. Scoped runs are macOS-only, fail closed to the existing account-scoped OAuth strategy, preserve the original ambient error, and never substitute an ambient report for a selected account.
6b9bce3 to
6b706a6
Compare
527f7df to
a5a3284
Compare
a5a3284 to
ea3fc66
Compare
Real agy 1.2.9 runs against a staged private HOME authenticate as the selected saved account while the ambient CLI login is a different account, leave the ambient ~/.gemini tree and OAuth token untouched, reject revoked staged credentials with UNAUTHENTICATED instead of using the ambient login, and refresh expired staged grants in place.
ea3fc66 to
e0172ea
Compare
|
Thanks @Sogl for the scoped-fetch implementation and the agy 1.2.9 evidence. The ambient identity-free-report guard is preserved, including fallback after a scoped failure. I’m not adopting this version: its report identity comes from the staged credentials, while the proposed conflicting-response check cannot fire because the current print parser always returns no account email. The credential-isolation behavior needs a stronger supported-version contract, and this patch adds 274 production lines beyond the bounded change allowed here. The expired-grant evidence also shows a 90-second delay before OAuth recovery. Closing this implementation while retaining the existing account-ownership guards and OAuth fallback. |
|
@steipete Thanks for the close review. One thing from live testing that changes the picture: the 403 is per-account licensing — unlicensed accounts fail on both cloudcode-pa hosts (even with an agy-minted token), while agy still serves their quota through its privileged language-server path. So the identity-free print report really is the only source for those accounts. Before another attempt — what's the identity contract you'd accept? Would verifying the ambient credential's signed id_token against the selected account be enough to attribute the ambient report, or does the identity need to come from agy's own output? If the latter, this looks upstream-blocked until agy reports identity in /usage — I can file that request with them. |
Summary
Fixes #3662 — scoped implementation per the requirements in #3780 (comment) (private staging, isolated child environment, fail-closed credential handling, no raw-output logging, platform-specific proof).
When a Google account is selected or injected in Auto mode, the ambient
agy -p /usagereport is suppressed because it carries no account identity — and with it the model-scoped quota detail that only the print command exposes. This PR runs the same print command scoped to the account instead:agy's file-token payload and written to a freshcodexbar-agy-scoped-<uuid>HOME under the per-user temporary directory (0700 dirs, 0600 token), deleted viadeferafter the run. No persistent credential copies, locks, or shared state.agyreceives an allowlist env (loginPATH,TMPDIR, locale, proxy vars) — noANTIGRAVITY_OAUTH_CREDENTIALS_JSON, no ambient provider credentials. A non-emptySSH_TTYmakesagyselect file-token storage, so the scoped run never consults the OS keyring.id_tokenclaim must match the selected account before launch; missing/malformed credentials or unverifiable identity throw before any spawn. Any scoped failure preserves the original ambient error so the primary diagnostic is never masked, and an ambient identity-free report is never substituted for a selected account — the pipeline falls through to the existing account-scoped OAuth strategy exactly as before.AntigravityCLIPrintFailuretaxonomy.#if os(macOS); on Linux the closure isniland behavior is byte-for-byte unchanged. Ambient paths (unselected Auto, explicit--source cli) are untouched; cancellation still propagates before any scoped attempt.Diff: +702/−3, of which ~250 lines are the new scoped-fetch file and ~370 its tests.
Test plan
swift test --filter AntigravityScopedPrintFetchTests— 14 tests (payload format, env allowlist, staged identity verification, fail-closed wiring, real spawned stub-agye2e asserting staged HOME/env isolation and cleanup)swift test --filter Antigravity— 540 tests, 0 failuresmake check— clean except one pre-existing line-length violation inTypeSafeWebFetchStrategy.swift:175(upstream, not this diff)swift test— 12,439 tests; 9 issues: 1 was this diff (missingProvider-specific by designannotation — fixed and verified), 8 are unrelated environment-dependent failures on this machine (Pi~/.omproot discovery, SwiftUI layout metrics, a render-timing budget)git diff --check— cleanPlatform proof:
.github/pr-proof/antigravity-scoped-fetch/live-evidence.log— live macOS evidence on agy 1.2.9, including the production path:CodexBarCLI usage --provider antigravity --account Ashows the scopedantigravity-cli-scoped-usagesubprocess returning A's quota labeled A while ambient agy is logged in as B; auto mode with the app-selected account takes the same path; a revoked-credential account preserves the original ambient-path error, fails closed to scoped OAuth, and never displays B's quota. Manually staged runs additionally show agy authenticating as A in its own log, zero ambient~/.geminiwrites (614-file snapshot diff), UNAUTHENTICATED rejection of revoked staged credentials, and in-place refresh of an expired staged grant.Grant provenance + expiry path: the saved test grants carry the OAuth client ID that CodexBar's Add Account flow discovers from the installed Antigravity.app — they are CodexBar-minted under Antigravity's own client. A production run with the saved grant's
expiry_dateforced to the past shows the scoped attempt failing closed at the 90s bound while the account-scoped OAuth strategy recovers with A's data labeled A (ambient B never appears).