Claude Code (2.1.299, seen against a fake server in a sandbox HOME) declares
the advisor as Anthropic's server tool {"type":"advisor_20260301",
"name":"advisor","model":"claude/claude-opus-5-5"} with the beta
advisor-tool-2026-03-01. The model is magpie's id, which no vendor knows,
so a relayed Messages request carrying it was refused whole.
passthrough now runs advisorTools on Anthropic upstreams. An advisor model
that is one of the same provider's Claude models goes as that upstream's
own name for it (the wires, as the request's own model). So does a bare
Claude id that names no provider, and the [1m] mark is dropped. An advisor
the upstream can't run (another provider's model, a group, a model that
isn't Claude), and every advisor when the request's own model isn't
Claude, is left out. If no tools are left, tools and tool_choice go too.
Translated routes already drop server tools (anthropic.go). The Claude
subscription's bridge declares only magpie's tools, so it never has an
advisor. Nothing is sent to Anthropic with a user's token.
Claude Code's own gate: without CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL=1
it sends no advisor for a model with no advisor rank in its catalog ("Switch
to a public model alias (opus, sonnet, fable)"). That is unchanged here.
Run: TestAdvisorModelAsTheUpstreamNamesIt (same provider, [1m], bare
Claude id kept, another provider left out, vendor model left out, other
tools kept). It fails with advisorTools taken out of passthrough.
gofmt -l clean. go vet for darwin, GOOS=linux -tags nogui and GOOS=windows
on ./internal/gateway. go test -tags nogui ./... under a sandbox HOME at
load ~90: every package passed except agent and gateway, which hit the
10m timeout, and TestCopilotSecretToolUsername (its two 5s secret-tool
waits ran out under that load). Rerun with -timeout 30m, gateway, agent
and provider all pass.
Not tried: a real Anthropic or relay upstream, and a running magpie with
real Claude Code end to end.