62645eceb78daf84e95e41acb1ddaf02b403daae
11
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
50f1ec1882 |
agy-cli 0.1.93: a refused account with no project has its quota read under aicode-consumers
IcyLiqu1d on X: agy-cli's usage always failed with "this account is not
eligible for Antigravity" while the account's requests kept working.
agy -p /usage waits for agy's eligibility check; agy acp, which serves
requests, runs none, so a refused account keeps working and its usage
does not. 0.1.69's direct read covers a refusal where loadCodeAssist
names a project. Where it names none, agy itself asks
retrieveUserQuotaSummary with {} and Google answers 403 #3501, and the
plugin's direct read gave up with "names no project" and then showed
only the generic "not eligible" line, hiding why.
- readQuotaDirect: a personal (auth_method consumer, not gcpManaged)
account loadCodeAssist names no project for is asked under
aicode-consumers, the project Google serves every consumer account
under. A Workspace/Cloud account still fails, with Google's
ineligibleTiers reasonMessage when it gave one.
- fetchUsage: when the direct read fails too, the error keeps agy's
refusal and adds why the read failed.
Run (mica, bun 1.4.2, HOME=$(mktemp -d)):
- test/usage.mjs: 44 pass. With origin/main 207880e1's usage.mjs and
the new tests, 3 fail (the two new tests and the no-project case of
"a direct read that fails...").
- bun test ./packages/agy-cli: 41 pass, 0 fail. bun scripts/check.mjs:
exit 0, agy-cli ok.
- Real account (agy 1.5.10, CLOUD_CODE_URL through a recording proxy
that drops currentTier, paidTier and cloudaicompanionProject from
loadCodeAssist): agy's own retrieveUserQuotaSummary {} calls got 403,
onboardUser 403; the plugin's read with project aicode-consumers got
200 and fetchUsage returned both 7-day groups in 7.0s. On 0.1.92 the
same run returned the generic "not eligible" error.
Not tried: a real account Google refuses at the eligibility check (I
have none; the refusal was simulated), and Linux, where the stored
sign-in isn't read from a keyring, so the direct read can't run there.
|
||
|
|
207880e1d8 |
agy-cli 0.1.92: usage shows each group as a pool and lists its models again
tongzhenbao on X: since moving to agy-cli, the usage card shows only three
rings ("Gemini …", "Gemini …", "Claude …"), and they want each model's
usage as before.
Before: the retired antigravity plugin sent one window per model
(fetchAvailableModels' quotaInfo, with family and pool) and the pools
from retrieveUserQuotaSummary, so magpie's card showed the pools
("Gemini 5h", "Gemini 7d", two lines a ring) and "Every model (n)"
listed the models. agy-cli sent only "Gemini · 7 days"-named windows with
no pool and no model, so magpie drew plain rings with the name cut short
and had no models to list.
Google's per-model figure is the pool's: the owner's last antigravity
read (quotas.json, 2026-11-11) gave every Gemini model 1.58104% with the
Gemini pool's 7 days, and every Claude/GPT model 6.7575% with Claude &
GPT's, to the digit. So nothing new is asked of Google; from agy's own
/usage:
- each bucket goes as its pool's window: { pool: "Gemini", name: "7 days" }
(magpie's LineName is still "Gemini · 7 days", so quota history and a
cap the user set keep their names);
- each model family a group names (familiesInGroup, from the catalog agy
models listed) gets an aside window in that pool: its display name
without the effort word, model = the family id, models = every id of
it, family Gemini/Claude/GPT-OSS, reading the group's most used
measured bucket with that bucket's span and reset. A model two groups
name reads the one that stops it first. A group with no measured bucket
gives its models no window; no catalog yet gives no model windows.
Every window stays aside, so routing is as before (magpie's allowanceOf
skips aside windows, and a pool's window holds only members that aren't).
Run (mica, mote over 18 load): HOME=$(mktemp -d) bun test in
packages/agy-cli: 41 pass, 0 fail.
Broken by hand: a model reading its group's first bucket instead of the
most used one; "each model family a group names has its own window in
the pool, at the pool's most used bucket" went red (1 fail), green again
restored.
Not tried: a real agy /usage read (the parse is the captured live report
of 11-15 and its agy models rows); magpie's rendering is checked in
magpie's GUI tests with this shape.
|
||
|
|
44bfefb7a7 |
agy-cli 0.1.84: an ended access token is renewed by the plugin for usage, so agy never opens a sign-in (#1234)
qiankun229 traced it in agy's own logs (#1234): at Windows startup the background usage read ran `agy -p /usage` with an ended access token and a refresh token. agy's silent renewal failed for a moment (a 10s keyring timeout, or "no such host" for oauth2.googleapis.com before the network was up) and agy fell back to an interactive Google sign-in, which opens the browser through ShellExecuteW past the BROWSER/PATH shims. The next read renewed the same token fine. The stored-sign-in precheck passes such a token, since it can be renewed. - createUsageReader: when the stored access token has ended or ends within two minutes and has a refresh token, fetchUsage reads with `direct`: it runs `agy --version` only (no sign-in) and reads the quota the way agy does (readQuotaDirect, loadCodeAssist then retrieveUserQuotaSummary, with agy's User-Agent), renewing the token in memory. agy's stored sign-in is never written. `agy -p` isn't run. - A failed renewal is a failed read: it backs off as before and keeps the sign-in. A network error says to check the network or proxy. - Google answering the refresh with invalid_grant (400/401) is kind "auth": the account reads as signed out ("Sign in again") and nothing runs for that sign-in again until another is stored. - A token with time left still goes through agy -p, as before. Tests: three tests that leaned on an ended token only to get agy to run now use a token whose end isn't said (as the existing "refreshing" test does); what they check is unchanged. Run (mote, HOME=$(mktemp -d)): - test/usage.mjs (AGY_BRIDGE_STORED_SIGNIN=skip node --test): 41 pass. - bun test agy-cli.test.mjs: 20 pass, 0 fail. - bun scripts/check.mjs agy-cli: ok. Broken by hand: origin/main's usage.mjs with the new tests: the three new tests fail (agy -p ran for an ended token; no backoff/network message; invalid_grant not auth), 38 pass. Not tried: Windows with a real ended token and the network down at startup (no agy account here: the local one answers 403); the requests are the ones the region-refusal path has made since 0.1.7x. |
||
|
|
83a677177b |
agy-cli 0.1.81: agy's "Verification Required" is a 403 that says how to verify
kidgpt on X (Windows 11, Claude Code in VS Code, gemini-3.8-flash) got the bare text "Verification Required" as the model's answer. agy 1.5.9 turns Google's 403 VALIDATION_REQUIRED into that line (utils.CustomUserErrorMessageFromHTTPError, read from the binary) and ends the turn with "\n⚠ Verification Required\n", which the bridge didn't know, so it went out as a successful reply. - The ending is a sixth agent-error marker. The turn fails as a no-retry 403 permission_error (stream error event and HTTP 403 with x-should-retry: false, as #1201's banned account), in the words magpie's gateway reads as Google verification ("this Google account needs to be verified: open <link> in a browser"), so magpie rests the account as needing verification and shows the link. - The link comes from agy's log for the turn (validation_link / validation_url, or the "in your browser to continue:" line) when there is one; otherwise the message says to open the Antigravity app or run agy signed in to the account. - Sibling: agy's eligibility refusal for the same cause ("Please verify your account in your browser to continue:\n<url>", "Verification required. Please complete verification…", from AuthStatus.EligibilityError / IneligibilityFromResult) got the region/VPN advice and lost the URL in agyRefusal (models, sign-in probe). It now gets the same verify message with agy's link. - A model quoting the line with more text after it keeps its text. Run (mote, temp HOME): node --test test/repeat-batch.mjs test/usage.mjs 95 pass; bun test packages/agy-cli 37 pass 0 fail (smoke.mjs included); bun scripts/check.mjs agy-cli ok. Windows (xiaomi-gpu, win-run): repeat-batch, usage, windows-nc, platform 120 pass 0 fail. Red on the old code: with origin/main's index.mjs and usage.mjs the two new ending tests fail (a 200 reply) and the agyRefusal test gets the VPN advice. Not tried: a real account Google wants verified; the exact log line agy writes for a VALIDATION_REQUIRED turn (the fixture follows Google's JSON error's validation_url). |
||
|
|
9720caa468 |
agy-cli 0.1.78: a banned account's ending is a no-retry 403, not an answer (#1214)
agy 1.5.9 writes a banned account's "PERMISSION_DENIED (code 403): This service has been disabled in this account for violation of Terms of Service…" ending into the reply as text, and the bridge answered it as an end_turn 200 (#1201). The exact ending is now one of the end-of-turn markers (split across chunks too), agyRefusal names it, and it ends the turn as permission_error 403 with no retry: x-should-retry: false on a non-stream reply, status 403 + noRetry in a started stream's error event. A generic PERMISSION_DENIED, or the sentence quoted mid-answer, is not reclassified. By yetihan. Run at the reviewed head f4e82352 (mica, temp HOME): - node --test test/repeat-batch.mjs 54 pass; test/usage.mjs 36 pass. - bun test packages/agy-cli 37 pass; bun scripts/check.mjs agy-cli ok. Broken by hand: origin/main's index.mjs and usage.mjs with the new tests: the two #1201 bridge tests and the agyRefusal test fail. Not tried: a real banned account. |
||
|
|
175dfd2555 |
agy-cli 0.1.70: say when Google refuses the account (#3501) instead of a fallback list
Three X reports (16 Nov): "You do not have a valid license of this product (#3501)", "models can't be fetched", and "magpie's agy proxy stopped working". agy 1.5.9 gets Google's 403 #3501 on its eligibility check and fails every command with it (agy models, agy -p). The plugin hid it: models() fell back to the static catalog as if the account had those models, usage said only "not eligible", and a request got 400 "model ... is unavailable to this agy account" because the ACP session offers none. Now: - usage.mjs: agyRefusal() reads Google's refusal out of agy's output (#3501 first, else the eligibility line), never from agy's own log lines or a network failure; usage reports the #3501 text with what to do (update agy and sign in again, personal Gmail, unset AGY_ADC_AUTH, VPN/region). - index.mjs: a failed `agy models` records the refusal per agy home; models() throws it (magpie shows it as the list error) instead of the static catalog, and recovers when agy lists again. A request whose session offers no model, or whose turn ends on the refusal, answers 403 permission_error with the reason (stream and JSON), not 400. After a sign-in, magpie shows "agy signed in, but" and the refusal. - README (zh, en): a Troubleshooting entry for #3501. Run (mote, HOME=$(mktemp -d)): - bun test ./packages/agy-cli: 35 pass, 0 fail (110s); bun scripts/check.mjs ok. - test/usage.mjs with cp-hook preload 6 more times: 0 fail. One earlier run had "a direct read that fails leaves the region refusal standing" red with "agy usage could not start the CLI" at load ~28; the same red shows on the base tree ( |
||
|
|
99b042def4 |
agy-cli 0.1.69: a region agy refuses still has its quota read
01dadada on X: "额度读取有问题。绕过查额度前询问地区限制就可以查到". agy
1.5.9's print mode waits for its eligibility verdict before any command,
/usage too. Where loadCodeAssist names an ineligible tier
(UNSUPPORTED_LOCATION) and no current one, agy prints {"status":"ERROR",
"error":"Eligibility check failed: Your current account is not eligible
for Antigravity, because it is not currently available in your
location."} and exits 1, though its own retrieveUserQuotaSummary had
already answered 200. Recorded through CLOUD_CODE_URL and a proxy that
rewrote loadCodeAssist's reply that way.
When agy refuses /usage for eligibility (not "Eligibility check failed:
EOF", a network failure), usage.mjs now makes agy's two requests itself:
POST /v1internal:loadCodeAssist {"metadata":{"ideType":"ANTIGRAVITY"}},
then /v1internal:retrieveUserQuotaSummary {"project":<its
cloudaicompanionProject>}, with agy's stored sign-in (signin.mjs
storedToken, the keyring or the account's token file), agy's User-Agent
(antigravity/cli/<version> (aidev_client; os_type; arch; cl;
auth_method)), Content-Type and Accept-Encoding gzip, at CLOUD_CODE_URL or
daily-cloudcode-pa. An access token under two minutes from its end is
renewed in memory with agy's client and never written. Any failure of
that read leaves agy's refusal as the error, with no windows: unknown,
never 0 or full. Users whose check passes: unchanged path.
Run:
- packages/agy-cli test/usage.mjs on mica: 35 pass.
- the new tests on the old usage.mjs (stub exports added so it loads):
the region test is red (result.error set, no windows), as are the UA
and renewal tests; the two "stays unknown" tests pass on both.
- packages/agy-cli `HOME=$(mktemp -d) bun test` on mote: base 35/35,
this change 35/35 (both on base 1260b2ba; the rebase onto
|
||
|
|
f4c2f2fb2b |
agy-cli 0.1.65: usage windows name the model ids they cover (#1180)
A usage window from `agy usage` now carries the model ids it covers, taken from the catalog `agy models` listed: each display name in the group's "Models within this group:" line (or the group's own name) maps to the family id and every effort variant the catalog serves. With no catalog yet, or a name the catalog doesn't have, a window has no ids. The windows stay aside, so routing is unchanged; agy-cli 0.1.65. Run at 8acf7ffb5 on macOS (mote), CI-style with a temp HOME: bun test packages/agy-cli, 35 pass, 0 fail; bun scripts/check.mjs agy-cli passes. Not tried: a real agy account (the local one answers 403). Co-authored-by: Ruining Yang <ArmedHelicopter@users.noreply.github.com> |
||
|
|
d49ad432f4 |
agy-cli: startup diagnostics aren't sign-in talk; a hung ended sign-in still stops (#1177)
agy-cli's usage reader keeps the hung sign-in guard and stops reading agy's startup diagnostics as sign-in talk.
agy logs unauthenticated cache lookups (glog lines, "I1115 12:00:00.000 ...]") before it loads its keyring, so a timeout whose only output was those lines was marked as a dead sign-in. The reader now takes those lines out before testing for sign-in talk. A timeout with an ended token that prints nothing, or real sign-in talk (accounts.google.com, "Waiting for browser authentication"), still marks that stored sign-in dead, so a signed-out agy is never restarted in the background until the credential changes (the 235 browser opens a day that
|
||
|
|
b40a853c20 |
agy-cli 0.1.34: agy isn't run in the background without a sign-in, so it stops opening the browser (JZGiVvkSOA75376 on X)
On Windows 11, a signed-out agy opened Google's sign-in page 235 times in one day. The usage refresh ran `agy` about every 3 minutes, and agy opens the browser through ShellExecuteW, so the BROWSER=open.cmd guard can't stop it. New signin.mjs reads agy's stored sign-in without running agy. agy keeps it through go-keyring, service "gemini" and user "antigravity": - macOS: `security find-generic-password`; - Windows: CredReadW from PowerShell, on the credential "gemini:antigravity". It reads only whether a sign-in is stored, whether it has a refresh token, and when the access token ends. The token itself never leaves the function; a hash tells one sign-in from the next. Setting GEMINI_API_KEY, GOOGLE_API_KEY, AGY_ADC_AUTH or GOOGLE_GENAI_USE_VERTEXAI means agy signs in some other way, so nothing is concluded from the keyring. AGY_BRIDGE_STORED_SIGNIN=skip turns the read off. An access token that has ended is not "needs sign-in". The owner's working agy has one that ended 11 hours ago and is renewed from its refresh token. agy counts as unable to sign in when: - no sign-in is stored; - the access token has ended and there is no refresh token; - or agy already failed on this stored sign-in: it said it needs a sign-in, or it hung with an ended token and printed nothing or sign-in talk, the way an agy waiting on its browser does. This holds until another sign-in is stored. What changes: - Usage: in those cases agy isn't run. The read says signIn "expired", and magpie shows the account's sign-in as expired. After the next good read it says "renewed", and magpie clears that. - Other usage failures wait 10 minutes before the next run, doubling up to 6 hours. Before, they ran again on every refresh. - The model listing (`agy models`) isn't run in the background in those cases either. The catalog it has stays. - Signing in from magpie skips the `agy models` probe and goes straight to magpie's own sign-in link. A finished sign-in clears what was marked dead. - A request answers 401 with X-Magpie-Sign-In: expired when no sign-in is stored. This uses the last read, so a request never waits for PowerShell. - `agy --version` hanging is never read as a sign-in wait. Run: - mote, rebased on |
||
|
|
0f0c4ec68f |
agy-cli: Antigravity on the local agy CLI over ACP (#785)
New package `@magpie-community/opencode-agy-cli-auth` (provider `agy-cli`, `packages/agy-cli`). It serves Antigravity models through the user's installed `agy` CLI over ACP (`agy acp`) and uses agy's own Google sign-in. The plugin reads and writes no Google tokens. The bridge is gitxm's. On top of it, after review: - **ACP identity.** The client names itself (`opencode-agy-cli-auth` and its package version) instead of `zed`. - **Catalog.** - Only what agy offers this client is listed: Gemini until a session says more, then the session's model option and `availableModels`. - Requests are still routed by everything `agy models` lists. - **Prompt.** agy keeps its own system prompt by default. The minimal agent is opt-in with `AGY_BRIDGE_MINIMAL_AGENT=1`, and the README says what turning it on sends upstream. - **Version check.** agy older than 1.4.12 is refused at the handshake. 1.4.12 is the oldest version the `nc` MCP bridge was checked on, and the README documents the bridge. - **Auto-update.** - `AGY_CLI_DISABLE_AUTO_UPDATE` defaults to `true` only for the plugin's own agy processes. - A value the user set is passed on as written. - **Docs.** The READMEs and the registry summary say how this differs from antigravity-acp (#87). - **Tests.** The author's tests came over under `test/` with a fake agy (an ACP stdio server). Each suite runs in its own `bun test`, and a `mock.module` preload stands in for `node:child_process`. - **Cleanup.** A duplicate, unreachable image branch in validateBody is gone. Run at ae5eafb0 on mote (macOS) with HOME=$(mktemp -d): - `bun test packages/agy-cli`: 7 pass. Per suite: - platform 14, compat 9, usage 20; - catalog 15, usage-settlement 18, repeat-batch 14; - smoke ALL OK (301 checks). - `bun scripts/check.mjs`: all ok. - Repo-wide `bun test`: 6792 pass, 0 fail (6812 tests, 492 files). Broken by hand, and each went red: - clientInfo set back to zed; - the version check turned off; - routing limited to the listed models; - auto-update forced to true; - the minimal agent on by default. Not tried: a real agy, since mote has none, or a real Antigravity account. Co-authored-by: gitxm <21175063+gitxm@users.noreply.github.com> |