Files
magpie/docs
yetone ccbc727818 agent, gateway: a Claude model magpie can only ask translated no longer keeps auto mode's server review on (nexnull on Discord)
nexnull (Claude Code 2.1.308, magpie v0.1.1318, DeepSeek 4.1 flash) saw
Claude Code's notice that auto mode's classifier "isn't eligible because
your requests go through 127.0.0.1:3425". The wiring leaves
CLAUDE_CODE_AUTO_MODE_SERVER unset while any model Claude Code can reach
through magpie is reviewed (claudeReviewed), and it judged that by
AutoModeReviewed, which counts a Claude model by its name. A relay that
lists claude-* beside DeepSeek with only a Chat (or Responses) URL, or a
Claude model the user pinned to chat, is asked translated: a probe showed
such a request goes to /v1/chat/completions with no safeguards and no
safeguard_results. So the review stayed on and the notice showed.

AutoModeReviewable (gateway/automode.go) is AutoModeReviewed on a route
that reaches the Messages API: the Claude subscription, or a provider
with an Anthropic URL whose APIs for the model (a user pin first) include
Anthropic. claudeReviewed asks it for the provider and each fallback, so
Claude Code and T3 Code get CLAUDE_CODE_AUTO_MODE_SERVER=0 there. It is
still magpie's own stashed value (claude.auto_mode_server): a user's own
value is left alone, and disconnect or restore takes magpie's off.
serverReview, already on the Messages route, keeps AutoModeReviewed.

Chosen on purpose: any reachable model that is really reviewed keeps the
review on. Writing 0 by mistake would lose server review on Claude
silently, while leaving it on by mistake costs the notice, which Enter
dismisses for 24h. A relay with an Anthropic URL (OpenRouter, AiHubMix)
still counts as reviewable, since some pass the field through. No
client mimicry and no prompt or identity text changes.

Pass-through on Anthropic routes (asked in the same task): no defect.
Probes against a fake upstream showed the anthropic-beta (with
dangerous-tool-use-2026-09-03) and anthropic-version forwarded, the
safeguards body byte-identical, a stream:false reply relayed byte for
byte with safeguard_results and an unknown key intact, and the SSE relay
keeping an unknown key, an unknown event type and toolu ids. The probe
file was removed and is not committed.

Full run at 983425662, the same change one commit back:
- gofmt -l: clean. go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: ok.
- set -o pipefail; go test -timeout 45m ./...: EXIT 0, 68 packages ok,
  no FAIL (internal/agent 386s, internal/gateway 507s), run alone after
  another session's suite ended.
- TestAutoModeReviewableAsksOnMessages and
  TestClaudeReviewedOnlyWhereMessagesReachClaude are red on the old code
  ("cr/claude-sonnet-5: true, want false"; "a relay without an Anthropic
  endpoint: \"\", want 0").

Rebased then onto 61b92529e (#2932 sessions, #2942 budget; none of
this change's files): go vet ./internal/... ok, and go test for
internal/agent, internal/gateway, internal/budget and internal/sessions
ok at the pushed head.

Broken by hand: dropping the Anthropic-URL check made the gateway test
red; ignoring the user's pin (apis != nil || true) made the agent test
red ("Claude set to be asked on chat: \"\", want 0"). Restored after
each break.

Not tried: real Claude Code 2.1.308 against a sandbox gateway with a
real DeepSeek key, so the notice going away in a live auto-mode session
is not seen. No GUI files are touched, so the GUI suite was not run.
2026-10-22 18:19:00 +08:00
..