Files
magpie/docs
yetone cfd49e36ae remote quotas: a Remote's cards follow its enabled models, one reading per account, loops dropped (748975219 on X)
A Remote magpie's quota cards ignored which models the Remote has enabled,
so providers it does not serve (Kiro, Codex) showed up, and an A to B to C
to A cycle grew paths like remote-B/remote-C/remote-A/remote-B/remote-C/kiro
with snapshots hours apart. catalog.Self() is random per run, so after a
restart the stale copies in other caches no longer looked like ours.

- catalog.loops: a magpie id repeated inside one Via is a loop, restart-proof.
- namedRemoteCards keeps only cards whose provider head is among the
  Remote's exposed model heads (none served: none; no list: all).
- CachedCards and RemoteCards keep one card per subscription account
  (kind, leaf provider, user): the newest complete reading, then the
  shorter path. Key plan and balance cards are not merged.
- keepRemoteCards evicts looped copies before caching.
- TestRemoteChainPassesOnCards: magpie3 now knows magpie2 alone, as the
  same account by two paths is shown once.

Run (WSL, magpie-desktop): gofmt -l clean, go vet linux and windows,
go test internal/catalog and internal/provider ok, gateway Remote/Quota
subset ok. Broken by hand: no enabled-model filter, no dedupe and no
repeated-id rule each turn TestRemoteCardsFollowEnabledModelsAndDedupe or
TestLoopsOnARepeatedMagpie red.
Not tried: a real A to B to C to A cycle in sandbox HOMEs (fake peer in
test), the GUI suite, win-run, the Usage page's own-versus-remote copies.
2026-11-11 14:50:03 +08:00
..