xishuchkui-code's Antigravity account answered 502 with an empty reply,
which doesn't rest it; the gateway went on to the next account and that
one answered. The Routing page's story said "answered 502 — an error
another account wouldn't fix, so Claude Code gets it" (换账号也无法解决,
Claude Code 收到此错误), and the account's row said "502 · failed ·
passed to Claude Code". Both guessed the outcome from where the try stood
in the order (not last, no rest, no retry), not from what the gateway did.
What came of a try is now read from the record. The gateway appends a try
to Route.Tries only as it asks it, so a later try is the request going
on; with none, the error ended the request, the agent's once the route
is done. No marker was needed for that. The one case the record can't
show is the `other` hand-back: the last try left, out of its allowance
after an earlier failure that wasn't one, while the agent is told the
earlier error (Discord, waroy). That try is now marked Try.Earlier.
Siblings in trySaid that guessed the same way:
- a try that went on with no rest: "answered {status}, and the request
goes on to {next} … doesn't rest for it" (was "wouldn't fix … gets it");
- a resting try with nobody after it (the last key, #1772) said the
request goes on to "the next"; it now says nobody is left and the
agent gets the error;
- slow to begin with nobody left said it went on to the next; same;
- the Earlier try says the agent got the earlier try's error;
- a failed try with no next on a route still running says only what it
answered.
The account row: "passed to {agent}" only for the route's last try once
it is done; a try the gateway went on from says "{status} · {fail} ·
went on to the next". Usage's request detail only shows the gateway's
"answered on a retry" counts and the CLI/TUI don't tell tries, so neither
changes. 6 new strings, in en, zh, zh-TW, ja and de.
Run at this head (rebased on origin/main 95e7c6bcc):
- gofmt -l . clean; go vet ./... on darwin, GOOS=linux -tags nogui,
GOOS=windows: all 0.
- go test of internal/gateway and internal/gui under a sandbox HOME:
ok on af9bd6c3e (gateway 600s, gui 123s). After the rebase onto
95e7c6bcc, gui ok (608s); gateway ran out its 25m and then 30m
-timeout with no test failed (the alarm caught TestTextWrittenCallWhole
4s in), at load average ~100 with ~15 other go test runs going, and
was not run again: free disk fell to 2.7G.
- routing-went-on.test.cjs (new): 20/20 in Chromium and WebKit, en, zh,
zh-TW, ja, de, 1100 and 420. It fails on the old client.js with the
reporter's own words ("…返回 502,换账号也无法解决,Claude Code 收到此
错误。"), and with only the old row line put back it fails on
"502 · failed · passed to Claude Code".
- TestCodexSpentGrokFailingIsTold now asserts Earlier; with the gateway
line reverted it fails.
- routing-*, panel-routing*, gui-de, gui-ja, gui-zh-tw, i18n-keys in
both engines, after the rebase: Chromium 513/514, WebKit 512/514
(before it: 513/514, 510/514). WebKit's two after the rebase are
routing-model-rest de ("the Opus row doesn't rest"), red on
95e7c6bcc too (1 of 3 runs, alone; #2115 has it in Chromium). The reds are
routing-held-member at 420 in WebKit (#2252; also 2-4 red per run on
origin/main 707fbb249, alone, 4 runs) and routing-wb-restricted's
wheel-scroll "button can't be reached" (#1905; 4/4 green alone on both
this branch and main 707fbb249, alternated). routing-proxy and
routing-shape asserted the failed member's tag, which only appeared in
the wrong "passed to" row; the went-on row keeps it and both pass.
Not tried: a real Antigravity account answering empty; the fixture is
the reporter's case as the trace records it.
Full suite: SUITE_LINE
Subsystem design references
These pages describe current responsibilities, runtime paths, state, and contracts. Start with the subsystem relevant to your task, then follow its source links to verify the implementation you change.
| Subsystem | Reference |
|---|---|
| Built-in subscriptions moving to plugins | Provider and plugin ownership |
| Built-in plugins: registry, lifecycle, plugins.yml, presets, settings schemas, the window's kernel (slots, error boundary, kit) | Plugin runtime |
| Plugins that run on the gateway's requests and replies | Gateway middleware |
| Tools that plugins give, offered to every agent as an MCP server | Plugin tools |
| Claude subscription turns across Claude Code runs | Claude subscription bridge |
| How the gateway picks a provider, key or account, and falls back | Gateway routing and fallback |
| Gateway Session Aggregation | Gateway Session Aggregation |
| Connecting an agent's config to the gateway, drift, disconnect, WSL twins | Agent wiring |
| Providers, keys, subscription accounts, refresh and allowance | Providers and accounts |
| Instructions, MCP servers, skills and RTK written into agents | Library |
Tray, panel, window, magpie web and the page's JSON API |
GUI app shell |
| Encrypted backups and setup synchronization over WebDAV, S3 or GitHub | Sync and backup |
A subsystem can span several packages or repositories. Its reference describes the behavior those parts provide together; it does not need to list every function.
Maintain a reference
Update the owning reference in the same PR when a change alters a documented responsibility, interface, state transition, runtime path, compatibility rule, or failure behavior. An internal refactor that preserves these contracts does not require a prose change.
Keep each fact in one reference and link to it from agent instructions or other pages. Link to source files and named symbols rather than copying implementation details that change frequently. Explain field meanings and constraints that signatures alone do not express.
For a new reference, include the responsibilities and boundaries, source of truth, main runtime paths, state transitions, important constraints, and existing verification commands. Include failure and compatibility behavior where relevant. Document current behavior separately from proposed changes; the proposal belongs in its issue or PR.
Describe a PR's semantic changes
For each affected subsystem, explain the observable change with its trigger and before/after behavior. Include changes to interfaces, state, compatibility, and failure behavior when relevant. Link the affected reference, implementation, and verification evidence. State when a refactor preserves the documented behavior.
For example, a change to plugin adoption should explain which migration state and account condition trigger it, which implementation handles requests before and after adoption, and which test exercises that transition.
This is an author-provided explanation that a reviewer verifies against the diff and surrounding code. It is not an automatically proven compatibility verdict.
Review a change
- Identify the affected subsystem and the actual runtime path, including plugin or built-in ownership.
- Compare the claimed before/after behavior with the base and head implementation. Trace relevant callers and state transitions beyond the changed lines.
- Check that changed contracts appear in the owning reference and that source links still resolve.
- Check that the cited tests or runtime evidence exercise the claimed behavior. Report checks that were not run.
A documentation update alone does not prove the implementation. Existing tests and runtime evidence remain necessary for behavior changes.