175dfd25552d769905bbfd57ecd57036eaa37910
25
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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 ( |
||
|
|
b35d4b35b2 |
agy-cli README: the plugin calls Google itself only for a region-refused quota read
0.1.69 (
|
||
|
|
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
|
||
|
|
2252950463 |
agy-cli README: agy runs a model's parallel tool calls one at a time (#1193)
agy checks each bridged tool call with its own sir_flash_lite monitor (about 1.3-2.6 s) and sends the next call only after the previous result is back, so N calls reach the client as N replies with one tool_use each. The plugin has no switch for it and won't rename tools to agy's own names to get past the check; the README now says so. Run: none; README only (bumped.mjs leaves README.md out). |
||
|
|
9907c187b2 |
agy-cli 0.1.68: bring in the retired Antigravity plugin's accounts
A user asked on X (@tongzhenbao) to move the accounts signed in on the
retired Antigravity plugin (provider "antigravity") into agy-cli in one
click. That plugin signed in with Antigravity's own Google OAuth client
(1071006060591-tmhssin2h21lcre235vtolojh4g403ep), and agy's own
`agy acp --login` link uses the same client id, so agy can take those
refresh tokens as its own: nothing is sent anywhere agy doesn't already
send its sign-in, and no other client is spoken for.
auth.import (magpie's "Import accounts from a file…") now takes:
- the old plugin's saved oauth entry, one, a list or plugin-auth.json's
map of them (refresh "<token>|<project>", accountId = email);
- agy's own token file / keyring value (go-keyring-base64: prefix too).
A bare refresh token or another tool's export is refused, since it may be
another client's. Each account gets its own agy home with the token file
agy writes (0600), and is added only once `agy models` runs there; one agy
refuses leaves no home. An account already signed in (same email) gives
its existing key back.
Run:
- mote: packages/agy-cli `HOME=$(mktemp -d) bun test`: smoke, signin,
cloak, install all pass; test/usage.mjs red (3 of 30, different each
run) and red the same way on pristine origin/main
|
||
|
|
e5cb9598c8 |
agy-cli 0.1.67: more than one Google account, each with its own usage
tongzhenbao on X wanted several accounts with their usage, as the old built-in had. agy keeps one sign-in where it looks for it (the system keyring's single "gemini"/"antigravity" entry), so the plugin was single: true and its second sign-in way replaced the account. Now the first account is agy's own, unchanged, and "Add another Google account" signs another one in to an agy whose home is the account's own (XDG_STATE_HOME/magpie-agy-bridge/accounts/<id>). Every agy run for that account (sign-in, models, usage, requests) gets HOME (USERPROFILE on Windows) there and SSH_CONNECTION set, which agy 1.5 reads as an SSH session and so keeps the sign-in in .gemini/antigravity-cli/ antigravity-oauth-token under that home rather than the keyring. The account's home is saved in its metadata (agyHome); the loader, usage and models run its work in an AsyncLocalStorage scope that childEnv and the stored sign-in read follow. Its conversations are keyed apart, and it gets no --gemini-dir (its token is under its own .gemini). single: true is gone, so each account has its own row and usage and rotates like any other. Checked by hand before writing it, with real agy and planted (expired) tokens in sandbox homes: agy read the file token from the sandbox HOME on macOS (mote) with SSH_CONNECTION set, on Windows (xiaomi-gpu) with USERPROFILE set, and in WSL. The live keyring was never touched. Run: - packages/agy-cli `HOME=$(mktemp -d) bun test` on mote: 35 pass, 0 fail. - bun scripts/check.mjs on mote: ok. - test/smoke.mjs on Windows (win-run): ALL OK (369 checks). - Broken by hand: the new smoke checks against the old index.mjs, signin.mjs and platform.mjs: 6 FAILURES (the method, single, the home, SSH_CONNECTION, the saved account, the failed home's cleanup). Not tried: a real Google sign-in of a second account, so agy writing the token file under SSH detection is known from file-mode users (plugins#1165) rather than seen here. Signing an added account in again makes a new home and leaves the old one (~800K). Every account shares one model catalog. |
||
|
|
b840915abc |
agy-cli 0.1.62: magpie's sign-in installs agy where there is none, and the plugin keeps that copy current (niuniu_8964 on X)
In magpie's Docker image there is no agy, so Sign in failed with "agy CLI not found". The plugin now declares auth.cli (magpie 0.1.4246's hook, engines.magpie raised to it): when agy isn't found, magpie's sign-in shows "Installing Antigravity CLI…" and the plugin installs it the way Google's install.sh does: the same manifest, the download checked against its sha512, the antigravity binary taken out of the tarball, tried with --version, then renamed into place. It goes into the data folder ($XDG_DATA_HOME/magpie-agy-cli/agy, ~/.local/share without it, %LOCALAPPDATA% on Windows), which in the container is on /config, and is searched last, so an agy the user installed wins. That copy is kept current a minute after start and every 6 hours, only while it is the one in use and not when AGY_CLI_DISABLE_AUTO_UPDATE is set. Also: findAgy handed out a cached path to an agy removed since, so the sign-in tried to spawn it (ENOENT) instead of installing it; and a write loop left an error listener per wait (MaxListenersExceededWarning on the 260MB download). Account code is unchanged. Run, on mica: bun scripts/check.mjs ok; agy-cli bun test 34/34 under a temp HOME (install.test.mjs: 10, against a local server). A6b red on the old findAgy, green now. Real use in magpie's Docker image (xiaomi-gpu, linux amd64), with magpie 0.1.4246's tree: `magpie plugin login agy-cli 1` and the browser UI's POST /api/plugin-signin both installed agy 1.5.9 into /config/data/magpie-agy-cli and went on to agy's Google link; it survived a restart; agy.version set back to 1.5.0 was updated a minute after start. Not tried: finishing the Google sign-in in the container, a real install on macOS, Windows or musl. |
||
|
|
e4c825b554 |
agy-cli 0.1.61: picks stick, and a second Google account can be signed in
Archivemylife on X: "没法sign in第二个账号,点击sign in again后过一会就
恢复原状,没有任何报错" and "配置后报存提示成功,再打开还是全部都启用".
Picks: while agy's model list wasn't known yet (agy missing, signed out,
or the probe still running), the models hook served the static or
Gemini-only catalog as if it were the real list. magpie relisted on
that, dropped the user's picks that weren't in it, and the editor came
back with every model on. The hook now marks such a list with
Symbol.for("magpie.fellBack"), so the host keeps the last good list and
the picks.
Second account: "Sign in again" with agy already signed in succeeded at
once with the stored sign-in, so nothing changed and nothing said why.
agy holds one Google account in its keyring. A second method, "Switch to
another Google account (agy holds one)" / "换一个 Google 账号(agy 只能
登录一个)", always runs agy's Google login, which replaces the stored
account. The sign-in result carries the stored id_token_email, so the
account is named by its email instead of "API key", and a switch shows.
READMEs say agy keeps one account.
magpie needs no change: it already keeps the last good list for a list
marked fell back, and shows a method picker for two methods.
Run:
- packages/agy-cli bun test (HOME=mktemp -d): 24 pass, 0 fail.
- test/smoke.mjs (AGY_BRIDGE_STORED_SIGNIN=skip): all ok.
- Red on the old index.mjs/signin.mjs with the new tests: signin red
(emailOf missing), catalog 3 fail (the three new tests), smoke BAD on
the two-methods check.
- Plugins root bun test (HOME=mktemp -d) on Linux (wsl-run,
magpie-desktop) at this tree: 8754 pass, 19 skip, 0 fail.
- Real magpie GUI in a sandbox HOME with this plugin installed: picked
two models, deleted the plugin's models.json and killed the plugin
host, POST /api/provider/models: before, count 2 and the pick
dropped; after, count 5, the pick kept, nothing delisted. "重新登录"
shows both methods in en and zh, no page errors, and the account is
named by its gmail address.
Not tried: signing a real second Google account in (it would change the
live agy keyring), Windows and Linux agy.
|
||
|
|
baeb95a43e |
agy-cli 0.1.60: the client's system prompt goes in the first turn, not appended to agy's
bzs_1 on X (on 0.1.58): with an agent's system prompt the request is answered 429; with agy's own prompt alone it works. The bridge sent the client's system prompt as session _meta.antigravity.systemPrompt.append, which reaches Google inside the system instruction, and Antigravity turns away a growing set of identity lines there (#1151): reworded ones too ("You're an interactive agent ..."). The user-turn cloak's own record shows only Codex GPT-5 lines refused in a user turn. Now the prompt goes in the first user turn as <external_system_instructions>, through the same outgoing rewording and user cloak as the rest of that turn, and agy's system instruction stays its own. AGY_BRIDGE_SYSTEM_APPEND=1 brings the append back. A parked session records instructionsInSession, and one parked under the other route (or before this field) is not resumed, so a session never ends up with the prompt in both places or in neither. 0.1.59's 400 for a turned-away prompt ( |
||
|
|
fc941f6e1c |
agy-cli: Codex's GPT-5 lines go reworded in a user's turn too (0.1.53)
pocoxliu on X (tweet 2121731813270077946) gets 429s from agy-cli under Codex and Claude Code and put it down to unslimmed system and MCP prompts. It is content, not size (#1151: a neutral system prompt of the same 66,622 characters went through). Since 11-14 Antigravity also turns away Codex's two GPT-5 lines ("You are Codex, (a coding) agent based on GPT-5") in a user's turn; magpie's cloak and the antigravity plugin ( |
||
|
|
a617ecfd42 |
antigravity 0.1.16, agy-cli 0.1.48, cloak 0.1.9: cloak the system prompts Google refuses since 11-14 evening; agy-cli fails a refused turn at once
Since about 18:43 on 11-14 Google's Antigravity backend answers 429
RESOURCE_EXHAUSTED to requests whose system instruction holds certain
agents' identity lines, though the account has quota and the same
request with another prompt passes. Tried on a real account
(gemini-3-flash), each line alone in the system instruction:
- refused now: "You are Hermes Agent", Hermes' earlier persona
"…an intelligent AI assistant created by Nous Research" (also as
"You're …"), "You are OpenCode" / "You are opencode", Codex CLI's
"You are a coding agent running in the Codex CLI", and pi's "You are
a coding assistant running inside pi".
- pass as written: Codex GPT-6's prompt, Claude Code, Gemini CLI, Qwen
Code, Cline, Kilo, goose, Amp, Droid, Kimi, Aider, Cursor.
The cloak in antigravity and agy-cli (and the antigravity-cloak
middleware) now rewords each refused line the smallest way that passes:
"You are" -> "You're" for Hermes, OpenCode and Codex CLI, "created by"
-> "built by" for Hermes' earlier persona, "running inside pi" ->
"running within pi". The hint shown with a refusal names the agent
(new pi, OpenCode and Codex CLI hints; Hermes' hint covers both
personas).
agy-cli (@Lmohn39, pi 1.5.0 via agy 1.5.9, hydrogen): when agy prints
its retry banner for a refused 429, agy-cli waited while agy retried
the same refused prompt without end, so pi hung. The turn now fails at
once with the 429 and the existing "this is not a quota" explanation,
the agy process is stopped and dropped from the pool. A 503 banner
still waits as before.
Run:
- root `bun test` with HOME=$(mktemp -d) on mica (mote was over its 18
cores): 8820 pass, 20 skip, 0 fail, exit 0.
- real account through the patched loader, gemini-3-flash 5/5 each:
pi 1.5.0's full default prompt (built from its dist/core/system-prompt.js),
Hermes current and earlier personas, both OpenCode first lines, Codex
CLI's prompt, Codex GPT-6's prompt. claude-sonnet-4-6: pi 5/5.
Broken by hand:
- the old agy-cli index.mjs makes the new Lmohn39 test red ("still
waiting after 5s").
- dropping the pi line from TURNED_AWAY turns 6 cloak tests red.
Not tried: a real agy 1.5.9 turn on hydrogen showing the banner (the
banner's wording is the one agy-cli already matched); pi itself end to
end through agy-cli.
|
||
|
|
6e0cecb2a0 |
agy-cli 0.1.45: a tool result's image goes to agy as a prompt image, not an offloaded file (distinceeeee on X)
Report: on agy-cli 0.1.43 with agy 1.5.8, when OpenCode's read tool
returns a screenshot, agy writes the image to
.system_generated/steps/N/media_0.jpg. The model never sees the image and
keeps re-reading files.
Cause: the bridge answered agy's MCP tools/call with the image as MCP
image content. agy offloads MCP images to a file, and its model only gets
"Image read successfully [Resource offloaded to file://…]". There are no
image tokens, so it loops trying to get the image back.
Fix: when agy supports prompt images and a tool result carries an image,
the result takes the steer-in-session path. The MCP call is answered with
its text plus a line saying the image follows. The image goes in the next
session/prompt as an ACP image block, in the same session, so it reaches
the model as an image. withoutAnswered keeps an answered result's images
in the prompt and drops the rest. If steering fails, the existing replay
fallback already sends tool_result images as prompt images. An agy
without image support keeps the old MCP path.
Run:
- Real agy 1.5.8 (macOS), sandbox HOME and sandbox keychain,
gemini-3.8-flash-high, through a harness that drives the plugin's fetch
with an OpenCode-style read tool:
- origin/main: shot.jpg and term.png each looped through 8 reads
without an answer.
- This change: 1 read each. shot.jpg was answered correctly
("PLUM-7342 ORBIT", red circle, blue square, green triangle).
term.png was answered correctly twice (all five terminal lines,
including "TOKEN: ZEBRA-5519", and the yellow rectangle).
- WSL magpie-desktop (Ubuntu 24.04), bun 1.4.2, temp HOME:
- packages/agy-cli `bun test`: 21 pass, 0 fail.
- `node test/smoke.mjs`: ALL OK (347 checks).
- `bun scripts/check.mjs agy-cli`: ok.
- Broken by hand: smoke.mjs with origin/main's index.mjs fails exactly
the two image checks this change adds or rewrites (2 FAILURES of 347).
Not tried:
- Gemini 4 Carbon: not offered to the test account.
- Real agy on Linux, and a real OpenCode front end.
- stream:true against real agy (the harness is non-streaming; smoke
covers SSE).
|
||
|
|
5613a1259a |
agy-cli 0.1.43: agy 1.5.8's attempt lines are dropped, and its network and credit endings fail the turn (#1136)
agy 1.5.8 writes each failed attempt of a model call into the reply
("\n⚠ API error (attempt N): request failed: … EOF"), then tries again in
the same turn, and when it gives up it ends with "⚠ There was a network
issue connecting to the server, please try again." or "⚠ Your AI credits
balance is too low to continue." instead of "Agent execution terminated
due to error.". The bridge passed all three through as the model's text,
and the endings as a 200 end_turn, so the gateway neither retried nor
switched accounts.
- dropRetryBanner drops an attempt line where it starts a line, with its
leading and one trailing newline, the way #1124 drops "Model produced
invalid output."; a line not ended yet is held (openBanner) until its
newline, a tool call or the end of the turn. A mid-line quote is kept.
- The error markers are a list; the network and credit endings fail the
turn like the old marker. The credit ending is a rate_limit_error.
- The error's detail falls back to the last attempt line's text, then the
ending's own words, when agy's log has no executor error.
lastAgentError also reads "Run: attempt N failed (…), retrying in",
"CallWithRetry: …" and "inference connection failed…: …" lines.
Fixtures are the reporter's exact strings from their Codex rollout.
Run (mica): node --test test/repeat-batch.mjs 33 pass; agy-cli bun test
21 pass; scripts/check.mjs agy-cli ok. Broken by hand: with main's
index.mjs the attempt-banner and ending tests fail (2 of 3; the third is
the mid-line quote guard, green on both).
Not tried: a real agy 1.5.8 with a dropped connection; the log-line
patterns are from the issue's log excerpt, not a test.
|
||
|
|
5bb4194140 |
antigravity 0.1.12, agy-cli 0.1.41, antigravity-cloak 0.1.7: turned-away lines go reworded (#1118)
Since 11-14 Google's check reads past invisible characters: a system
prompt with Claude Code's billing line and Agent SDK line, broken up with
two U+200B in every word as the cloak sent them, was turned away 5 of 5
with the bare 429 "Resource has been exhausted". Claude Desktop's Code
tab through magpie to Antigravity failed every turn (hc295971796 and
daoche_wuzui on X, 11-14).
Each line Google turns away now goes reworded instead, as plain words:
- the x-anthropic-billing-header line is left out (to its line's end);
a system part or message holding only it is dropped;
- "built on Anthropic's Claude Agent SDK" -> "built on the Claude Agent
SDK by Anthropic";
- Codex's "based on GPT-5" -> "built on GPT-5";
- Hermes' "created by Nous Research" -> "built by Nous Research";
- omp's RFC "keywords" -> "key words" (as before).
A copy an older magpie or cloak broke up (U+200B, U+2060, soft hyphen,
in or between words) is matched and reworded as the line. The Code tab's
main line ("You are Claude Code, Anthropic's official CLI for Claude,
running within the Claude Agent SDK.") passes as written and is kept.
antigravity-cloak gains a saidAs {phrase: replacement} option; extraWords
still breaks words up and the README says it no longer gets past
Google.
Run:
- real Antigravity account, sandbox HOME, gemini-3.8-flash, 10
sequential requests each through packages/antigravity at this head:
Code tab main prompt as Claude Desktop sends it (billing + main line +
rest) 10/10 200; Agent SDK subagent line 10/10; an old two-U+200B
copy 10/10; Codex GPT-5 10/10; Hermes' earlier persona 10/10; omp's
RFC line 10/10. Each rewording alone was first tried 5/5 against the
zero-width break, which went 0/5.
- wsl-run, HOME=$(mktemp -d) bun test (whole repo) before the last test
fixes: 8735 pass, 19 skip, 3 fail, all three in these packages' own
tests still expecting zero-width; after fixing them,
bun test packages/antigravity packages/agy-cli packages/antigravity-cloak:
133 pass, 0 fail.
Broken by hand: the three packages' source files from origin/main with
these tests: 19 fail (shape, cloak parity, smoke, every cases.json case).
Not tried: agy-cli against the real agy binary (smoke runs a fake agy);
models other than gemini-3.8-flash.
|
||
|
|
4170d0e816 |
antigravity 0.1.11, agy-cli 0.1.40, antigravity-cloak 0.1.6: omp's RFC 2119 line goes as "key words", in any white space
eric_li8983 (X, 11-14): oh-my-pi on Windows with an Antigravity account got
"Antigravity answered 429 to this system prompt" for omp's first line,
"RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL."
Two causes, both seen on a real account on 11-14:
- Google's check reads the line in any case with any white space between
its words: wrapped with LF or CRLF, indented, a tab, two spaces or a
no-break space were all turned away, while the cloak matched only the
literal line, so those copies went out whole. Each turned-away line is
now matched with any run of white space (JavaScript's \s) between its
words, the same in antigravity, agy-cli's cloak.mjs and the
antigravity-cloak middleware; Codex's and Hermes' lines too.
- A zero-width-broken copy of omp's line was itself turned away now and
then (10 sequential requests each: two U+200B a word 3 bare 429s, one
after every character 3, U+2060 2, soft hyphen 1). omp's line now goes
as "RFC 2119 key words: …", RFC 2119's own term, with its white space
as it was. The hint says so.
Real account (sandbox HOME, copy of the live Antigravity account,
gemini-3.8-flash, sequential): the reworded plugin answered omp 18.20.0's
literal prompt 10/10, the full template 10/10, and the line wrapped after
"REQUIRED," 10/10. The zero-width version before it: lit 3, tmpl 1, w1 5
bare 429s in 12 each.
Run at 24c75a16's tree (rebased on
|
||
|
|
2e77e646c8 |
agy-cli 0.1.36: the last model list agy gave is served after a restart (#1086)
After a restart, models() handed out the static Gemini-only fallback until agy answered again. offeredFilter also hid every non-Gemini model until a session or probe told it what agy offers. So the first requests after a restart saw no Claude models. The bridge now keeps the last list agy gave, and the set it offered, in models.json beside the session state file. The file has one entry per agy path, is written under the state lock through temp-and-rename (mode 0600), and is trusted for 14 days. A half-written or invalid file, another agy path, or a stale entry all give the static fallback, as before. A saved list is not treated as an answer from this agy: the offered probe still waits for a real listing. Run (WSL magpie-desktop, Bun 1.4.2, Node 22): - bun test in packages/agy-cli: 20 pass. - node --test test/catalog.mjs: 24 pass. - bun scripts/check.mjs agy-cli: ok. Windows (xiaomi-gpu): node --test test/catalog.mjs 12 times, 11 green. The one red is the existing wall-clock test "#1064 登录检查不为探测等太久", filed as #1089. I haven't shown whether it is red on origin/main too. Broken by hand: readSavedCatalog returning null turns the new #1086 test red; skipping the offered restore turns it red too. Not tried: real agy on any OS; a restart with a real signed-in agy. Reported-by: yinbing-666 |
||
|
|
7bccaae910 |
agy-cli 0.1.35: a client tool's ide-tools permission request is allowed once (#1082)
Newer agy asks before an MCP call, and the bridge refused every session/request_permission, so each client tool failed with "user denied permission for mcp(ide-tools/exec_command)". A request whose title (or name) is exactly mcp(ide-tools/<tool>), mcp "ide-tools/<tool>", ide-tools/<tool> or mcp_ide-tools_<tool>, with <tool> among the tools the client declared, now gets allow_once. Those tools run in the client under its own permissions. agy's own tools (shell, edits, browser) are still denied, as is a title that only contains such a name somewhere (a shell command's text can be in its title), an undeclared tool and another server's tool. rawInput is never read. Run (WSL magpie-desktop, HOME=$(mktemp -d)): bun test in packages/agy-cli, 20 pass; bun scripts/check.mjs agy-cli ok. Broken by hand: with the allow branch off, smoke.mjs has 2 failures, the two #1082 allow checks. Not tried: a real agy that asks for MCP permission. The title agy sends for an MCP call isn't known from its strings, so the forms above come from its rule and error text; the reporter is asked to confirm. Reported-by: Saramanda9988 |
||
|
|
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 |
||
|
|
00892c80e3 |
agy-cli 0.1.33: DSH's @-path paragraph goes reworded, as antigravity sends it (#1028) (LeeTengLong on X)
agy-cli's cloak.mjs copied only antigravity's TURNED_AWAY break-up (#980), not the REWORDED rewrite antigravity 0.1.7 added for #1028, so DeepSeek Harness's "Tokens prefixed with @ are paths…" paragraph reached agy word for word, the text that got gemini-4-argon answering fast, without thinking and shallow. cloak.mjs now carries REWORDED, reword and outgoing (reword after cloak), a copy of antigravity/index.mjs's, and every place agy-cli hands system text to agy uses outgoing: the session's systemPrompt.append, <external_system_instructions>, a later system/developer message and the notices beside a tool result. Only that exact paragraph changes; a prompt that merely mentions @ paths, and what the user wrote, go as written. instructionsIdentity still keys on the prompt as the client wrote it. The packages ship on their own, so the code is a copy; cloak.test.mjs holds it to antigravity's shape() output for each REWORDED entry and the samples. Run on mote (Bun 1.4.2, temp HOME): bun test packages/agy-cli packages/antigravity 118 pass 0 fail; bun scripts/check.mjs exit 0. Broken by hand: outgoing without reword turns 3 tests red (cloak.test.mjs 2, and smoke.mjs's #1028 session, external_system_instructions and later system message checks). Not tried: a real agy with a real Antigravity account and DSH; the rewording's effect rests on #1028's replays. No magpie min names agy-cli. Reported-by: LeeTengLong |
||
|
|
5341ac1e70 |
agy-cli 0.1.19: every client tool is listed always loaded, so agy no longer hides large ones from the model (#989)
agy loads an MCP tool on demand, outside the model's function list,
unless the server's tools/list marks it with
_meta {"antigravity/alwaysLoad": true} (agy's changelog, 1.3.5; the key is
in the 1.5.5 binary next to SplitEnabledToolsByEagerLazy and
McpServerSpec.force_all_tools_eager). The bridge's agent has tools: [],
so the model had no working way to load them: on klarkxy's 72-tool
catalog, tools from ~691 tokens up (bash, grep, task, ask_user) were
never offered while read, glob and write were. listTools now adds the
key to every tool it hands agy; the stored catalog and its signature
are unchanged.
Ran: wsl-run (magpie-desktop) with HOME=$(mktemp -d): bun test
packages/agy-cli (13 pass), bun scripts/check.mjs (ok), root bun test
(8207 pass, 19 skip, 0 fail) at base 017cd73e; after the rebase onto
|
||
|
|
9ec696258d |
agy-cli 0.1.18: turned-away system lines are broken up before agy sends them, and a 429 to one is not a quota (#980)
Antigravity answers 429 "Resource has been exhausted" to a few system prompt lines whatever quota is left (Claude Code's billing line, the Claude Agent SDK, Codex's and Hermes Agent's identities, oh-my-pi's RFC 2119 line). The antigravity provider breaks them up with zero-width spaces (TURNED_AWAY / breakUp / cloak); agy-cli sent the client's system prompt to agy as written, and called the 429 an exhausted quota (rate_limit_error), so a client or routing group retried a prompt that fails every time. - cloak.mjs is a copy of antigravity's TURNED_AWAY, cloak and hint (the two-zero-width-space break-up of 11-11). Each package ships on its own, so cloak.test.mjs imports packages/antigravity's _internal and fails when the two give a different answer for any line or sample. - Every route the system text reaches agy is cloaked: the session's systemPrompt.append (session/new and session/resume), <external_system_instructions> when agy can't append, a later system or developer message in the turn or the replayed history (renderTurnMessageParts), and a system/developer notice delivered beside a tool result (extractToolResults). - What the bridge keys and hashes on is unchanged: proc.instructions, sameInstructions, instructionsIdentity, stripVolatileSystem and the session store keep the prompt as the client wrote it; cloak is applied only where the text is sent. User text is not touched. - #formatAgentError: a "code 429 ... Resource has been exhausted" with a turned-away line in the session's instructions is an invalid_request_error, "Antigravity answered 429 to this system prompt: <detail> — <hint>", with the antigravity provider's hint. Any other 429 stays rate_limit_error. - READMEs (en, zh) say so under the minimal-agent section. Run (wsl-run, magpie-desktop, HOME=$(mktemp -d), at |
||
|
|
a5a63a109f |
agy-cli 0.1.3: an assistant prefill tail is continued, not refused (#904)
A request ending in a text-only assistant turn (SillyTavern prefill, "continue"/"impersonate", bot frameworks) was refused with a 400. That trailing run now stays in the tail, after the session ledger's newest entry, so the agy session is reused across prefill turns, and it is rendered as a continuation of the model's own reply. A prefill beside a live tool_result, or with no user turn before it, is still a 400. AGY_BRIDGE_PREFILL=0 brings the old refusal back. Reviewed at f7b249cec9e827b7ef49197a207180f3f7085cfe, run on mote: bun test ./agy-cli.test.mjs 8 pass / 0 fail; bun scripts/check.mjs ok. Broken by hand: with main's index.mjs and these tests, test/prefill.mjs and the smoke test fail (6 pass / 2 fail). Checked: renderTurnMessagesParts only gets the current turn's tail, never history, so a finished reply is never taken for a prefill. Not tried: a real agy account. |
||
|
|
03ab6d66f4 |
agy-cli 0.1.2: list what agy acp offers before the first request (#854)
Until a request had opened an ACP session, agy-cli listed Gemini only
(offeredFilter), so a user who hadn't sent a Gemini request yet saw no
Opus (chriskan666 on Discord). provider.models() now asks agy's ACP
server itself, as yulong-ge's antigravity-official-acp (#854) does:
a short `agy acp` with the plugin's own clientInfo, initialize and
session/new (no prompt), reading the session's model option and
models.availableModels into the same offered set a request's session
fills. The session is closed when agy says it can be, and the process
and its temp folder are removed.
- Only provider.models() probes; a request opens its own session.
- It runs once `agy models` has answered (agy is signed in), at most
once a minute while the offer is unknown, and not at all once known.
- models() waits for it as briefly as for the listing (500ms) and
never longer; a failed or timed-out probe (30s) keeps Gemini only.
- An agy older than 1.4.12 gets no session.
#854's own code reads session/new's availableModels, not `agy models`
(its body says `agy models`); agy-cli already parsed `agy models`, so
nothing of that parser changed.
Run at origin/main
|
||
|
|
ecab839688 |
agy-cli 0.1.1: sign in to Google from magpie, through agy's own agy acp --login
treeman_26897 (Discord #feedback, 11-08): Sign in on agy-cli opened no
browser, and asked for a field to paste the callback into.
Cause: the plugin had no sign-in of its own. Its one method only checked
whether `agy models` worked, and if not it said to run `agy` in a
terminal. magpie still showed "Finish signing in ... in your browser",
but nothing ever opened a page.
Now the method is oauth:
- Already signed in to agy (`agy models` lists models): done at once. No
page opens and no agy login starts.
- Otherwise the plugin starts `agy acp --login` (agy 1.5 and later). That
prints Google's link and reads the code from stdin. magpie opens the
link on the user's machine and shows its code field (method "code").
- The field takes the code antigravity.google/oauth-callback shows, or
that page's whole address.
- No loopback is involved, so it works with Remote magpie and in Docker.
- agy trades the code and keeps the token in its keyring. The plugin never
sees the token.
- The account is saved only once `agy models` lists models afterwards. A
wrong, empty or expired code fails, and nothing is saved. Google's
invalid_grant is worded as "turned the code away".
- The link waits 15 minutes, then agy is stopped. A new sign-in stops the
previous agy.
- agy 1.4.x has no --login. It gets "update with `agy update`, or run
`agy` in a terminal".
- The login runs with auto-update off, like the plugin's other agy
processes.
Import from a file is not added. agy keeps its credentials in the system
keyring, not in a file under ~/.gemini/antigravity-cli.
The empty account the report also describes was not reproduced on
current magpie. A failed sign-in saved nothing, in the GUI and the CLI.
This version also needs models listed before it saves anything.
Run:
- On mote (macOS, Bun 1.4.2) at this tree, `bun test` in packages/agy-cli:
7 pass / 0 fail.
- `bun scripts/check.mjs` and `bun scripts/check.mjs agy-cli`: exit 0.
- New smoke checks, with the old index.mjs put back: red, at "signed in
to agy already, the sign-in saves agy" (the old method has no callback).
- Real agy 1.5.3 on mote, sandbox HOME, current magpie `web`, through
Playwright:
- Providers > agy-cli opened Google's sign-in page, and the code field
showed.
- A bogus code gave "Sign-in didn't finish: Google turned the code
away...". /api/providers had no agy row.
- `magpie plugin login agy-cli`:
- With a bogus code, the same error.
- With real agy 1.4.12, the update message.
- Real agy 1.5.3 on Windows 11 (win-run) and on Linux (WSL2 Ubuntu 24.04,
wsl-run): authorize gave Google's link in about 2s, and a bogus code
failed with the invalid_grant wording. No agy was left running.
Not tried:
- A real Google sign-in through to models. Only bogus codes were used, and
no real account was touched.
- magpie inside a Docker container.
Reported-by: treeman_26897
|
||
|
|
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> |