Files
magpie/docs/subsystems
yetone c8290df259 provider: Devin's Adaptive and Fusion picks are no longer served
The live gateway's /v1/models listed devin/Adaptive and devin/adaptive,
and Devin answered both with 502 "no API providers are available".
They came from magpie, not the plugin: the plugin's list (and its cached
copy in plugin-providers.json) has neither, since parseFamilies and
parseConfigFamilies skip Adaptive and Fusion. The owner's providers.json
keeps "Adaptive" and "adaptive" in the devin entry's picks (models), saved
when the built-in still listed Devin's router families, before ce8d0e065
served Devin's chat API. A pick only leaves Models when a list that had it
stops having it (dropGonePicks), and no list fetched since ever had these,
so after the move to the plugin they were served as picks of the user's
own (Exposed's unlisted picks) and offered to every agent.

normalize now reads a devin provider's Models and Delisted without
Adaptive and Fusion, in any case (devinRouter, withoutDevinRouters, which
devinModelsFlatten now uses too). Every reader that goes through All
(the gateway's /v1/models, the agents' lists, the editor's Picks) sees
them gone, so old files are fixed for every user on read; the next Save
writes the file without them, and a save that sends one back drops it.
Scoped to provider id devin: another provider's "adaptive" is its own.

Not changed: AccountModels (an account's own list only narrows what it
serves; dropping a lone "adaptive" there would widen it to every model),
Fallback ("devin/adaptive" as another provider's fallback is still tried
and refused) and settings.json's hiddenModels/picked lists (they hide or
pick, never add a model). PickedFrom keeps them, which only means "listed
then". The plugin needs no change.

Run:
- TestDevinRouterPicksNotServed (new): a sandbox HOME with the owner's
  devin entry as written, the plugin moved and its list cached. Red on
  the old provider.go: "served [Adaptive adaptive swe-2 claude-opus-5-5
  Fusion fusion], want [swe-2 claude-opus-5-5]"; green with the change.
- Real data: magpie built at a83fe2325 and at this change (-tags nogui,
  on mica), `magpie models` under a sandbox HOME holding copies of the
  owner's devin entry from providers.json, plugins.json, plugin-auth.json,
  migrations.json and plugin-providers.json. Old: devin/Adaptive and
  devin/adaptive first under Devin, as the live gateway lists them. New:
  the list starts at devin/swe-2, the rest unchanged.
- Full suite on mica through suite.lock at 3b164fafb (this change on
  a83fe2325): gofmt -l empty, go vet ./..., GOOS=linux go vet -tags nogui
  ./..., GOOS=windows go vet ./..., go build for darwin, linux (nogui) and
  windows, go test -tags nogui -count=1 -timeout 45m ./...: suite exit 0,
  99 packages ok, no FAIL.
- Rebased onto dc85a7ca5 (56 files changed upstream, b76016676 in
  internal/provider): gofmt, vet (darwin, linux, windows) and
  internal/provider's tests again there: vet-ok, ok internal/provider 156s.
  Then rebased once more onto 74c94b5db and e36541ddf (internal/gui
  appearance and site/ only, not re-run).

Not tried: a request through a real gateway, since the requests that
still go (devin/swe-2 and the rest) take no path this change touches.
2026-11-14 12:25:28 +08:00
..
2026-11-10 03:25:44 +08:00

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 router
Memory shared by every agent: the memory MCP server, the digest in instructions, the Memory tab Memory
One skill, magpie-skills, listing the Library's skills in place of each agent's own Skill router
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

  1. Identify the affected subsystem and the actual runtime path, including plugin or built-in ownership.
  2. Compare the claimed before/after behavior with the base and head implementation. Trace relevant callers and state transitions beyond the changed lines.
  3. Check that changed contracts appear in the owning reference and that source links still resolve.
  4. 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.