What changed:
- writeTiers (claude.go) wrote env.ANTHROPIC_AUTH_TOKEN = wiredKey() on
every model and tier pick, and putProvider beside the thread-provider
tables (codex.go) wrote experimental_bearer_token = at.gwKey() the same
way: a caller key of the gateway's own the user put in their place was
written over, and it was never stashed, so no Disconnect brought it
back. Both keep such a token now, as a sync keeps one (mergeKept,
keyHolds of #2510): only a value the gateway would refuse is wired
over. The sign-in field's own Set is unchanged, as that switch is the
user's own.
- The sharing key magpie itself made is never one of those: access.Default
says a secret is the default key ConfigureLAN keeps, sharing on or off,
and the two write points ask it before keeping what they hold. With
sharing off the key stays enabled in the store, Authenticate still took
it, and keyHolds held it for the user's — Rekey could no longer bring
gateway.Token back (TestRekeyGivesWSLAgentTheSharingKey, deterministic
red on the first cut of this patch, found in review). Claude has no WSL
twin: the sharing key reaches it by an address beyond loopback
(MAGPIE_ADDR), and a pick kept it the same way there, so
TestClaudeSharingOffWiresGatewayTokenBack holds a sharing on, then off,
to gateway.Token.
- docs/subsystems/agent-wiring.md's sentence about a hand-set key said
Check reports it; Check has taken one since #2510, and a pick keeps it
now too, the sharing key excepted.
Patch by ggbdpq (c809f7ad), the second cut after review: the first
(835d3bf8) turned TestRekeyGivesWSLAgentTheSharingKey red, as the
sharing key stays enabled with sharing off and was kept as the user's.
Applied unchanged on e085d6e92.
Run (landing worktree, sandbox HOME, private GOCACHE):
- Broken by hand: access.Default returning false: FAIL
TestRekeyGivesWSLAgentTheSharingKey (wsl_rekey_test.go:88, "sharing
off: key sk-magpie-key-…") and TestClaudeSharingOffWiresGatewayTokenBack
(claude_test.go:291). claude.go and codex.go put back to main's: FAIL
TestClaudePickKeepsAGatewayKeyOfTheUsers and
TestCodexPickKeepsAGatewayKeyOfTheUsers ("a model pick wrote over the
user's caller key"). Restored: all four and TestRekey* ok.
- gofmt -l: clean. go vet darwin (gui), GOOS=linux and GOOS=windows
-tags nogui: clean.
- Full suite, go test -tags nogui -timeout 45m ./... under pipefail at
7380d99e4 (this on e085d6e92), load ~180: every package ok except
internal/agent, which ran past 45m as a whole (2704s, the test at the
deadline 5s in; #2544, this run posted there). Alone at -timeout 45m
it ran out again (2702s, load ~210). Alone with -v -timeout 100m: ok,
854 tests passed in 3017s, the five above among them.
- Rebased on cb05dc2d1 (#2576, #2578, #2657: no internal/agent or
internal/access file): build and vet of both packages ok.
Not tried: a real WSL distro, or the real app's sharing toggles.
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
With Claude Code on codex/gpt-6.1-sol and the tiers following it,
magpie wrote ANTHROPIC_DEFAULT_FABLE_MODEL=codex/gpt-6.1-sol. Claude
Code takes the model that variable names for a Fable model, so on a
claude.ai Pro sign-in without usage credits it stopped Sol's first turn
with "Fable now uses usage credits" and, after Escape, "Your model
policy only allows Fable". follow already left the fable tier unset on a
Claude model that is no Fable (Zhenzhen on Discord); claudeName is ""
for another vendor's model, so the exception never reached it.
follow now leaves the fable tier unset on any model that is no Fable,
and follows only a Claude Fable. Claude Code's own /model fable, asked
of the gateway, still runs on the main model (claudeStandInAt). A
settings.json an older magpie wrote, fable on the main model, is taken
out on the next Follow by the check that already did it for Opus. The
user's own fable pick, or the main model at a fable effort of its own,
is kept as before.
Run:
- TestClaudeFableTierOnClaude: Sol (cx/gpt-6.1-sol) and DeepSeek as the
main model leave the fable tier out while opus/sonnet/haiku follow,
claude-fable-5-1 stands in as the main model; the reporter's
settings.json (fable on Sol) is cleaned by Follow; Opus, Sonnet and a
real Fable as before. FAILs on the old follow ("fable tier written as
cx/gpt-6.1-sol").
- TestClaudeTiers, TestClaudeTierEffort, TestClaudeTierNamesGoWithTheirModel
and TestClaude1MMarked asserted the fable tier on another vendor's
model, the behaviour #2090 reports; updated to expect it unset.
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
internal/agent; go test -tags nogui -timeout 40m ./internal/agent/
(one failure, TestClaude1MMarked, then fixed and rerun with the tier
tests).
Not tried: a real Claude Code 2.1.299 session on a Pro sign-in.
Through magpie, each tier follows the main model until it is given one of
its own (ANTHROPIC_DEFAULT_*_MODEL; haiku also sets ANTHROPIC_SMALL_FAST_MODEL).
The GUI shows them under one tiers menu; the CLI takes magpie claude haiku <model>.