-
-
Notifications
You must be signed in to change notification settings - Fork 54.5k
Description
Bug: Bundled hooks missing handler.ts files in dist/hooks/bundled/
Summary
The bundled hooks (session-memory, command-logger, boot-md, soul-evil) are not functioning because their handler.ts files are missing from the dist/hooks/bundled/ directory in the npm package. Only HOOK.md metadata files are present.
Environment
- OpenClaw Version: 2026.2.3-1
- Installation Method: npm (
npm install -g openclaw) - OS: Linux (Ubuntu 22.04)
Steps to Reproduce
- Install OpenClaw globally:
npm install -g openclaw - Enable bundled hooks in config:
{ "hooks": { "internal": { "enabled": true, "entries": { "session-memory": { "enabled": true }, "command-logger": { "enabled": true } } } } } - Restart Gateway
- Run:
openclaw hooks list
Expected Behavior
The bundled hooks should be discovered and listed:
💾 session-memory → command:new
📝 command-logger → command
🚀 boot-md → gateway:startup
😈 soul-evil → agent:bootstrap
Actual Behavior
Hooks are not found:
[plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes
[plugins] feishu_wiki: Registered feishu_wiki tool
[plugins] feishu_drive: Registered feishu_drive tool
[plugins] feishu_bitable: Registered 6 bitable tools
No hooks found.
Root Cause Analysis
Checking the dist/hooks/bundled/ directory:
ls -la /usr/lib/node_modules/openclaw/dist/hooks/bundled/session-memory/
# Output:
# total 12
# drwxr-xr-x 2 root root 4096 Feb 7 00:07 .
# drwxr-xr-x 6 root root 4096 Feb 7 00:07 ..
# -rw-r--r-- 1 root root 2856 Feb 7 00:07 HOOK.mdOnly HOOK.md exists. handler.ts is missing.
All bundled hooks have the same issue:
session-memory/: OnlyHOOK.mdcommand-logger/: OnlyHOOK.mdboot-md/: OnlyHOOK.mdsoul-evil/: OnlyHOOK.md
Workaround
Users can manually create the hooks in ~/.openclaw/hooks/ using the source code from the GitHub repository:
-
Fetch handler.ts from GitHub:
-
Create managed hooks:
mkdir -p ~/.openclaw/hooks/session-memory ~/.openclaw/hooks/command-logger # Copy handler.ts and HOOK.md to each directory
-
Restart Gateway
Proposed Fix
The build/packaging process should include the handler.ts (or compiled handler.js) files in the dist/hooks/bundled/ directory alongside the HOOK.md files.
Alternatively, if the handlers are meant to be compiled into the main bundle, the hook discovery mechanism should be updated to find them there.
Related
- Documentation: https://docs.openclaw.ai/hooks
- Source code: https://github.com/openclaw/openclaw/tree/main/src/hooks/bundled
Reported by: OpenClaw user via automated assistant