Claude Desktop lists models with effort levels as mythos-magpie-* so its
effort picker shows. Claude Code 2.1.295's built-in Explore (model:
"inherit") caps its inherited model at Opus when the session model's family
ranks above Opus (pge/BHn: {inheritCap:"opus"}), so an Explore with no model
of its own went to Desktop's Opus default, a different route. Claude Code
skips that cap when CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP is set.
magpie now writes CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP="1" into Claude
Code's settings env while this machine's Desktop is on magpie (writeExplore
in claudeIn: Desktop alone, model picks and Sync), and removes it when
Desktop is taken off, only if it is still magpie's own "1". A value the user
had (an empty one too) or changed later stays. The stash key
claude.explore_inherit_cap marks magpie's value. WSL twins don't get it.
Checked in the installed Claude Code 2.1.295 binary (read only): the env is
read in pge() before the cap, and it is not in the set host-managed sessions
(CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST, Desktop's Code tab) drop from settings
env (eu: oV, N$, F$, hdt model list, ... none hold it), so Desktop's Code
tab honours it. Renaming the alias was not chosen: Desktop's effort picker
needs it. The settings file is shared, so a terminal Claude Code session on
a real Fable model also inherits without the cap while Desktop is on.
Patch by NeuroPaw (1b480ef3), applied unchanged.
Run (sandbox HOME, pinned GOMODCACHE, private GOCACHE):
- TestClaudeDesktopExploreInheritCap, TestClaudeDesktopExploreKeepsUserValue
pass. Broken by hand four ways, each a real FAIL: no write ("value "",
present false; want "1", true"), overwriting the user's value ("user's
Explore value "0" lost: "1""), never removing ("value "1" ... want "",
false"), removing a value that isn't magpie's ("user's Explore value "0"
lost: """).
- go test -tags nogui ./internal/agent (1337s, load ~260) and
./internal/agentenv: ok. An earlier run of internal/agent hit the default
10m timeout under that load; with -timeout 45m it passed.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
internal/agent; GOOS=linux -tags nogui and GOOS=windows go build.
Not tried: a real Claude Desktop Code session with the built magpie; the
full go test ./... suite.
Co-authored-by: NeuroPaw <link_xin@163.com>