A default plugin install that keeps failing (offline, a refused clone) was repeated by its own
coordinator whenever a CLI process booted during the pass: each boot step re-requested the pass
before the failure backoff was recorded, and install_and_record looped while requests kept arriving
(13 clone attempts per plugin in 76 s at one config write a second).
- install_and_record holds the installer lock for its whole loop and records the backoff (or the
settled revision) before releasing it; a failed pass is never repeated in the loop.
- spawn_install reads whether a pass is in flight (the lock holder's pid stamp) and then neither
re-requests nor spawns; only a new profile (spawn_install(home)) is a rescan request.
A gateway start whose profile owes platform plugins waited for the other installer's whole pass
(up to five minutes per row) before serving anything (Docker: ~70 s before api_server answered).
It now waits one budget of 30 s in all (every row and home of the start share it), then serves the
ready platforms; the plugin is served once installed (live where the running gateway applies it,
else at the next start).
Tests (real processes, red on 22dea1f5a9cb): boots during a failing pass never repeat it; a gateway
start waits one bounded budget for another installer.
The publication guard compared every home's whole config.yaml, so a key outside the
plugin selection written during the dependency build (the dashboard's metrics prompt
answered while the default qqbot install ran) refused the enable and left the plugin
installed but disabled. The guard now compares only what the selection and build read
(the plugins section and memory.provider) and re-applies the change to the file as it
is at publish time, so the other key survives; a change to the selection still refuses.
The refusal is typed (SelectionChanged -> SelectionRaced), the install-and-enable path
retries it on a re-read selection (bounded), a raced default install is owed without
the hour backoff, and a left-core install whose enable was refused is owed (its tree no
longer counts as installed) so the next start enables it.
The detached default-plugin child and a gateway start's left-core migration raced in one home: the
start installed while the child's tree landed and recorded "Plugin already exists" as its own failure
(failure stamp, later starts skipped the row, a misleading "could not be installed" notice).
- Left-core installs hold the default-plugin installer lock (default_plugins.installer_lock) and
re-check the home after taking it; a plugin another installer placed meanwhile is recorded, not
reinstalled. A lock still held past the wait is reported, never stamped as a failure.
- One automatic install per plugin and home by either installer: _pending skips the install (not the
scope conversion) of a plugin recorded under _default_plugins_installed, and the default installer
treats _left_core_installed as its own record (the seam the platform slate PRs each carried).
- A gateway start retries inside the failure backoff (the user restarting the gateway after the
network came back sat out the backoff in silence); agent starts keep it.
- A start that already tried a home tries again in that process once its .env or config.yaml changed,
so credentials added to a served profile after boot install its platform on the rescan.
- Gateway start installs a default (official/verified) catalog platform plugin whose requires_env the
profile has, and names `hermes plugins install <name>` for any other catalog platform entry.
- Notices for a default plugin no longer tell a user who never ran the core feature it "moved out of
core"; the agent-start restart hint is printed only when the running gateway did not pick the
platform up after a reload-plugins nudge.
- @BearHuddleston (ff772238): passing the pass's pin as an explicit ref
recorded the install as a user's `--ref` hold (pinned, empty catalog
pin) whenever the home's catalog cache named an older pin, so the
auto-updater and `plugins update --all` skipped it for good. The
install now runs at the home's own catalog pin, with no ref. His two
real-git tests are added (the held-ref one is red under an explicit
ref; the re-pin / annotated-tag retry one covers the replacement).
- Greptile (c346fdbf): the retry removed our leftover tree and, when the
next install then failed before publishing (offline), the remaining
placed marker made the next pass read the missing tree as the user's
removal and stop. The marker is now cleared when we discard the tree.
Test drives the real remove path: refused enable, retry that removes
and fails offline, next pass still retries.
- The leftover is removed inside _install_into's existing home binding
(discard=), and the install stays unforced, so another plugin already
at the destination is never overwritten (real-installer probe: the
user's plugin and its files survive, the default stays owed).
Co-authored-by: BearHuddleston <bear@bearhuddleston.dev>
Greptile on ff772238: force=True replaced whatever sat at the install
destination, so a re-pin that changed the manifest name could overwrite
another (user-installed or disabled) plugin there. The retry now removes
exactly the leftover dir this home's failed attempt left (the shared
remove path, metadata included) and runs a normal unforced install,
which refuses an occupied destination. Probed with the real installer:
the leftover is gone, the user's plugin at the destination is untouched,
and the install reports "already exists".
Greptile on 8c579d52:
- fetch_policy separates "allow_lazy_installs is off" (skip, never owed)
from "config could not be read" (fetch nothing, but keep the home owed),
so a repaired file or permission is picked up within the revision
instead of the home being dropped from the pass that marks it settled.
- A tree an earlier automatic attempt left behind (still in neither
plugins.enabled nor plugins.disabled, and stamped by that attempt) is
reinstalled with force at the current pin. Before, a re-pin between
attempts made the reuse path reject the old tree and the fresh install
stop at "already exists" on every retry. Trees the user installed,
enabled or disabled never reach this call (_settled).
@BearHuddleston's re-review on e7f974c0:
- spawn_install clears the settled marker before the backoff check, so
a new profile's first boot that runs while its detached install is
still going stays owed instead of closing for the revision. His test
also pins the offline-owed pass, the tier recheck, the platform gate
and the failed-pass unlink (red without the queue-time unlink).
- _run_child logs and stamps the backoff on any error, not only lock
contention: a detached child has no stderr, so a crash was silent and
every later boot spawned another one.
Co-authored-by: BearHuddleston <bear@bearhuddleston.dev>
Greptile review on 0544e6a0:
- One coordinator: the update tail and the detached child both run
install_and_record, which rescans until no request arrived during the
pass before marking the revision settled. A profile created during a
foreground update no longer loses its defaults.
- A plugin installed under an older record shape (top-level
catalog_name) and another dir name is recognised, so a user's disable
of it is honoured instead of re-enabled.
- A tree a refused enable left, which the user then removes, counts as
their removal (a per-home placed marker), never a fresh install.
- Each home installs at the pin selected for the whole pass (ref passed
through _install_into) instead of re-resolving its own catalog cache.
- An expired offline cache (entries dropped) counts as offline: the pass
stays owed.
- Windows: a job object that forbids breakaway retries the spawn
without it, as spawn_commit_graph_refresh does.
_record rewrote the whole config.yaml from its own read, so an edit
another process made in between (a running gateway in another profile,
the user) was reverted. Existing files now get only the marker key set
(write_config_key re-reads as it writes). Found by @kshitijk4poor.
- A tree a refused enable left behind is retried only when this home's
own automatic attempt left it (per-home, per-plugin failure stamp);
a tree the user installed by hand, or one they enabled/disabled since,
stays theirs. Regression test from @BearHuddleston's review patch.
- An owed boot step whose retry raises stays owed (kshitijk4poor).
- An offline pass (live catalog unreadable) still installs the in-tree
defaults but stays owed, so a default added to the live catalog after
this release lands on a later boot (kshitijk4poor).
- default_entries rechecks the tier (the live/in-tree merge can carry
default onto a community entry) and reuses the install gate's own
platform/version verdict instead of a copy of it.
- A failed pass clears the settled marker, so a later failure (a
profile created after the revision settled) is retried too.
- Docstring: one failure stamp, not per plugin.
Co-authored-by: BearHuddleston <bear@bearhuddleston.dev>
Independent review of the first head found four problems; all fixed here:
- The boot step bound a whole profile scope to read allow_lazy_installs,
which froze the launch env snapshot before boot had bridged config into
it. fetch_allowed now reads the home's config (managed overlay applied)
without binding anything.
- A default whose enable was refused (unresolvable deps) left its tree on
disk; the next run saw the directory and recorded it as done, disabled
for good. A home now counts a default as settled only when it is in
plugins.enabled or plugins.disabled; otherwise the install runs again
and reuses the tree.
- Profile creation ran git clones and dependency installs inline, past
Desktop's 30 s create budget. It now starts the detached installer and
returns.
- First-start installs ran inside the boot lock and the gateway startup
watchdog. The boot step now only checks a settled marker for this
revision and, if not settled, starts the detached installer (one at a
time per machine, an OS lock the kernel frees with its holder; a request
made while one runs is picked up when it finishes). A failed boot step
stays owed instead of waiting for the next revision.
The install/update tail still installs in the foreground, under the same
lock, and marks the revision settled so its first boot spawns nothing.
A catalog entry at tier official or verified can now set `default: true`.
Every Hermes home then gets it installed at its catalog pin and enabled,
once:
- at the end of every source install and `hermes update` (the shared
maintenance tail install.sh / install.ps1 / the updater all run), for
every profile home;
- on first start, through the boot bootstrap, for installs that never run
that tail (bundled Desktop payload, Docker, Nix, Termux); a failed fetch
stays owed and is retried on later starts behind an hour-to-a-week
backoff checked before any network;
- when a profile is created.
Each home records what it got in `_default_plugins_installed` (the way the
left-core migrator records its one-time install), so a user who removes or
disables a default plugin keeps that choice through later updates. Homes
with security.allow_lazy_installs off fetch nothing. The parser ignores
`default` on community entries and the catalog validator refuses it.
Lane B1.12 (default plugins installed and enabled from the catalog).