Cause: "simulated Windows timeouts kill the whole tree" ran fetchUsage
with a 600ms timeout that covers both children. On a loaded machine the
fake agy's start (bun startup plus its browser-guard spawnSync) can use
most of it, so the timeout fired before the report child had logged, or
before it was even spawned, and logs[1] was undefined
("undefined is not an object (evaluating 'logs[1].pid')"). The same
budget made its sibling "version/report hangs time out" read a log the
killed version child never wrote (ENOENT). After the kill, a fixed 20ms
(and 50ms in both descendant tests) stood in for the kernel and event
loop reaping a SIGKILLed child.
Fix, test-only:
- timedOut() records each spawned child's pid itself and doubles the
timeout (600ms up to 38.4s) until the timeout lands while the child
under test runs; the taskkill assertions use the spawned report pid.
- The "gone" checks poll: waitForPidExit with a 15s bound over the
spawned pids and every pid the fixture logged (the agy under cmd.exe
on Windows); waitForNotRunning polls ps for the two descendant tests.
- agy-cli.test.mjs runs each suite with bun's --timeout 120000: bun's
5s per-test default was the next fixed wait these tests hit under the
injected delay.
- The fake agy takes TEST_START_DELAY_MS to reproduce a slow start.
Injected: TEST_START_DELAY_MS=400 on the old test (WSL magpie-desktop)
-> the #950 test red with the logs[1].pid TypeError; =900 -> it and the
hang test red with ENOENT. With this change: 20/20 at 0, 400 and 900 on
WSL, 20/20 at 0 and 900 on mote (macOS), 17/17 (3 skipped) at 0 and 900
on xiaomi-gpu (Windows).
Ran: wsl-run 'export HOME=$(mktemp -d); bun test packages/agy-cli;
bun scripts/check.mjs' -> 13 pass, 0 fail; check.mjs all ok.
Not tried: the reaping race by itself (a SIGKILLed child still listed
after 20ms) wasn't injected; it is covered by polling, not reproduced.
No source change, so no version bump.
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>