dbd082f6d1cdaa147ec5f7de61aebbdb47d12c33
14
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
dbd082f6d1 |
agy-cli 0.1.15: an array tool schema whose items live only on a sibling gets an items schema Gemini accepts (klarkxy #963)
Gemini refuses an array schema with no `items`. array-items.mjs infers the items from the schema around it, or adds a permissive items schema 8 levels deep, without narrowing what the client allowed; tuple `items` lists are left as they are, with a hint. Closes #962. Reviewed head c7d3e7b8 (on |
||
|
|
738fd501d7 |
agy-cli 0.1.14: tool schema patterns are turned into RE2 or dropped, so an ECMA-262 pattern no longer aborts the turn (klarkxy #946)
Tool input schemas' `pattern` and `patternProperties` keys are translated to RE2 (re2-pattern.mjs) before they reach agy; a pattern RE2 can't hold is dropped with a hint, and `additionalProperties: false` is lifted when every patternProperties key was dropped. Closes #944. Reviewed head 99093088 (on |
||
|
|
a0b1e49113 |
agy-cli 0.1.13: an image before a live tool_result counts as the user steering (klarkxy #965)
An image the user sends with no text before a live tool_result now marks the turn as steered, so it is replayed and the image stays off the MCP result. Reviewed head 7852e288 (on |
||
|
|
7869318d6a |
agy-cli 0.1.12: a tool step's estimated cache read stops at the step before it, so a new tool result is billed as input (#971 review)
0.1.11 (#971) estimated an uncalibrated first prompt's tool steps by summing every earlier settled step's whole window as the cached prefix. Each window already holds the steps before it, so the prefix was counted once per step: from the third step on, the step's whole window, the tool result just added included, came back as a cache read. In the review's probe (four Read calls, ACP reporting cachedReadTokens 0), step 4 billed 0 input and 34,456 read, and the steps claimed 56,608 cache-read tokens that ACP never reported. The prefix is now the largest earlier settled window (the step before), so each step reads that from the cache and bills what was added since. The step test that pinned the 100% clamp now checks that step 3's uncached input covers what was added after step 2, and that its read does not exceed step 2's window. Still an estimate until ACP reports. Run (WSL2 Ubuntu 24.04, Bun 1.4.2, temp HOME): bun test packages/agy-cli 8 of 8 pass; bun scripts/check.mjs agy-cli passes. Broken by hand: origin/main's index.mjs with the new test, node --test test/usage-settlement.mjs: 25 pass, 1 fail ("第三步未缓存 input 0 应覆盖 第二步之后新增的 32"). Restored, green. Not tried: Windows (main's smoke red there is #973), macOS (mote refused ssh), a real agy. |
||
|
|
73d2006444 |
agy-cli 0.1.11: sessions survive canonicalized tool input; a first prompt's tool steps count the settled prefix as cached (ChrisJ_AI on X, klarkxy #971)
Reported by ChrisJ_AI on X: Claude Code on an agy-cli model showed 268K-input turns
at 0% cache hit, turn after turn.
Two places dropped cache reuse; both are klarkxy's #971 (closes #970):
- a follow-up turn after the client filled defaults into historical
tool_use.input (Edit's replace_all) failed matchesHistory / takeParked, so
the live agy session was retired and the whole prefix replayed;
- tool steps of a fresh process's first prompt reported every token as a
cache miss until the prompt ended (no ratio learned yet).
Run at reviewed head 27245320 (win-run, xiaomi-gpu): node --test
test/usage-settlement.mjs 26/26 pass; the same file against c27ba5f7's
index.mjs fails tests 20, 21 and 24 (red on old code). bun test
packages/agy-cli: 7 of 8 pass, smoke.mjs 1 failure of 321 checks, the same
count on
|
||
|
|
c27ba5f700 |
agy-cli 0.1.6: every prompt's own cache reads set the ratio the next tool steps report (baranwang on X)
Tool steps estimate their cache reads from the last ratio the proc learned, and only a final, uncancelled response taught it, so a cancelled prompt left the next one's tool steps reporting every token as a cache miss. agy reports each prompt's cached reads, so recordPromptUsage now sets the ratio from them. Test: a cancelled prompt (390k of 520k cached) then a tool step reports 0.75. Red with the line off, green with it. Not captured from a real agy: the owner's agy is signed out on this machine and mote was down. A fresh conversation's first prompt still has no ratio until it ends. Ran node --test packages/agy-cli/test (2 reds on base too: cp-hook, version/report hangs), bun test packages/antigravity, scripts/check.mjs. |
||
|
|
68e73c4797 |
agy-cli 0.1.5: release #951 (user text beside a live tool result)
|
||
|
|
9a96799efb |
agy-cli: user text beside a live tool result replays the round in a new prompt (#909, #951)
A user message that carried ordinary text beside a live tool_result, before
or after the result block, was refused with 400 "text beside a live
tool_result; send it after the tool response completes" (maxleebeta's
DeepSeek-harness agent, #909; Claude Science does the same). inspectToolTurn
now marks such a turn userSteered, so the bridge takes the existing replay
path: the old session is stopped, its pending calls are not resolved, and a
new session/prompt carries the round, the real tool result included. The
user's text is never spliced into an MCP function response. The same goes
for plain text after a Skill result, and for a hook line that carries "The
user sent a new message while you were working".
Still refused: an unclosed protocol notice (<system-update>... with no end
tag) on either side of the result, a companion (ARGUMENTS:, [Image: ...],
Tool loaded.) with no matching preceding tool, and an image before the first
tool_result. A turn whose tools also grew (#942) takes the same single
replay.
Changed behaviour beyond #909: a protocol notice, token line or hook-success
line placed before the tool_result (previously 400) now replays in a new
session, where the same line after the result is forwarded in-session.
Tests: compat.mjs checks both placements are userSteered, the MCP result
is unchanged, and the replay carries the instruction and the result. smoke.mjs
drives both placements and the Skill case through the fake agy and checks a
new convId whose prompt carries both. Five smoke checks that asserted 400
for text the bridge now replays were removed; the unclosed-notice 400 check
stays.
Run at head 04692ce0a74d (merged onto origin/main
|
||
|
|
60acd62bee |
agy-cli: a tool loaded mid-turn starts a new prompt with the round replayed (#942)
agy checks each call against the tools it listed before the prompt began. After ToolSearch loads a deferred tool, the client's next request declares it, and the bridge sent tools/list_changed and then continued the same session/prompt. agy's validator still answered `unknown tool: "<name>" — check spelling` for the rest of that prompt. When the tool-result request declares a tool the process has not listed (Proc.toolsGrew), the bridge now takes the existing changed-context path: it drops the process without resolving its calls and replays the history, the ToolSearch tool_use and its tool_result included, in a new session/prompt, where agy lists the full catalog first. The user's turn is in the replayed history once. The new process starts with the grown catalog, so the next result continues it live and nothing loops. A catalog that only loses or changes tools still continues the live turn. Tests (test/smoke.mjs, fake agy): TOOLSEARCHGROW checks calls against the tools listed at prompt start, like agy 1.5.3. The new block checks that the grown catalog starts a new session/prompt, that it replays the ToolSearch round with the user's ask once, that the old prompt never reaches the validator with the new tool, that the loaded tool's call reaches the client, and that its result continues the new session with no second replay. The "live tools change" case now removes a tool instead of adding one. Run on mote (Bun 1.4.2), at this tree: - packages/agy-cli `bun test`: 8 pass, 0 fail; smoke.mjs ALL OK (319 checks). - `bun scripts/check.mjs agy-cli`: registry.json and agy-cli ok. Broken by hand: sed removed `|| proc.toolsGrew(tools)` from the condition; smoke.mjs went 5 FAILURES (319 checks), the five new checks; restored, ALL OK. Not run: the root `bun test`. It waited behind about 20 queued suites on mote's suite.lock for over an hour, and WSL answered E_UNEXPECTED. Not tried: a real agy 1.5.3 run. Version 0.1.4. Reported-by: chrisjian <chrisjian@users.noreply.github.com> |
||
|
|
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
|
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator): - Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all. - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none. - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal. - The body rewrite strips the reasoning fields and sets image detail to auto. - A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key. - Neither browser method is offered when no Chromium-family browser is found (#825). - The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry". - The #826 metadata token read is kept, and its test is back. - The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows. - maxConcurrency is 4. - The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included. Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME: - full bun test: 6853 pass / 0 fail; both checks exit 0 - bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0 - 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed) Not tried: a real InkStone account or sign-in, Windows and Linux runs. |
||
|
|
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> |