Commit Graph
7 Commits
Author SHA1 Message Date
yetone 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.
2026-11-14 16:32:54 +08:00
yetone e0f2a4c2e9 agy-cli 0.1.42: agy's "Model produced invalid output." retry banner is dropped (#1124)
When the model's first call returns neither text nor tool calls, agy writes
"\n⚠ Model produced invalid output." into the reply and calls the model
again in the same turn. The bridge passed that banner on as the reply's
text, so Claude Code's prompt_suggestion took it as the suggestion.

Turn.pushText now drops the banner, with its leading newline and one
trailing newline, wherever it starts a line. A banner that ends a chunk is
held, so a newline in the next chunk goes with it, and it is dropped for
good when the text is flushed. The turn goes on: unlike agy's error
marker, it does not fail the prompt. The model quoting it mid-line keeps it.

Run on WSL (Bun, temp HOME):
- packages/agy-cli: bun test, 21 pass / 0 fail (repeat-batch 30 pass).
- bun scripts/check.mjs agy-cli: ok.
- Broken by hand: on the old index.mjs the new #1124 banner test is red.

Not tried: a real agy 1.5.8 empty-output retry; the banner bytes come from
the reporter's gateway log, and both with and without a trailing newline
are covered.
2026-11-14 13:30:22 +08:00
tungloong 592b716ac3 agy-cli 0.1.37: DeepSeek Harness's notes are not the loop's task; a trimmed loop keeps its whole user turn (#1093)
Reviewed at 56248465f. WSL (Bun 1.4.2, temp HOME): bun test in packages/agy-cli 20 pass (repeat-batch.mjs inside agy-cli.test.mjs), scripts/check.mjs agy-cli ok. With main's index.mjs, node --test test/repeat-batch.mjs fails 6 (19, 20, 21, 22, 24, 26). Open question, not blocking: a string-content message holding a runtime snapshot and the user's words reads as meta-only (affects only prompts trimmed past 112 KiB).
2026-11-13 19:49:31 +08:00
yetone 1a08f08817 agy-cli 0.1.30: a new agy session logs why the live one was not reused (#1058)
#1058: in one Claude Code conversation every request started a new agy
conversation, so Gemini 4 Carbon's cache read stayed at 0. The bridge
reuses a live session only when the conversation key, work dir,
instructions and history all match, and nothing said which one failed.

acquireProcLocked now writes one content-free stderr row per new
session ("[agy-bridge] {event: agy_bridge_session, action: session_new,
reason, conv, fresh, resumed, parked, history}"). reason is no_live (no
session under this conversation key), or for a live one that was
dropped: forced, dead, retiring, work_dir, instructions, history or
fresh_after_first. conv is the key's 12-char digest, so a key that
changes per request shows as a new conv each time. The rows have their
own 30/min budget, so they never crowd out the tool-state rows.
magpie writes plugin stderr into its log, so the reporter can send them.

Run (on a separate test Mac, temp HOME): bun scripts/check.mjs agy-cli
ok; packages/agy-cli bun test ./agy-cli.test.mjs 14 pass 0 fail;
test/repeat-batch.mjs 20 pass, test/conversation-key.mjs 31 pass.
Broken by hand: with the logSessionEvent call disabled, the new #1058
test fails.
Not tried: a real agy, or the reporter's Claude Code requests. This
does not fix the cache miss; it finds which check misses.

Reported-by: chrisjian
2026-11-13 02:40:04 +08:00
yetone 4b35c34c34 agy-cli 0.1.27: a replay that fits goes unclipped; Claude Code's notes are not the loop's task (#1055)
clipHistoryMessage ran on every history message before the room check,
so a 20 KiB block in a small replay still went as 4 KiB head and tail.
History is now rendered whole first, and blocks are clipped only when
that is over the room; from there the over-budget path is as before.

The #1053 task finder took the last user message with no tool_result,
so a standalone system reminder, interrupt marker or local-command
caveat could be pinned in place of the real prompt. isUserTask skips a
user message whose text is only such notes; an image or any other text
still counts.

Not changed: the 112 KiB default (the installed agy 1.5.5's strings
don't show a 192,000-byte limit), a lone tool_result after the omission
note (history is text; it carries its id), and the issue's redesign.

Run on a separate test Mac (Bun 1.4.2, temp HOME):
- test/repeat-batch.mjs: 19 pass, 0 fail (2 new; 17 pass 2 fail on 0.1.26).
- bun test packages/agy-cli: 15 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
Broken by hand, each 18 pass 1 fail, then restored: clipping always;
the meta check reduced to an empty test; the local-command strip
removed; the interrupt strip removed; the over-budget clip removed
(the A16 >128 KiB test goes red).
Not tried: a real agy.

Reported-by: hiee3
2026-11-12 22:19:39 +08:00
yetone bb3f68a47a agy-cli 0.1.26: a quoted error marker no longer ends the turn; a trimmed tool loop keeps its prompt (#1052, #1053)
#1052: Turn.pushText failed the turn at the first "⚠ Agent execution
terminated due to error." anywhere in the reply, so a model quoting it
(inline, in a code block) was cut off and reported as an agy error. agy's
own marker ends the prompt, so the marker is now held, and the turn fails
only when the prompt ends with it still held (Turn.endText, before the
agentError check). Text or a tool call after it sends it on as text.

#1053: when a replay went over the prompt budget mid tool loop,
renderInitialPromptParts kept only the opening message and the newest
history, and dropped the user prompt the loop works on. Now, when the
current turn carries tool_results, the latest user message without one is
kept too if it fits, in order, with an omission note per gap.

Not changed: #1052's retry banners (nothing shows them reaching the
client as message chunks) and #1051 (the supersede rule is deliberate,
covered by A15 and the lineage sibling test; evidence asked for).

Run on WSL (Bun 1.4.2, temp HOME):
- bun test packages/agy-cli: 15 pass, 0 fail.
- test/repeat-batch.mjs: 17 pass, 0 fail (3 new).
- bun scripts/check.mjs agy-cli: ok.
Broken by hand, each 16 pass 1 fail, then restored: the task prompt not
pinned; pushText back to the first-indexOf rule; turn.endText() removed.
Not tried: a real agy (no install, no Google endpoints).

Reported-by: hiee3
2026-11-12 21:47:42 +08:00
gitxmandgitxm 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>
2026-11-07 20:14:45 +08:00