xyenon (Discord #feedback) picked provider-1/DeepSeek-V4.1-Flash in pi with an Image recognition model set. An image they sent wasn't described; the request was answered by provider-2/DeepSeek-V4.1-Flash. Cause: provider-1's list says nothing of images, so magpie took models.dev's word for the model (catalog.SeesImages: text+image) and sent the raw image. The relay answered DeepSeek's 400 "Failed to deserialize the JSON body ... unknown variant `image_url`, expected `text`". That matches shapeWords, so the try failed as a shape refusal and went on to the next candidate: provider-1's fallback (or the next group member), the same model at provider-2, which sees. The describer was never asked. Fix: a 400/415/422 whose words say images aren't taken (imageRefused: unknown variant image_url/input_image/image, OpenAI's "only supported by certain models", OpenRouter's "no endpoints found that support image", vLLM's "not a multimodal model", 不支持图片 and the like) marks the model blind for this server's run (refuseSight; blindTo checks it first). With a describer, the same candidate is asked again at once with the images described (seenBody, or seenGroup for a group), before any fallback or other member; the try reads failSight, which the Routing page tells as its own story (en/zh/zh-TW/ja/de); the row then reads answered, as for floor's and foreign's re-asks. Later requests are described up front, for a direct pick and a group (user or auto) alike, on Chat, Responses and Messages. Kept on purpose: with no describer (Image recognition off, or no model that sees), going on to a candidate whose copy sees is the only way to answer, so it still does (TestRefusedImageWithNoDescriberGoesToOneThatSees). Documented in docs/subsystems/gateway-routing.md, "A model that turns an image away". Run (on mote, through mote-run): - TestPickedModelThatRefusesAnImageIsGivenItDescribed (9 subtests: direct pick with a fallback, user group, group/auto-…; each API), TestRefusedImageWithNoDescriberGoesToOneThatSees, TestImageRefused: ok. - Broken by hand: with gateway.go/vision.go/routing.go reverted to origin/main (d9cf85ae8), all 9 subtests fail with "the same model at the other provider was asked 2 times" and the raw image sent there. - go test -tags nogui ./internal/gateway -count=1 -timeout 45m: ok (996s) at thed9cf85ae8base. After rebasing onto4534561f6: the new tests and -run 'Vision|Image|Shape|Group' in internal/gateway ok, and the three vets and gofmt again clean. - go vet ./internal/gateway (darwin), GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gateway, gofmt -l: clean. - GUI: routing-sight (new, 5 languages) and i18n-keys in chromium on mote: ok. routing-sight and routing-shape in webkit on the Linux box (wsl-run): ok. WebKit on mote couldn't launch (browserType.launch timed out at 180s beside other sessions' webkit stuck 2h, routing-shape untouched failed the same), so its webkit leg ran on Linux instead. Not tried: a real pi session against a real text-only DeepSeek relay (no such account here); the fixture uses DeepSeek's literal 400 body. The full go test ./... and the whole GUI suite were not run.
Subsystem design references
These pages describe current responsibilities, runtime paths, state, and contracts. Start with the subsystem relevant to your task, then follow its source links to verify the implementation you change.
| Subsystem | Reference |
|---|---|
| Built-in subscriptions moving to plugins | Provider and plugin ownership |
| Built-in plugins: registry, lifecycle, plugins.yml, presets, settings schemas, the window's kernel (slots, error boundary, kit) | Plugin runtime |
| Plugins that run on the gateway's requests and replies | Gateway middleware |
| Tools that plugins give, offered to every agent as an MCP server | Plugin tools |
| Plugins that await context recall and observe completed replies | Asynchronous gateway request hooks |
| Claude subscription turns across Claude Code runs | Claude subscription bridge |
| How the gateway picks a provider, key or account, and falls back | Gateway routing and fallback |
| Gateway Session Aggregation | Gateway Session Aggregation |
| Connecting an agent's config to the gateway, drift, disconnect, WSL twins | Agent wiring |
| Providers, keys, subscription accounts, refresh and allowance | Providers and accounts |
| Instructions, MCP servers, skills and RTK written into agents | Library |
| One MCP server, magpie, given to every agent in place of the Library's servers | MCP hub |
Tray, panel, window, magpie web and the page's JSON API |
GUI app shell |
| Encrypted backups and setup synchronization over WebDAV, S3 or GitHub | Sync and backup |
A subsystem can span several packages or repositories. Its reference describes the behavior those parts provide together; it does not need to list every function.
Maintain a reference
Update the owning reference in the same PR when a change alters a documented responsibility, interface, state transition, runtime path, compatibility rule, or failure behavior. An internal refactor that preserves these contracts does not require a prose change.
Keep each fact in one reference and link to it from agent instructions or other pages. Link to source files and named symbols rather than copying implementation details that change frequently. Explain field meanings and constraints that signatures alone do not express.
For a new reference, include the responsibilities and boundaries, source of truth, main runtime paths, state transitions, important constraints, and existing verification commands. Include failure and compatibility behavior where relevant. Document current behavior separately from proposed changes; the proposal belongs in its issue or PR.
Describe a PR's semantic changes
For each affected subsystem, explain the observable change with its trigger and before/after behavior. Include changes to interfaces, state, compatibility, and failure behavior when relevant. Link the affected reference, implementation, and verification evidence. State when a refactor preserves the documented behavior.
For example, a change to plugin adoption should explain which migration state and account condition trigger it, which implementation handles requests before and after adoption, and which test exercises that transition.
This is an author-provided explanation that a reviewer verifies against the diff and surrounding code. It is not an automatically proven compatibility verdict.
Review a change
- Identify the affected subsystem and the actual runtime path, including plugin or built-in ownership.
- Compare the claimed before/after behavior with the base and head implementation. Trace relevant callers and state transitions beyond the changed lines.
- Check that changed contracts appear in the owning reference and that source links still resolve.
- Check that the cited tests or runtime evidence exercise the claimed behavior. Report checks that were not run.
A documentation update alone does not prove the implementation. Existing tests and runtime evidence remain necessary for behavior changes.