Claude Code 2.1.322 in auto mode, routed through magpie, denied every
action it would check with "Auto mode can't check actions in this
session. Its safety check runs on the server, and your requests go
through 127.0.0.1:3425, which doesn't pass it through"
(auto_mode_no_check_in_session), on DeepSeek and on a Claude model
alike. 2.1.316 fell back to its own classifier there; 2.1.322 doesn't
when telemetry or feature flags are off (DISABLE_TELEMETRY,
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, ...), unless
CLAUDE_CODE_AUTO_MODE_SERVER is "0".
magpie wrote that "0" only when no model Claude Code could reach was
reviewed. Any reviewed one, a relay's Claude on its Anthropic endpoint
included, left it unset, and /model (or a route that drops
safeguard_results) then left the session with no check. That is why a
Claude model failed too.
Now claudeReviewed asks every reachable model (shown entries, group
members, fallbacks, the models it is set to) for
gateway.AutoModeAnswered: a reviewable model on the Claude subscription
or on api.anthropic.com. Any other writes "0", and Claude Code runs its
own classifier through the gateway, fitted to any model
(classifierStandIn); its model is the Claude Code card's auto mode
square (CLAUDE_CODE_AUTO_MODE_MODEL). An empty slot Sync passes (no
small model, say) is skipped, not judged as a model. The gateway still
passes safeguards to relays as before. Nothing mimics Claude Code and
CLAUDE_CODE_ENTRYPOINT is not set.
Real runs, Claude Code 2.1.322 in a sandbox HOME against the live
gateway as a client, auto mode, `ls /`, DISABLE_TELEMETRY=1:
- deepseek/deepseek-flash: the user's exact denial (before).
- deepseek/deepseek-flash with CLAUDE_CODE_AUTO_MODE_SERVER=0 (what
the fix writes), with and without a classifier model set: the local
classifier ran (permission_check_status checking -> done), Bash ran.
- openrouter/anthropic/claude-opus-5.5: ran (OpenRouter returned the
results; the fix still writes "0" for it, which also works).
- claude/claude-sonnet-5 (subscription bridge): ran.
Fake upstreams with and without safeguard_results (in a stream's
message_delta delta) showed the same split.
Tests: TestClaudeAutoModeReview (DeepSeek beside a Claude model writes
0, the user's case), TestClaudeReviewedOnlyWhereResultsComeBack,
TestClaudeReviewedJudgesTheSetModelWhereItGoes (empty slot),
TestT3CodeAutoModeReview, TestAutoModeAnsweredOnlyWhereResultsComeBack.
Broken by hand on WSL, each went red: AutoModeAnswered true for any
reviewable model (relay cases red in agent and gateway); the old
"any shown entry reviewed" rule (the user's case and T3 Code red); an
empty slot judged as a model (three Claude-alone cases red).
Runs, each at the tree named (the diff is the same in all three):
- On 7e1858515 (this commit is on 065ca02c2 after it, a provider
preset only), WSL magpie-desktop:
go test -tags nogui -run 'AutoMode|ClaudeReviewed|ClaudeFirstWrite|
T3Code|ProxyKept|Claude' ./internal/agent ./internal/gateway: ok.
- On a1ba92ad8: WSL full ./internal/agent and ./internal/gateway:
gateway ok; agent ok but TestGrokInstalled, red on WSL at main
already (#3548, binfmt interop). mote (darwin) ./internal/agent ok
(267s); its gateway run lost SSH midway, so darwin gateway is not on
record. Windows (xiaomi-gpu): the auto mode, T3 Code and proxy tests
ok; TestT3CodeCodexInstance red as at main (#5130).
- On c2c2c82ca, mote: the targeted tests ok, go vet darwin, linux
nogui and windows ok for internal/agent and internal/gateway.
- gofmt clean. The full suite starts after the tag.
Not tried: Claude Code versions other than 2.1.322; Bedrock, Vertex
and Copilot routes with real accounts (judged by AutoModeAnswered's
tests only); T3 Code's instance live.