1EFLOPS runs Claude Code through magpie on Codex's gpt-6.1-sol. In auto mode, Claude Code 2.1.296 says "this session isn't eligible because your requests go through 127.0.0.1:3425 ... ask your gateway to implement https://code.claude.com/docs/en/auto-mode-classifier-billing". What the page asks of a gateway: pass the anthropic-beta header (dangerous-tool-use-2026-09-03), the request's `safeguards` field, and `safeguard_results` in the reply through unchanged, and leave tool-use ids alone. The results are verdicts from Anthropic's own safety classifier. For a gateway that can't provide them, the page's remedy is CLAUDE_CODE_AUTO_MODE_SERVER=0. Pro, Max and Team plans never see the notice. In the bundle, Claude Code falls back on server_unsupported, server_unavailable_disabled or server_no_result, and the notice shows whenever there's no real verdict. Only that variable removes it. Per route: - Claude subscription bridge, Anthropic API key, relays in front of Anthropic, Bedrock and Vertex: already pass the beta, `safeguards` and `safeguard_results` through (e8cd4bac8,8c21a4184). This commit doesn't change them. serverReview now uses the shared AutoModeReviewed rule (adding the subscription account, which never reaches serverReview). - Codex/OpenAI and every other non-Claude model: magpie can't answer honestly. A verdict would be made up, and "unsupported" still shows the notice. So magpie answers nothing on Anthropic's behalf. Instead the Claude Code wiring writes env.CLAUDE_CODE_AUTO_MODE_SERVER="0" to settings.json. It does this only while Claude Code is routed through magpie and no model it can reach there is reviewed. That means checking the models shown to Claude Code (and Claude Desktop's while Desktop is on magpie), a shown group's members, those providers' fallbacks, and the models it is set to (claudeReviewed). If any one is reviewed, the variable stays unset, because /model can move the session onto it (the reason8c21a4184didn't write it at all). The value is rewritten on every model set and Sync, so adding a Claude provider turns the review back on. It is stash-tracked (claude.auto_mode_server): a user's own value is left alone, and magpie's goes on Disconnect, reset or a move off magpie. - T3 Code (sibling): its magpie instance runs Claude Code on the gateway through its own environment, so it gets the same "0" by the models it lists. Not covered: Claude Desktop's Code tab while Claude Code itself isn't routed through magpie. Desktop users are on Pro/Max/Team, which never see the notice. Tests (each fails with its part of the change broken by hand): - TestClaudeAutoModeReview: off on a non-Claude model; on with a Claude model shown, in a group or as a fallback; the user's "1" and "0" kept; dropped on reset and on a move to Claude Code's own model. A group that keeps its models out of the lists (#1783, Unlists) still routes to them, so its Claude member counts: members come from what is served, not from the catalog. - TestT3CodeAutoModeReview. - TestAutoModeReviewedRoutes: subscription, api.anthropic.com, relay, Bedrock and Vertex spellings yes; Codex, DeepSeek's Anthropic API, openai/gpt-6 and claudette no. Mutations that went red: skipping group members, skipping fallbacks, skipping an unlisting group, overwriting the user's value, not dropping it off magpie, always writing it, the T3 env always or never, and the subscription not counted. Real Claude Code 2.1.296, sandbox HOME/CLAUDE_CONFIG_DIR, magpie serve on 127.0.0.1:3591 under a scratch HOME, fake upstreams on 3593 (OpenAI Chat) and 3594 (Anthropic): - Before, on fakeai/fake-gpt, -p --permission-mode auto: the notice is on stderr (2 of 2 fresh config dirs). With the env in settings: none. - With this build, `magpie claude fakeai/fake-gpt` wrote the "0", and a fresh run shows no notice. The same settings without it show the notice. - `magpie provider add fakeanth anthropic=... models=claude-sonnet-5`: Sync took the "0" out. `magpie claude fakeanth/claude-sonnet-5` and a run in auto mode: the upstream got the dangerous-tool-use beta and `safeguards` on both turns, answered not_flagged in message_delta, and there was no notice. Not tried: the Claude subscription bridge with a real account (its plans don't see the notice), and a real Codex account (a fake Chat upstream stood in for it). Run: gofmt -l; go vet -tags nogui ./... for darwin, linux and windows; go test -tags nogui ./... in a scratch HOME with the Go caches pinned. The only red was TestOTelWaterfallIncludesUnbilledFallback, whose first export was cut before the root span under load. That is #1794, filed earlier today; this run is noted there. This change doesn't touch OTel. internal/agent was timed against the unchanged base under the same load and ran at the same pace.
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 |
| Plugins that run on the gateway's requests and replies | Gateway middleware |
| 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 |
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.