Home-managed node loops "installed but not loaded" forever when Home adds a new plugin at runtime
On a node attached to CLIProxyAPI Home, adding a plugin through Home's config (a store
manifest under plugins.configs.<id>) while the node is running puts the node into an endless
retry loop:
[warn] [service_home.go:680] failed to stage home config; retrying error=load home plugins: home plugins: plugin <id> installed but not loadedseveral times a second, forever. The node keeps serving on its previous config but can no longer
apply any config from Home. Seen on 7.3.16 (c404af96) on five macOS arm64 nodes; the code is the
same on v8.0.4.
Cause: in stageHomeOverlayWithClient (sdk/cliproxy/service_home.go), the plugin is downloaded
and installed, then homeplugins.MarkLoadResults(&report, s.pluginHost) checks
pluginHost.PluginRegistered(id) before the staged config is applied
(applyConfigUpdateWithAuthSynthesis runs later, when the work is committed). The plugin host only
loads plugins when a config is applied, so a newly added plugin can never be registered at that
point and staging always fails. runHomeConfigWorkerWithSupervisor then retries the same payload
and never dequeues a newer one, so removing the plugin from Home's config does not recover the
node either.
The startup path is ordered correctly (cmd/server/main.go: pluginHost.ApplyConfig then
MarkLoadResults), so restarting the node recovers it and the plugin loads. Workaround used: a
restart in place of every node after installing a plugin through Home.
Suggested fix: on the hot path, check load results after the config (and so the plugin host) has
been applied, or have the sync step ask the plugin host to load newly installed plugins before
MarkLoadResults.
Source: router-for-me/CLIProxyAPI