Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Set up Antigravity with the official ACP executable (managed runtime or a manual
agy_acp_serverbinary path) and sign in with Google account A. This writes<stateDir>/providers/antigravity/<instance>/antigravity-acp/acp_token.json. - In Settings > Providers > Antigravity, change Binary path to the
agyCLI (1.5.5 here), as supported since fix(antigravity): agy CLI threads open in Full access and Auto-accept edits #33143. - Sign out, then sign in with Google account B. The provider reports "Authenticated".
- Use account B until its quota is visibly consumed. Running
agyin a terminal shows, for example, 49.92% left on the weekly Claude and GPT limit. - Open Usage > Limits.
Expected behavior
Usage > Limits shows the quota of the account the provider is signed in to (account B), or reports that limits are unavailable for this runtime. It should never show another account's numbers.
Actual behavior
Usage > Limits shows account A's quota. In my case account A is unused, so all four windows read 100% left, while the agy CLI reports 49.92% left on the weekly Claude and GPT limit for account B. Nothing in the view says which account the numbers belong to.
Signing out and back in from T3 Code does not fix it: acp_token.json keeps its old modification time and its old account through both.
Cause, as far as I could trace it:
makeAntigravityUsageProbeinapps/server/src/provider/antigravityUsageLimits.tsalways reads<profile>/antigravity-acp/acp_token.jsonand only checks that the file exists.- The official ACP executable honors
GEMINI_HOMEandAGY_ACP_FORCE_FILE_STORAGEand writes that file. TheagyCLI does not: its binary contains neither variable name noracp_token.json, and it logsFailed to resolve GeminiDir ".gemini" ... falling back to default. It keeps its login in its own store (~/.gemini/antigravity-cli/antigravity-oauth-tokenon a headless host; no token file on a desktop host, where I assume it uses the OS keyring). - So with the CLI as the runtime, nothing updates or removes the profile token. The file left by the ACP executable still refreshes successfully at Google, and the probe returns a valid answer for the wrong account.
Reproduced on two machines with the same result, so it does not depend on the OS.
Impact
Major degradation or frequent failure
Version or commit
0.1.9-nightly.20261111 (server runtime 0.1.9-nightly.20261111.4515)
Environment
Linux x64, two hosts: a desktop (Arch-based, T3 Code Nightly AppImage) and a headless server environment. Antigravity agy CLI 1.5.5 as the binary path, sign-in method "Google account". The stale token on each host came from agy_acp_server (managed runtime on one, manual binary path on the other).
Logs or stack traces
# Profile token is untouched by sign-out and sign-in done on 11/11
$ ls -la <stateDir>/providers/antigravity/<instance>/antigravity-acp/acp_token.json
-rw------- 1 user user 510 Nov 8 20:54 acp_token.json
# Same request the probe makes, with the profile token (account A, unused)
POST https://daily-cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary
gemini-weekly 1.0 gemini-5h 1.0 3p-weekly 1.0 3p-5h 1.0
# resetTime is exactly now + 7 days / now + 5 hours on every bucket
# Same request with the token the agy CLI stored at sign-in (account B)
gemini-weekly 0.994 gemini-5h 1.0 3p-weekly 0.4992 3p-5h 1.0
# Strings present in each binary (grep -a -c -F)
agy_acp_server.par agy 1.5.5
GEMINI_HOME 60 0
AGY_ACP_FORCE_FILE_STORAGE 4 0
acp_token.json 4 0
# agy acp log during a T3 Code sign-in
launcher.go:249] Failed to resolve GeminiDir ".gemini": .gemini must be an absolute path: path is not absolute, falling back to defaultScreenshots, recordings, or supporting files
Not attached, because the CLI view shows the account email. I have both screenshots (Usage > Limits at 100% left on all four Antigravity windows, and the agy CLI "Models & Quota" view at 49.92% weekly for Claude and GPT) and can post redacted copies.
Workaround
Switching Binary path back to the official ACP executable and signing in again should restore correct limits, since that runtime writes the file the probe reads. I have not tested this.
What I did instead, to keep the CLI: replaced the refresh_token in the profile's acp_token.json with the one from the CLI's own login. The probe then returns the right account's quota. This lasts until the account changes.
Possible fixes:
- When the runtime is the CLI (
harnessPath === null), do not read the profile'sacp_token.json. Read the CLI's login instead, or report limits as unavailable. - Remove the profile's
acp_token.jsonon sign-out and when the binary path changes runtime type. - Show the account in Usage > Limits so a mismatch is visible.
Activity
fix(antigravity): usage limits no longer show another account's quota…
juliusmarminge commentedon Nov 20, 2026
Reproduced on main @ 29b42d4 (after #38957), Linux x86_64,
agy1.5.12 with a real Google personal sign-in.The limits probe in
apps/server/src/provider/antigravityUsageLimits.tsstill prefers<profile>/antigravity-acp/acp_token.jsonwhenever that file exists. Only without it does it read the 1.5.x CLI's own sign-in (antigravity-oauth-tokenor the keyring). The 1.5.x CLI never writes or updatesacp_token.json, so any copy in the profile is left over from the old 1.4.5 runtime or an earlier account.Steps:
antigravity-acp/antigravity-oauth-token). Usage → Limits → Refresh shows the account's windows (Gemini 5-hour 74%, weekly 53%, …).antigravity-acp/acp_token.jsonin the same profile ({client_id, client_secret, refresh_token, project_id}from an old runtime; here, revoked values).https://oauth2.googleapis.com/token→ 401 (twice in the trace). Usage → Limits shows no error and keeps the earlier figures, which never update. With a leftover token that is still valid for a different account, it shows that account's quota instead, as in the original report.This also fits a reply on the Antigravity feedback thread: "usage is constantly 100%, never updates in T3; it updates OK in the Antigravity app" (https://x.com/VSyrov7399/status/2123545415249473554).
Fixed looks like: when the instance runs the native 1.5.x CLI, read the CLI's current sign-in, and ignore a leftover
acp_token.json(or use it only for the 1.4.5 runtime that writes it). A failed probe should not keep silently showing old readings as current.test(server): Antigravity limits prefer the CLI sign-in over a leftov…
test(server): Antigravity limits prefer the native CLI's sign-in over…
juliusmarminge commentedon Nov 20, 2026
I tried to reproduce this on the current build and could not.
Commit 9bb92a4 (origin/main). I could not do the in-app reproduction here: it needs a Google account sign-in and the Antigravity Usage > Limits panel, and neither is on the VMs. The maintainer reproduced it in the app on main @ 29b42d4, after #38957 (comment on the issue). On current main I confirmed it with a unit test in apps/server/src/provider/antigravityUsageLimits.test.ts. The test gives the profile a valid native-CLI sign-in (antigravity-acp/antigravity-oauth-token) plus a leftover acp_token.json whose refresh Google answers with 401.
vp test run src/provider/antigravityUsageLimits.test.tsfails on main: the probe posts the stale refresh token to https://oauth2.googleapis.com/token instead of using the CLI's current sign-in, then reports probeFailed. With the probe changed to check the CLI sign-in first, all 21 tests pass; I reverted that change.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
juliusmarminge commentedon Nov 20, 2026
Reopening: the no-repro close was wrong. The unit test described above fails on main (the usage-limits probe refreshes a stale
acp_token.jsonand reports probeFailed instead of using the CLI sign-in inantigravity-oauth-token), and the bug was reproduced in the app on nucbox-1 earlier. Checking the CLI sign-in first is the fix.test(server): Antigravity limits ignore a leftover acp_token.json whe…
rymiwe commentedon Nov 20, 2026
Same root cause, different trigger: Gemini Enterprise (
oauth-business).oauth-personal), which wroteantigravity-acp/acp_token.json.antigravity-acp/acp_business_token.json.acp_token.jsonkept its old mtime.credentialFingerprintequals the one reported by a second machine signed in with that personal account. Model runs use the Workspace account (Gemini 4 Carbon is offered), so only the usage probe is on the wrong credential.The usage probe builds
<profileDirectory>/antigravity-acp/acp_token.jsonfor both auth methods, andacp_businessdoes not appear in the server binary (0.1.7 and 0.1.9). Foroauth-businessI'd expect "limits unavailable" (pay-as-you-go has no quota windows), never another account's numbers.mths-mcfs commentedon Nov 21, 2026
Thanks for the repro and the notes, Julius. Before redoing #34389 I saw you had already opened #39544 for the credential order, so I left that part to you. #34389 now covers only the gap that CodeRabbit flagged on #39544: when the probe returns
probeFailed, Antigravity shows the failure instead of keeping the previous reading as if it were current. It touches none of #39544's files and is ready for review. The sign-out case, where the previous account's limits stay up, is out of scope here; #39672 takes it on.Falkicon commentedon Nov 22, 2026
Confirming this still reproduces on Windows x64 with T3 Code
0.1.12-nightly.20261122.5111and the default managed Antigravity ACP1.5.14runtime (same scenario as #40348, which was closed in favor of this issue):<stateDir>\providers\antigravity\<hash>\antigravity-acp\had a leftoveracp_token.jsonfrom an earlier sign-in (account A) alongside a freshantigravity-oauth-token(account B, verified asauthenticated successfully as <account B>inacp-login-*.log).antigravity-oauth-token, leavingacp_token.jsonuntouched on disk.acp_token.jsonfor account A, while the standaloneagyCLI showed account B's quota accurately.acp_token.jsoncaused both machines to emit the samecredentialFingerprint, silently collapsing the two accounts into a single Antigravity limit display (and with no signed-in email shown in the UI, it was impossible to tell from the app why).Workaround confirmed: Removing the leftover
acp_token.jsonand signing back in immediately resolved the issue and split Usage → Limits back into both accounts. Looking forward to #39544 (and #38097 / #39672).