From a177150554755a914b87d5b7fadc1f5dca11016c Mon Sep 17 00:00:00 2001 From: zhi Date: Tue, 3 Mar 2026 18:20:48 +0000 Subject: [PATCH] fix(install): uninstall always deletes plugin entry - For uninstall, always delete plugins.entries.dirigent - Don't try to restore old config (which may fail validation due to missing required fields) - Provider restoration still works (replaced providers are restored) --- scripts/install-dirigent-openclaw.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install-dirigent-openclaw.mjs b/scripts/install-dirigent-openclaw.mjs index 2623702..149f6fa 100755 --- a/scripts/install-dirigent-openclaw.mjs +++ b/scripts/install-dirigent-openclaw.mjs @@ -318,13 +318,14 @@ else { } } - // ── Handle REPLACED entries: restore old value ──────────────────────── + // ── Handle REPLACED entries: for uninstall, we still delete (not restore) + // because the user wants to remove the plugin, not restore the old broken config if (delta.replaced[PATH_PLUGIN_ENTRY] !== undefined) { const plugins = getJson("plugins") || {}; plugins.entries = plugins.entries || {}; - plugins.entries.dirigent = delta.replaced[PATH_PLUGIN_ENTRY]; + delete plugins.entries.dirigent; setJson("plugins", plugins); - console.log("[dirigent] restored previous plugins.entries.dirigent"); + console.log("[dirigent] removed plugins.entries.dirigent (had replaced previous config)"); } if (delta.replaced[PATH_PROVIDER_ENTRY] !== undefined) {