Files
magpie/docs
yetone bc470c6b63 agent: Claude Code's own ANTHROPIC_MODEL comes back when magpie steps out
Wiring Claude Code in deletes env.ANTHROPIC_MODEL (writeTiers), because it
outranks a pick in /model. Unlike the tiers' models (#1050), the user's
own value was never stashed, so Disconnect or Claude Code's own model left
it gone for good. A Bedrock user like jw1dev keeps the Bedrock model id
there, so after the previous commit put the switch back, Claude Code would
come back on Bedrock without its model. ANTHROPIC_MODEL now joins
claudeOwnEnv: it is stashed raw beside the endpoint and token when first
routed from the user's own endpoint, put back by unroute, and forgotten
with the rest. A value an older magpie wrote, at its own key, is still not
kept (keyOurs), as before.

Run:
- gofmt -l: clean.
- go vet ./internal/agent: native, GOOS=linux -tags nogui, GOOS=windows:
  clean.
- go test -tags nogui ./internal/agent ./internal/gui: ok 4 times. One
  earlier run of the two together had internal/gui red, and only `tail -5`
  of it was kept, so the failing test's name was lost. It passed alone 3
  of 3 and with internal/agent 3 of 3. Nothing in internal/gui reads
  claudeOwnEnv.
- Targeted: ClaudeCloud, TestClaudeDisconnect, TestClaudePick, legacy,
  stand-in and T3 tests: ok.

Broken by hand: before the fix, TestClaudeDisconnect's new "own env
model" cases (with no settings model and beside one, [1m] kept; each by
Disconnect and by default) went red. The bedrock fixture of
TestClaudeCloudSwitchStepsAsideForMagpie now carries a Bedrock
ANTHROPIC_MODEL and compares the whole env after.

Not tried: WSL twins for real (the stash key goes through at.key as for
the tiers).
2026-10-15 07:41:30 +08:00
..