Files
magpie/docs
yetone 0a6cccc3ff groups: a found group the user changed takes in a new provider with its model
Kxsg79bEYFP4 on X: magpie found auto/deepseek-v4.1-flash over two
providers, the user changed the group, then added a third provider (a
plugin's) with the model, and it never joined.

Cause: SaveGroup stores a changed found group under its auto-… id with
the members it had then, and buildGroupsIn skips the found group of
that id ("the user changed it: theirs now"). Nothing recorded which of
the found models the user had taken out, so a stored group could only
stay frozen. Plugin providers, id spelling and a one-time creation were
ruled out: a plugin's models are in providerEntries like any provider's,
and the found group itself has all three.

Fix: SaveGroup stores Group.Seen for an auto-… id: the models magpie
found in it by that save plus those the user names. Reading a changed
found group (joined) appends the found members it neither names nor has
seen, after the user's own. A model the user took out was seen and stays
out (magpie's default never overrides the user's value); a provider kept
out of found groups (AutoGroupSkip) doesn't join; with found groups off
nothing joins. Seen follows a provider's rename/SetModelID
(mapModelRefs) and a fold, and ShareGroup leaves it behind. A group
changed before this (no Seen) takes in nothing, since nothing says what
the user took out; its next save sees what is found then, and providers
added after that join. docs/subsystems/providers-accounts.md says so.

Tests: TestChangedFoundGroupTakesInANewProvider (join, order, routed by
FindGroup, the user's name/routing kept, taken out stays out before and
after joining, rename, skip, share), TestChangedFoundGroupFromBefore-
KeepsItsMembers (old stored group), TestChangedFoundGroupTakesInA-
PluginProvider (the reporter's surface: the fake plugin under real Bun).

Run on mote at base f280b12e5 plus this change:
- gofmt -l: clean
- GOOS=windows go vet ./...: ok; GOOS=linux go vet -tags nogui ./...: ok
- go test -tags nogui -count=1 -timeout 45m ./internal/provider/
  ./internal/cli/ ./internal/gui/ ./internal/tui/ ./internal/agent/
  ./internal/gateway/: all ok (provider 214s, cli 86s, gui 127s, tui 23s,
  agent 372s, gateway 876s)

Broken by hand (each red, then restored):
- joined returning g unchanged (the old behaviour): all three new tests red
- dropping the Seen check and the legacy no-Seen guard: c came back at
  once, and the pre-Seen group took c in
- not mapping Seen in mapModelRefs: c came back as cee/… after Rename
- not clearing Seen in ShareGroup: the shared text carried it

Not tried: a real magpie with the reporter's providers; the GUI suite
(app.js is unchanged, /api/groups only gains a "seen" field); an editor
opened before a provider was added and saved after it treats that
provider as taken out.
2026-11-04 23:28:23 +08:00
..