Bug Description
Plugin hooks (before_prompt_build, agent_end) registered by a custom plugin are not firing for the Feishu channel's main agent (embedded PI runtime), while the same hooks fire correctly for the heartbeat agent (hermes, harness runtime).
Environment: OpenClaw v2026.5.2 (commit 8b2a6e5), plugin memory-tencentdb v0.2.0
Platform: Feishu channel, main agent (embedded PI runtime selection-D1C7VClx.js)
Working correctly: Heartbeat agent hermes (harness runtime)
Steps to Reproduce
- Register a plugin with
before_prompt_build and agent_end hooks
- Configure the plugin for the Feishu channel and for the
main agent in openclaw.json
- Set
allowPromptInjection: true and allowConversationAccess: true in plugin config
- Send a message via Feishu → hooks do NOT fire
- Heartbeat cron runs →
agent_end hook does fire
Expected Behavior
Hooks should fire for the Feishu main agent, just as they do for the hermes agent.
Root Cause Analysis
- Plugin registration works: logs show hooks are registered with correct registry
- Hook runner IS initialized for the
hermes (harness) agent → hooks fire correctly
- For the
main agent (embedded PI runtime selection-D1C7VClx.js), the embedded runtime has an isRawModelRun guard (line 7697) and calls resolvePromptBuildHookResult at lines 8198/8224
- v2026.5.2 commit
8283c5d6 ("perf(plugins): reuse startup runtime registry") changed plugin scoping — likely caused the embedded PI runtime's hook bridging to fail to connect to the plugin registry
Likely related issues:
Plugin Config
{
"allowConversationAccess": true,
"allowPromptInjection": true
}
Channel and agent both include plugins: - "memory-tencentdb".
Additional Context
- Same plugin with same hooks works on
hermes agent (harness runtime) → plugin code is correct
allowPromptInjection: true does NOT fix the issue
- Problem appears specific to the embedded PI runtime (
selection-D1C7VClx.js) used by the main agent on Feishu
Bug Description
Plugin hooks (
before_prompt_build,agent_end) registered by a custom plugin are not firing for the Feishu channel'smainagent (embedded PI runtime), while the same hooks fire correctly for the heartbeat agent (hermes, harness runtime).Environment: OpenClaw v2026.5.2 (commit 8b2a6e5), plugin
memory-tencentdbv0.2.0Platform: Feishu channel,
mainagent (embedded PI runtimeselection-D1C7VClx.js)Working correctly: Heartbeat agent
hermes(harness runtime)Steps to Reproduce
before_prompt_buildandagent_endhooksmainagent inopenclaw.jsonallowPromptInjection: trueandallowConversationAccess: truein plugin configagent_endhook does fireExpected Behavior
Hooks should fire for the Feishu
mainagent, just as they do for thehermesagent.Root Cause Analysis
hermes(harness) agent → hooks fire correctlymainagent (embedded PI runtimeselection-D1C7VClx.js), the embedded runtime has anisRawModelRunguard (line 7697) and callsresolvePromptBuildHookResultat lines 8198/82248283c5d6("perf(plugins): reuse startup runtime registry") changed plugin scoping — likely caused the embedded PI runtime's hook bridging to fail to connect to the plugin registryLikely related issues:
agent_endnot firing)triggerInternalHookpath)Plugin Config
{ "allowConversationAccess": true, "allowPromptInjection": true }Channel and agent both include
plugins: - "memory-tencentdb".Additional Context
hermesagent (harness runtime) → plugin code is correctallowPromptInjection: truedoes NOT fix the issueselection-D1C7VClx.js) used by themainagent on Feishu