mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:20:42 +00:00
perf: defer unconfigured gateway hooks
This commit is contained in:
@@ -8,7 +8,7 @@ title: "Hooks"
|
||||
|
||||
# Hooks
|
||||
|
||||
Hooks are small scripts that run when something happens inside the Gateway. They are automatically discovered from directories and can be inspected with `openclaw hooks`.
|
||||
Hooks are small scripts that run when something happens inside the Gateway. They can be discovered from directories and inspected with `openclaw hooks`. The Gateway loads internal hooks only after you enable hooks or configure at least one hook entry, hook pack, legacy handler, or extra hook directory.
|
||||
|
||||
There are two kinds of hooks in OpenClaw:
|
||||
|
||||
@@ -139,6 +139,8 @@ Hooks are discovered from these directories, in order of increasing override pre
|
||||
|
||||
Workspace hooks can add new hook names but cannot override bundled, managed, or plugin-provided hooks with the same name.
|
||||
|
||||
The Gateway skips internal hook discovery on startup until internal hooks are configured. Enable a bundled or managed hook with `openclaw hooks enable <name>`, install a hook pack, or set `hooks.internal.enabled=true` to opt in.
|
||||
|
||||
### Hook packs
|
||||
|
||||
Hook packs are npm packages that export hooks via `openclaw.hooks` in `package.json`. Install with:
|
||||
|
||||
@@ -24,6 +24,7 @@ openclaw hooks list
|
||||
```
|
||||
|
||||
List all discovered hooks from workspace, managed, extra, and bundled directories.
|
||||
Gateway startup does not load internal hook handlers until at least one internal hook is configured.
|
||||
|
||||
**Options:**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user