Each Hermes bot is a profile at <root>/profiles/<name>/ whose config.yaml
is read on its own (hermes_cli/config.py get_config_path; load_config
doesn't fall back to the root's). magpie wrote providers.magpie only into
$HERMES_HOME/config.yaml, so only the main bot's picker offered magpie.
Now, with magpie connected, its provider entry also goes into the
config.yaml of every profile Hermes lists (hermes_cli/profiles.py and
hermes_constants.py, Hermes be5e9f72c): a name matching PROFILE_ID_RE,
not "default", not tombstoned under profiles/.deleted/, with a config.yaml.
The root follows get_default_hermes_root: ~/.hermes, or for a HERMES_HOME
outside it, <root> of <root>/profiles/<name>, else HERMES_HOME itself.
Connecting writes it there, and each Sync refreshes it and adds it to
profiles made later. Only providers.magpie is written, so each bot's own
model.default/model.provider stays as its user set them. Disconnect deletes
providers.magpie from every profile. In a profile whose model.provider is
magpie (cloned from a connected main config, or picked in that bot), the
model and provider are deleted too, so the profile isn't left naming a
provider that is gone. There's no stash for those, so Hermes falls back to
its defaults there.
Run: go test ./... -count=1 under a scratchpad HOME (all ok); gofmt -l; go
vet ./internal/agent for darwin, linux and windows. TestHermesProfiles and
TestHermesProfilesOfCustomRoot fail on the old hermes.go ("coder after
connect"). Fixtures follow Hermes's profile layout, read from its source.
Not tried with a real Hermes running several bots; the live ~/.hermes was
not touched and hermes was not run.