fix: hot reload plugin management changes (#75976)

Summary:
- The PR changes Gateway reload planning, CLI plugin install-index writes, plugin runtime/cache cleanup, docs, changelog, and tests so plugin enable/disable hot reloads while install/update/uninstall stay restart-backed.
- Reproducibility: yes. The earlier blocker has a source-level reproduction: run an external plugin install/up ...  watches config and only the managed plugin index changes; the PR now tests that path and queues a restart.

ClawSweeper fixups:
- Included follow-up commit: fix: hot reload plugin management changes
- Included follow-up commit: fix(clawsweeper): address review for automerge-openclaw-openclaw-7597…
- Ran the ClawSweeper repair loop before final review.

Validation:
- ClawSweeper review passed for head 860594f722.
- Required merge gates passed before the squash merge.

Prepared head SHA: 860594f722
Review: https://github.com/openclaw/openclaw/pull/75976#issuecomment-4363168379

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-05-02 14:19:24 +01:00
committed by GitHub
parent c9fa7b61f1
commit d678bcfcc7
31 changed files with 958 additions and 50 deletions

View File

@@ -78,6 +78,7 @@ describe("commitConfigWithPendingPluginInstalls", () => {
},
baseHash: "config-1",
writeOptions: {
afterWrite: { mode: "restart", reason: "plugin source changed" },
unsetPaths: [["plugins", "installs"]],
},
});
@@ -97,6 +98,33 @@ describe("commitConfigWithPendingPluginInstalls", () => {
});
});
it("does not add restart intent when pending records match the plugin index", async () => {
const existingRecords: Record<string, PluginInstallRecord> = {
demo: {
source: "npm",
spec: "demo@1.0.0",
},
};
mocks.loadInstalledPluginIndexInstallRecords.mockResolvedValue(existingRecords);
await commitConfigWithPendingPluginInstalls({
nextConfig: {
plugins: {
installs: existingRecords,
},
},
baseHash: "config-1",
});
expect(mocks.replaceConfigFile).toHaveBeenCalledWith({
nextConfig: {},
baseHash: "config-1",
writeOptions: {
unsetPaths: [["plugins", "installs"]],
},
});
});
it("rolls back plugin index writes when the config write fails", async () => {
const existingRecords: Record<string, PluginInstallRecord> = {
existing: {