From ba47c7c3b8add80cf205a1b25d1a862fba74be4d Mon Sep 17 00:00:00 2001 From: KorenKrita Date: Thu, 19 Mar 2026 13:36:53 +0800 Subject: [PATCH] feat(openclaw-plugin): add hooks.allowPromptInjection config to all installation methods Add hooks.allowPromptInjection: true configuration to all OpenClaw plugin installation methods (install.sh, install.ps1, setup-helper/install.js, README.md, and INSTALL.md). This configuration is required for the auto-recall feature to work properly via the before_prompt_build hook. --- examples/openclaw-plugin/INSTALL.md | 1 + examples/openclaw-plugin/README.md | 1 + examples/openclaw-plugin/install.ps1 | 1 + examples/openclaw-plugin/install.sh | 1 + examples/openclaw-plugin/setup-helper/install.js | 3 +++ 5 files changed, 7 insertions(+) diff --git a/examples/openclaw-plugin/INSTALL.md b/examples/openclaw-plugin/INSTALL.md index 0f840826..38bcb861 100644 --- a/examples/openclaw-plugin/INSTALL.md +++ b/examples/openclaw-plugin/INSTALL.md @@ -199,6 +199,7 @@ openclaw status ```bash openclaw plugins enable openviking +openclaw config set plugins.entries.openviking.hooks.allowPromptInjection true openclaw config set gateway.mode local openclaw config set plugins.slots.contextEngine openviking openclaw config set plugins.entries.openviking.config.mode remote diff --git a/examples/openclaw-plugin/README.md b/examples/openclaw-plugin/README.md index 6feee23c..af09b189 100644 --- a/examples/openclaw-plugin/README.md +++ b/examples/openclaw-plugin/README.md @@ -239,6 +239,7 @@ curl -X POST http://localhost:1933/api/v1/admin/accounts/my-team/users \ ```bash openclaw plugins enable openviking +openclaw config set plugins.entries.openviking.hooks.allowPromptInjection true openclaw config set gateway.mode local openclaw config set plugins.slots.contextEngine openviking openclaw config set plugins.entries.openviking.config.mode remote diff --git a/examples/openclaw-plugin/install.ps1 b/examples/openclaw-plugin/install.ps1 index f7e84434..22558a3d 100644 --- a/examples/openclaw-plugin/install.ps1 +++ b/examples/openclaw-plugin/install.ps1 @@ -377,6 +377,7 @@ function Configure-OpenClawPlugin { # Enable plugin (files already deployed to extensions dir by Deploy-Plugin) openclaw plugins enable openviking if ($LASTEXITCODE -ne 0) { throw "openclaw plugins enable failed (exit code $LASTEXITCODE)" } + openclaw config set plugins.entries.openviking.hooks.allowPromptInjection true openclaw config set plugins.slots.contextEngine openviking # Set gateway mode diff --git a/examples/openclaw-plugin/install.sh b/examples/openclaw-plugin/install.sh index 425d7686..16ff3319 100755 --- a/examples/openclaw-plugin/install.sh +++ b/examples/openclaw-plugin/install.sh @@ -623,6 +623,7 @@ configure_openclaw_plugin() { # Enable plugin (files already deployed to extensions dir by deploy_plugin) "${oc_env[@]}" openclaw plugins enable openviking || { err "$(tr "openclaw plugins enable failed" "openclaw 插件启用失败")"; exit 1; } + "${oc_env[@]}" openclaw config set plugins.entries.openviking.hooks.allowPromptInjection true "${oc_env[@]}" openclaw config set plugins.slots.contextEngine openviking # Set gateway mode diff --git a/examples/openclaw-plugin/setup-helper/install.js b/examples/openclaw-plugin/setup-helper/install.js index 719595fd..676af2ec 100644 --- a/examples/openclaw-plugin/setup-helper/install.js +++ b/examples/openclaw-plugin/setup-helper/install.js @@ -654,6 +654,9 @@ async function configureOpenClawPlugin(pluginPath = PLUGIN_DEST) { if (enableResult.code !== 0) throw new Error(`openclaw plugins enable failed (exit code ${enableResult.code})`); await oc(["config", "set", "plugins.slots.contextEngine", "openviking"]); + // Enable prompt injection hooks (required for auto-recall feature) + await oc(["config", "set", "plugins.entries.openviking.hooks.allowPromptInjection", "true"]); + // Set gateway mode await oc(["config", "set", "gateway.mode", "local"]);