Conversation
Stage each saved Google account's credentials into an isolated HOME and run the agy CLI usage report under that scope, so every token account's quota is fetched without mutating the ambient login, shared Keychain items, or triggering interactive prompts. OAuth client resolution now prefers the client embedded in the installed agy binary so newly added accounts mint credentials the Code Assist surface accepts, and eligibility/auth rejections surface as actionable diagnostics instead of a silent "Limits not available".
|
🦞👀 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 maintainer review before merge. Reviewed September 20, 2026, 2:35 PM ET / 18:35 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR retrieves saved Antigravity accounts’ quotas through isolated agy credential directories, with account-removal cleanup, compatible OAuth refresh, diagnostics, and regression coverage. Merge readiness✅ Ready for maintainer review Current main still lacks this capability. The latest live evidence resolves the previous account-isolation proof blocker, earlier fixes remain present, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherCodexBar combines local Antigravity probes and Google OAuth data to display account usage. This change lets its agy CLI source retrieve quotas using each saved account’s credentials before returning account-bound usage to the app or CLI. flowchart TD
A[Saved Google account] --> B[Check matching local session]
B -->|Available| F[Account usage display]
B -->|Unavailable| C[Check retirement and acquire lock]
C --> D[Stage isolated credentials]
D --> E[Run agy usage report]
E --> F
E -->|Failure| G[Guarded CLI and OAuth fallbacks]
G --> F
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Use isolated per-account agy credentials while retaining identity checks, durable cleanup, and existing OAuth and legacy CLI fallbacks. Do we have a high-confidence way to reproduce the issue? Not applicable as a new scoped-fetch capability: current source confirms the intentional rejection of unbound reports, and the contributor supplies live after-change account comparisons. Is this the best way to solve the issue? Yes. Isolating the credential source extends saved-account coverage while preserving the existing identity guard; the documented ambient-source workaround cannot cover every saved account. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6d3df3678a1d. LabelsLabel 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)
|
- SettingsStore removal now deletes ~/.codexbar/antigravity/accounts/<id> via a coordinator hook, and the account key is tombstoned so queued or in-flight staging cannot restage credentials for a removed account. - The mutation lock uses nonblocking flock(LOCK_NB) with a suspending, cancellation-aware wait instead of a blocking flock(LOCK_EX) that could stall cooperative workers while the holder awaits subprocesses. - New tests cover the real flock lock (cancelled waiters release, lock reacquires), scope deletion and tombstoning, queued-staging rejection, removal hook wiring, and staged-home credential isolation.
|
@clawsweeper re-review Both blocking findings addressed in [P1] Staged credentials outlive account removal — fixed.
[P2] Blocking flock in cooperative pool — fixed.
Account binding / isolation evidence — Expiry/refresh — |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Retirement markers under accounts/.retired make account removal visible to every process sharing the staged directories: a queued CLI fetch can no longer restage a removed account's grant, and a first scoped operation sweeps homes left behind by an interrupted removal. Refresh fallback for credentials without stored client fields resolves the installed app's OAuth client again, matching the grants' issuer; the agy-first preference stays scoped to new logins.
|
@clawsweeper re-review Both Revision-2 findings addressed in [P1] Share account retirement across processes — retirement is now persisted on the shared filesystem. [P1] Legacy refresh fallback — the shared resolver is split. Coverage added:
Verified live: removing all four saved accounts produced four |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
Revision 3 follow-up — commit [P1] Preserve legacy spawning when scoped reports are unsupported — fixed
Regression tests:
Production evidence (macOS, agy 1.2.7, this build)Redacted excerpts. Emails appear only as Separate process rejects a retired account before provider I/OA retirement marker was written to The same run also exercised the new fallback chain end-to-end: the blocked A first CLI run additionally swept the stale staged home left behind: Scoped fetch per selected accountAmbient IDE was not running and the warm Switching between three saved accounts produced three distinct fingerprints Removal cleanup + persistent tombstoneFresh loginAll four re-added accounts staged and fetched on first refresh after login. Expired legacy grantNo live trace: reproducing it requires a pre-PR grant whose access token
Grants carrying stored client fields still pin to them; the fallback order is @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Account-isolation proof: ambient B vs scoped A (live, this build)Setup: ambient 1. Ambient run — plain 2. Scoped run — 3. Staged credential identity — If @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Summary
Saved Antigravity Google accounts show "Limits not available" in Auto mode:
the OAuth quota endpoint 403s for many accounts, and the
agyusage report isrejected by the selected-account guard because the report carries no account
identity.
This PR makes the
agyusage report account-scoped: for each saved account,CodexBar stages that account's credentials into an isolated
HOMEand runsagy /usageunder that scope. The report therefore belongs to the requestedaccount by construction — no ambient login switching, no shared Keychain
mutation, no interactive prompts during background refresh.
agyreports for selected accounts) instead of working around it
agyreportonly when the ambient
agylogin matches the selected account — this coversevery saved account, including ones not signed in anywhere else
missing model-family rows from Antigravity OAuth path shows fewer model-family groups than agy CLI path; "Plan usage" empty (0.45.2) #2427 by routing through
agyHow it works
AntigravityAgyCredentialScopebuilds a per-account isolated home(
~/.codexbar/antigravity/accounts/<id>/home), stages the account's storedOAuth credentials where
agyreads them, and serializes concurrent runsbehind a mutation lock so parallel account refreshes can't interleave. The
lock is acquired nonblocking (
flock LOCK_NB+ suspending retry), so waitersstay cancellation-aware and never pin a cooperative worker.
agyOAuth client (preferred over theIDE client) because
agyrejects app-minted credentials; the minting clientis persisted into each credential. Refresh keeps the issuer's client: stored
client fields are used when present, and credentials saved before those
fields existed fall back to the installed app's client — the same resolution
as before this change, so existing grants keep refreshing.
agystderr is classified: eligibility/TOS rejections surface ascliAccountNotEligiblewith an actionable message instead of a silent"Limits not available"; auth-required maps to the existing re-login guidance.
agy older than 1.1.11 or an unrecognized version), the existing
identity-checked ambient spawn fallback runs as before, so setups whose
legacy CLI source works keep their quotas.
agyinstalled, behavior is unchanged: app-local/ide-local probes +account-scoped OAuth + offline fallback, plus the same eligibility
diagnostics.
Safety / platform notes
agyand IDE sessions are never touched — the scope is a directoryof staged files, not a login change. Removing an account writes a persistent
retirement marker under
accounts/.retired/before deleting its directory,so queued or in-flight refreshes — in this process or a separate
codexbarCLI invocation sharing the lock — cannot restage credentials for a removed
account; a first scoped operation in each process also sweeps staged homes
left behind by an interrupted removal.
agyprocess at a time), so a stackedfour-account refresh takes tens of seconds instead of ~5s.
#if canImport(Darwin)); Linux keeps the existing OAuth path.Test plan
make check— clean, 0 violations.AntigravityAgyCredentialScopeTests(20 — including areal-
flockcancellation/serialization test, staged-home isolation, scoperemoval + tombstoning, two-coordinator tests covering cross-process
retirement on a shared directory and lock, and scoped-failure → ambient-spawn
fallback coverage),
AntigravityScopedHomeRemovalTests(1),
AntigravityUsageReportFailureTests(4), plus resolver andeligibility-mapping cases in
AntigravityOAuthCredentialsStoreTests/AntigravityRemoteUsageFetcherTests(including an expired grant withoutstored client fields refreshing via the legacy app client).
make test— green except two pre-existing environment-dependent failuresunrelated to this diff (pixel-tolerance
CostHistoryChartMenuViewTests,LaunchServices-dependent
BrowserDetectionTests).agy1.2.7: four saved accounts return weeklyquota concurrently in stacked layout; ambient
agylogin unchanged; noKeychain prompts during background refresh.