feat(openclaw-plugin): add hooks.allowPromptInjection config to all installation methods#763
feat(openclaw-plugin): add hooks.allowPromptInjection config to all installation methods#763KorenKrita wants to merge 1 commit intovolcengine:mainfrom
Conversation
…nstallation 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.
|
I noticed the new version of the OpenClaw plugin exists as a Context Plugin rather than a Memory Plugin, and the recommended configuration disables the Memory Slot. Does this mean that OpenClaw's built-in memory system can technically coexist with OpenViking as previously documented, but this coexistence is not recommended in the configuration? |
|
|
||
| # 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 |
There was a problem hiding this comment.
[Design] (blocking)
配置必要性无法验证:hooks.allowPromptInjection 在整个 OpenViking 代码库中完全不存在(包括插件源码、配置定义、文档、commit 历史)。
发现:
- 插件的
before_prompt_buildhook 在 index.ts:412 无条件注册,没有检查任何allowPromptInjection配置 - auto-recall 功能由
cfg.autoRecall控制(config.ts,默认 true),不依赖hooks.*配置 - 配置路径
plugins.entries.openviking.hooks.*不符合标准模式(通常是plugins.entries.<name>.config.*)
需要验证:
- 在没有这个配置的情况下,auto-recall 是否真的不工作?
- OpenClaw 框架是否确实需要这个配置?如果需要,请提供文档或源码引用
- 配置路径是否正确?
如果配置确实必要,需要在 OpenViking 文档中说明其作用和必要性。
| # 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 |
There was a problem hiding this comment.
[Design] (blocking)
同 install.sh:626 - 配置的必要性和正确性无法验证。整个 OpenViking 代码库中没有任何 allowPromptInjection 的引用,插件代码也不依赖此配置。
| 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) |
There was a problem hiding this comment.
[Design] (blocking)
同 install.sh:626 - 配置的必要性和正确性无法验证。建议先通过实际测试确认:在没有这个配置的情况下,auto-recall 功能是否真的无法工作?
|
|
||
| ```bash | ||
| openclaw plugins enable openviking | ||
| openclaw config set plugins.entries.openviking.hooks.allowPromptInjection true |
There was a problem hiding this comment.
[Design] (blocking)
同 install.sh:626 - 如果这个配置确实必要,需要在文档中添加说明:
- 为什么需要这个配置?
- 如果缺少会发生什么?
- OpenClaw 框架的哪个机制依赖它?
|
|
||
| ```bash | ||
| openclaw plugins enable openviking | ||
| openclaw config set plugins.entries.openviking.hooks.allowPromptInjection true |
There was a problem hiding this comment.
[Design] (blocking)
同 INSTALL.md:202 - 需要在文档中说明配置的作用。另外,建议在 Troubleshooting 章节添加相关内容,帮助用户理解这个配置。
|
cc @Mijamind719 |
Description
Add
hooks.allowPromptInjection: trueconfiguration to all OpenClaw plugin installation methods to enable the auto-recall feature.Related Issue
Type of Change
Changes Made
hooks.allowPromptInjection: trueconfig toinstall.shscripthooks.allowPromptInjection: trueconfig toinstall.ps1scripthooks.allowPromptInjection: trueconfig tosetup-helper/install.jsREADME.mdINSTALL.mdTesting
Checklist
Screenshots (if applicable)
Additional Notes
The
hooks.allowPromptInjectionconfiguration is required for the auto-recall feature to work properly via thebefore_prompt_buildhook. Withoutthis setting, the plugin cannot inject recalled memories into the prompt.
From the code analysis, the auto-recall feature depends on the
before_prompt_buildhook to inject recalled memories into prompts. This hook only works whenhooks.allowPromptInjectionis explicitly set totruein the plugin configuration.I've added this configuration to all installation methods (install.sh, install.ps1, setup-helper/install.js) and updated the manual setup documentation accordingly.
However, I'm not entirely familiar with the OpenClaw context plugin's runtime logic and hook execution flow. Could @Mijamind719 @qin-ctx please review whether:
Thanks in advance for the review!