The cause: under settings.DesktopLongest, /v1/models lists such a model by
its "[1m]" id alone (#1272). Claude Desktop 2.7032 (app.asar, read only)
marks an entry as the 1M one only on the entry it adds itself: JLt emits
`${id}[1m]` with description WLt = "1M context window" and
supports_1m_context, and only for a model with supports1m. PIt gives
supports1m to a bare id alone (LC(id) === id), and OIt folds a "[1m]" row
only into a bare one listed beside it. So the lone "[1m]" row was shown by
its name with no description, exactly like the plain entry it replaced: with
the switch off the menu had "DeepSeek V4 Pro" plus "DeepSeek V4 Pro · 1M
context window"; on, only "DeepSeek V4 Pro". The reporter read that as the
switch keeping the plain model and dropping the 1M one.
What changed: such a row now carries description "1M context window", the
words Desktop gives its own 1M entry, and Desktop shows a row's description
(PIt keeps it; JLt prefers it to its fallback). The id is unchanged: the
"[1m]" is what gives a Claude Code session the 1M window, and magpie serves
it as the plain model. Rows under 1M, and every row with the switch off, are
unchanged (no description).
What was run:
- TestClaudeDesktopLongestOnly now checks each row's description, on and
off. With the description line removed it fails: "on: vend/deepseek-v4-pro
(...[1m]) described "", want "1M context window"".
- Sandbox HOME gateway on 127.0.0.1:3561 with real providers, /v1/models
as Claude Desktop asks for it, fed through a script that follows
PIt/OIt/JLt: on, each 1M model is one entry "<name> · 1M context window";
off, the plain entry plus Desktop's own 1M one, as before.
- gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui
./internal/gateway; go test -tags nogui ./internal/gateway under a temp
HOME: ok. No GUI or string change.