Files
magpie/docs
yetone 5206177704 agent: a 1M model Desktop lists by its [1m] id is told by its 1M, not a 272K GPT's beside it (dumplings on Discord)
dumplings (magpie 0.1.1295, Settings > 长对话 "完整窗口"): the provider
model showed 1M and its 1M variant was picked in Claude Desktop, but
Desktop's Code tab still showed 272K. With Desktop on magpie, claudePlan
tells Claude Code the largest window of every model it can run there
(CLAUDE_CODE_MAX_CONTEXT_TOKENS) and holds the smaller ones to their own
with modelSettings.<id>.autoCompactWindow. A model handed by a "[1m]" id
counted toward that largest only when it was Claude Code's main model,
so a 1M model Desktop lists by its 1M id (DesktopLongest) beside a 272K
GPT left 272K the value told, and with it alone nothing at all.

Now every [1m] model counts by its window (1M when unknown), and the GPT
beside it gets its own 272K entry. The `main` field it needed is gone.

Tests: TestClaudeDesktopContextWindow1M (rewritten: glm listed by its 1M
id alone tells 1M; beside a 272K GPT, 1M told and GPT held to 272000),
TestClaudePlan's [1m]-beside-272K case and its 500K->1M expectations.
Broken by hand (`case m.long && false:`): both go red
(TestClaudePlan "magpie's default: 500000", TestClaudeDesktopContextWindow1M
"glm listed by its 1M id alone: \"\""); green with the fix.
Run: go test -run 'TestClaudePlan|TestClaudeDesktop|TestClaudeContextWindow|TestBudget' ./internal/agent: ok.
Break check repeated at push: `case m.long && false:` turns
TestClaudePlan ("magpie's default: 500000") and
TestClaudeDesktopContextWindow1M ("glm listed by its 1M id alone:
\"\"") red.
Full suite (go1.26.8 darwin-arm64, rebased on 0fe039f14): go test
-timeout 45m ./... gave 63 packages ok; internal/agent and
internal/gateway timed out at 45m with no test failed (load ~110 from
other sessions; deadline in TestJcode and TestVertexGeminiClients,
#2544 and #2870 seen again) and passed alone at that head: ok
internal/agent 1644.560s, ok internal/gateway 1397.712s. Rebased on
origin/main 4ae6c06dc, every package its new commits touch run in full
there: ok internal/agent 465.353s, internal/gateway 648.172s,
internal/sessions, internal/gui, internal/cli, internal/codexsummary;
gofmt -l on the changed files empty; go vet ./..., GOOS=linux go vet
-tags nogui ./..., GOOS=windows go vet ./... clean; go build for
darwin, linux (nogui) and windows ok (at 0fe039f14).
Then rebased on origin/main 2201b6628 (one line in
internal/provider/migrate_qoder.go): ok internal/provider 608.249s; go
vet of internal/provider, internal/agent and internal/gateway clean.
2026-10-21 03:40:26 +08:00
..