A tool turn answered with text beside the result that merely mentions a
notice tag it does not close ("<system-reminder", "<channel") threw "text
beside a live tool_result; send it after the tool response completes". In
a long Codex thread (ChatGPT desktop) that text comes from a developer
message magpie wraps in <system-reminder> whose own text quotes a reminder
tag (the wrapper then leaves a stray close tag), a hook's context, or the
user typing the tag. Now: a wrapped developer or system message is a
notice (broken up with cloak), a user's text steers and is replayed whole,
other roles ride as a notice. A notice that opens and is cut short
("<system-update>not a complete...") is still turned away.
Not found: a real failing request. magpie's logs on this Mac hold none, and
Codex's rollouts here hold no tag of this kind after a tool output, so the
exact bytes the reporter's thread carries are inferred, not seen.
Run: test/compat.mjs (new case red on 0.1.20, green now), agy-cli.test.mjs
whole on mote (12 pass). Broken by hand: old index.mjs makes the new case
fail. Not tried: a real ChatGPT desktop thread against agy-cli.
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 c27ba5f7), landed onto main 7869318d with the
version moved to 0.1.13 (0.1.7 was taken by the time it landed).
Run at the reviewed head: WSL2 bun test packages/agy-cli 8 of 8, check.mjs
ok; Windows 7 pass, 1 fail, the same smoke red as main (#973). Broken by
hand: without `userSteered = true` in inspectToolTurn's image branch, the
new compat test goes red (11 pass, 1 fail) and smoke.mjs exits 1.
Run at this commit (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 ok.
Not tried: macOS (mote refused ssh), a real agy.
Closes#965
Co-authored-by: klarkxy <klarkxy@users.noreply.github.com>
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 d5f4214e) on mote, bun 1.4.2:
- bun test packages/agy-cli: 8 pass, 0 fail, at the head and merged
- bun scripts/check.mjs agy-cli: ok, at the head and merged
- Broken by hand (index.mjs reverted, tests kept): compat 1 fail (the new
test); smoke 3 FAILURES of 321 (before, after, Skill: status 400)
- Probe of inspectToolTurn merged: the user text appears once in the replay
and the result once; MCP content stays "file contents"
Not run: the root bun test suite (mote's suite queue was long); the
reporter's own request bytes (never obtained, #909 stays open for them).
Co-authored-by: Guuuu233 <308638291+Guuuu233@users.noreply.github.com>
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>