Bug
In reply-DpTyb3Hh.js, the agent_end hook extracts agentId incorrectly:
agentId: params.sessionKey?.split(":")[0] ?? "main",
Session keys follow the format agent:<agentId>:main, so split(":")[0] always returns "agent" instead of the actual agent ID.
Expected
"agent:mao:main".split(":")[1] → "mao"
"agent:forge:main".split(":")[1] → "forge"
Actual
"agent:mao:main".split(":")[0] → "agent" (wrong)
Impact
Memory plugins (e.g. memory-lancedb-pro) that use ctx.agentId from agent_end events cannot correctly scope auto-captured memories per agent. In a multi-agent setup, only the main agent gets auto-capture working correctly because the plugin falls back to ctx?.agentId || "main".
Additionally, it appears agent_end may not fire at all for secondary agents (mao, forge) — only for the main agent. This could be a separate issue with how hookRunner is passed to reply handlers for non-default agents.
Environment
- OpenClaw 2026.3.2
- memory-lancedb-pro 1.1.0-beta.3
- Multi-agent setup with 3 agents (main, mao, forge)
Fix suggestion
// Extract agentId correctly from session key format "agent:<id>:<session>"
agentId: params.sessionKey?.startsWith("agent:")
? params.sessionKey.split(":")[1]
: "main",
Bug
In
reply-DpTyb3Hh.js, theagent_endhook extractsagentIdincorrectly:Session keys follow the format
agent:<agentId>:main, sosplit(":")[0]always returns"agent"instead of the actual agent ID.Expected
"agent:mao:main".split(":")[1]→"mao""agent:forge:main".split(":")[1]→"forge"Actual
"agent:mao:main".split(":")[0]→"agent"(wrong)Impact
Memory plugins (e.g.
memory-lancedb-pro) that usectx.agentIdfromagent_endevents cannot correctly scope auto-captured memories per agent. In a multi-agent setup, only the main agent gets auto-capture working correctly because the plugin falls back toctx?.agentId || "main".Additionally, it appears
agent_endmay not fire at all for secondary agents (mao, forge) — only for the main agent. This could be a separate issue with how hookRunner is passed to reply handlers for non-default agents.Environment
Fix suggestion