Skip to content

Bug: Bundled hooks missing handler.ts files in dist/hooks/bundled/ #10897

@smoky96

Description

@smoky96

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

  1. Install OpenClaw globally: npm install -g openclaw
  2. Enable bundled hooks in config:
    {
      "hooks": {
        "internal": {
          "enabled": true,
          "entries": {
            "session-memory": { "enabled": true },
            "command-logger": { "enabled": true }
          }
        }
      }
    }
  3. Restart Gateway
  4. 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.md

Only HOOK.md exists. handler.ts is missing.

All bundled hooks have the same issue:

  • session-memory/: Only HOOK.md
  • command-logger/: Only HOOK.md
  • boot-md/: Only HOOK.md
  • soul-evil/: Only HOOK.md

Workaround

Users can manually create the hooks in ~/.openclaw/hooks/ using the source code from the GitHub repository:

  1. Fetch handler.ts from GitHub:

  2. Create managed hooks:

    mkdir -p ~/.openclaw/hooks/session-memory ~/.openclaw/hooks/command-logger
    # Copy handler.ts and HOOK.md to each directory
  3. 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


Reported by: OpenClaw user via automated assistant

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions