Claude Desktop's connection check 404s when its recorded model is a deleted routing group (unserved() trusts any group/ id)
Summary
When claude-desktop.model (magpie's record of the model Desktop's last turn ran on) names a routing group that no longer exists, Claude Desktop's connection check fails forever:
- Desktop shows "Configured model not available / Gateway couldn't serve anthropic/magpie-
" . - The gateway answers the check with
404and a self-contradictory message:magpie knows no model "<real model>"; did you mean <the same real model>? - Normal chat requests from the same client work (200), so the model, provider, key and masking are fine. Only the check fails.
- Requests from other agents (Claude Code, Codex, Gemini UAs) work with the same body.
Environment
- magpie 0.1.4224 / 0.1.4225 / 0.1.4226, macOS arm64
- Claude Desktop in 3p gateway mode (
inferenceGatewayBaseUrl= magpie), model = a routing group
Steps to reproduce
- Set Claude Desktop's model to a routing group and have one real turn, so magpie writes
$settingsDir/claude-desktop.model=group/<x>. - Delete (or rename) that group in magpie.
- Restart magpie, leaving
claude-desktop.modelas it is (the file is read once per process, seeloadPicked). - Send Desktop's connection check:
curl -sS http://127.0.0.1:3425/v1/messages \
-H 'x-api-key: magpie' -H 'anthropic-version: 2023-06-01' \
-H 'content-type: application/json' -A 'claude-desktop/1.0' \
-d '{"model":"group/<live-group>","max_tokens":1,"messages":[{"role":"user","content":"."}]}'
# 404: magpie knows no model "group/<live-group>"; did you mean group/<live-group>, ...
Controls (same body, same gateway):
| request | result |
|---|---|
-A 'claude-desktop/1.0', max_tokens:1, "." |
404 unknown model |
-A 'claude/1.0', same body |
200 |
-A 'claude-desktop/1.0', max_tokens:2, "." |
200 |
-A 'claude-desktop/1.0', normal content |
200 |
- Fixing
claude-desktop.modelto an existing model and restarting magpie makes the check return 200.
Cause (code)
desktopMoveTo() (internal/gateway/desktop.go) sends a probe (desktopProbe: max_tokens == 1 plus one "." message) through desktopChosen().
desktopChosen()(internal/gateway/desktop.go:878) prefersdesktopPickedPath()—$settingsDir/claude-desktop.model(desktop.go:544, written atdesktop.go:689) — when that file is newer than Desktop's model-menu state, and returnsunprefixed(picked)as long as!unserved(m).unserved()(internal/gateway/gateway.go:292) returnsfalsefor anygroup/…id without checking that the group still exists:
if asked == "" || provider.IsGroupRef(asked) {
return false
}
So the deleted group is accepted as the model for the check, provider.Resolve(asked) fails, and gateway.go:2797 answers 404 through unknownModel(call.Model, "").
The reason the message looks impossible is that unknownModel is given call.Model (the model the client asked for, already unmasked) instead of asked (the stale group that actually failed to resolve).
Note that call.Model is already the real model: the client asks by a masked alias (anthropic/magpie-<n>) and Call.Model is built from unprefixed(modelOf(body)), so the error names a model that exists.
Suggested fixes
unserved(): for group refs, verify the group exists (catalog entry /GroupFor/FindGroup) instead of trusting thegroup/prefix.desktopChosen()/desktopMoveTo(): if the picked model doesn't resolve, fall back to the menu choice or the default model rather than returning it.unknownModel()atgateway.go:2797: passasked, notcall.Model, so a 404 names the model that actually failed.
Workaround for users
After deleting/renaming a routing group, point the record at a live model and restart magpie:
printf 'group/<live-group>\n' > ~/.config/magpie/claude-desktop.model
# quit and reopen magpie (the file is read once per process)
Alternatively, send one tool-carrying chat turn (it rewrites the record at desktop.go:689) before restarting Desktop — but that is exactly what is blocked while the banner is up.
中文摘要
Claude Desktop 的连通性检查会被 desktopChosen() 改送到 ~/.config/magpie/claude-desktop.model 里记录的模型上。如果这个记录是一个已被删除/改名的路由组,unserved() 因为看到 group/ 前缀就直接认为它可用,不检查组是否存在,随后 Resolve 失败返回 404;而报错打印的是 call.Model,于是出现「knows no model X; did you mean X」这种自相矛盾的提示。真实对话不受影响,只有这条检查坏。把记录改成仍存在的模型并重启 magpie 即可恢复;根治需要 unserved() 校验组存在性,并让 404 打印真正解析失败的 asked。
I reproduced the same stale-model routing behavior on macOS (arm64) with packaged Magpie v0.1.4404. In this case the saved model was an old OpenCode Go model ID, so the connection check reached the provider and returned HTTP 400.
Claude Desktop showed Configured model not available for the Haiku model it probed. The Magpie routing log shows the requested model, the rewritten target, and the upstream attempt (excerpt limited to routing fields):
{
"agent": "claude-desktop",
"kind": "connection_check",
"model": "opencode-go/claude-haiku-5-5",
"moved": {
"to": "opencode-go/deepseek-flash",
"why": "desktop-check"
},
"status": 400,
"tries": [
{
"id": "opencode-go",
"model": "deepseek-flash",
"status": 400,
"error": "OpenCode Go: Model deepseek-flash isn't included in OpenCode Go. See the models it includes at https://opencode.ai/console/go."
}
]
}
The desktop-check reason confirms that Magpie recognized the connection check. OpenCode Go rejected deepseek-flash, and the check never reached the requested Haiku model. This is another case for validating the saved model before using it for the probe. An enabled provider can still reject a stale model ID.
这条看起来已经修了 —— 确认一下就可以关(2026-11-29,上游 85cdca969 之后)。
提交 bc3527578「gateway: Claude Desktop's check stays on the menu's model, and never goes to a gone one」
Claude Desktop 的连接检查停在菜单里那个模型上,不会去问一个已经消失的 —— 正是这条的 404。
确认了就关即可;若还有不顺手的地方,写一句现象我继续看。