
























@@ -641,6 +641,35 @@ function Stop-OpenClawUpdateProcesses {
641641 }
642642}
643643644+function Remove-FuturePluginEntries {
645+ $configPath = Join-Path $env:USERPROFILE '.openclaw\openclaw.json'
646+ if (-not (Test-Path $configPath)) {
647+ return
648+ }
649+ try {
650+ $config = Get-Content $configPath -Raw | ConvertFrom-Json -AsHashtable
651+ } catch {
652+ return
653+ }
654+ $plugins = $config['plugins']
655+ if (-not ($plugins -is [hashtable])) {
656+ return
657+ }
658+ $entries = $plugins['entries']
659+ if ($entries -is [hashtable]) {
660+ foreach ($pluginId in @('feishu', 'whatsapp')) {
661+ if ($entries.ContainsKey($pluginId)) {
662+ $entries.Remove($pluginId)
663+ }
664+ }
665+ }
666+ $allow = $plugins['allow']
667+ if ($allow -is [array]) {
668+ $plugins['allow'] = @($allow | Where-Object { $_ -notin @('feishu', 'whatsapp') })
669+ }
670+ $config | ConvertTo-Json -Depth 100 | Set-Content -Path $configPath -Encoding UTF8
671+}
672+644673function Invoke-OpenClawUpdateWithTimeout {
645674 param(
646675 [Parameter(Mandatory = $true)][string]$OpenClawPath,
@@ -785,6 +814,7 @@ try {
785814 }
786815 Set-Item -Path ('Env:' + $ProviderKeyEnv) -Value $ProviderKey
787816 $openclaw = Join-Path $env:APPDATA 'npm\openclaw.cmd'
817+ Remove-FuturePluginEntries
788818 Stop-OpenClawGatewayProcesses
789819 Write-ProgressLog 'update.openclaw-update'
790820 Invoke-OpenClawUpdateWithTimeout -OpenClawPath $openclaw -UpdateTarget $UpdateTarget
@@ -1375,6 +1405,31 @@ if [ -z "\${$API_KEY_ENV:-}" ]; then
13751405 exit 1
13761406fi
13771407cd "\$HOME"
1408+scrub_future_plugin_entries() {
1409+ /opt/homebrew/bin/python3 - <<'PY' || true
1410+import json
1411+from pathlib import Path
1412+1413+config_path = Path.home() / ".openclaw" / "openclaw.json"
1414+if not config_path.exists():
1415+ raise SystemExit(0)
1416+try:
1417+ config = json.loads(config_path.read_text())
1418+except Exception:
1419+ raise SystemExit(0)
1420+plugins = config.get("plugins")
1421+if not isinstance(plugins, dict):
1422+ raise SystemExit(0)
1423+entries = plugins.get("entries")
1424+if isinstance(entries, dict):
1425+ for plugin_id in ("feishu", "whatsapp"):
1426+ entries.pop(plugin_id, None)
1427+allow = plugins.get("allow")
1428+if isinstance(allow, list):
1429+ plugins["allow"] = [plugin_id for plugin_id in allow if plugin_id not in {"feishu", "whatsapp"}]
1430+config_path.write_text(json.dumps(config, indent=2) + "\n")
1431+PY
1432+}
13781433stop_openclaw_gateway_processes() {
13791434 /opt/homebrew/bin/openclaw gateway stop >/dev/null 2>&1 || true
13801435 /usr/bin/pkill -9 -f openclaw-gateway || true
@@ -1386,6 +1441,7 @@ stop_openclaw_gateway_processes() {
13861441}
13871442# Stop the pre-update gateway before replacing the package. Otherwise the old
13881443# host can observe new plugin metadata mid-update and abort config validation.
1444+scrub_future_plugin_entries
13891445stop_openclaw_gateway_processes
13901446/opt/homebrew/bin/openclaw update --tag "$update_target" --yes --json
13911447# Same-guest npm upgrades can leave the old gateway process holding the old
@@ -1473,6 +1529,31 @@ run_linux_update() {
14731529set -euo pipefail
14741530export HOME=/root
14751531cd "\$HOME"
1532+scrub_future_plugin_entries() {
1533+ python3 - <<'PY' || true
1534+import json
1535+from pathlib import Path
1536+1537+config_path = Path.home() / ".openclaw" / "openclaw.json"
1538+if not config_path.exists():
1539+ raise SystemExit(0)
1540+try:
1541+ config = json.loads(config_path.read_text())
1542+except Exception:
1543+ raise SystemExit(0)
1544+plugins = config.get("plugins")
1545+if not isinstance(plugins, dict):
1546+ raise SystemExit(0)
1547+entries = plugins.get("entries")
1548+if isinstance(entries, dict):
1549+ for plugin_id in ("feishu", "whatsapp"):
1550+ entries.pop(plugin_id, None)
1551+allow = plugins.get("allow")
1552+if isinstance(allow, list):
1553+ plugins["allow"] = [plugin_id for plugin_id in allow if plugin_id not in {"feishu", "whatsapp"}]
1554+config_path.write_text(json.dumps(config, indent=2) + "\n")
1555+PY
1556+}
14761557stop_openclaw_gateway_processes() {
14771558 openclaw gateway stop >/dev/null 2>&1 || true
14781559 pkill -9 -f openclaw-gateway || true
@@ -1489,6 +1570,7 @@ stop_openclaw_gateway_processes() {
14891570}
14901571# Stop the pre-update manual gateway before replacing the package. Otherwise
14911572# the old host can observe new plugin metadata mid-update and abort validation.
1573+scrub_future_plugin_entries
14921574stop_openclaw_gateway_processes
14931575openclaw update --tag "$update_target" --yes --json
14941576# The fresh Linux lane starts a manual gateway; stop the old process before
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。