fix(hooks): harden workspace hook loading

This commit is contained in:
Peter Steinberger
2026-03-22 09:37:30 -07:00
parent 1ee9611079
commit 42f23619e3
11 changed files with 221 additions and 17 deletions

View File

@@ -21,7 +21,7 @@ Related:
openclaw hooks list
```
List all discovered hooks from workspace, managed, and bundled directories.
List all discovered hooks from workspace, managed, extra, and bundled directories.
**Options:**
@@ -127,8 +127,7 @@ openclaw hooks enable <name>
Enable a specific hook by adding it to your config (`~/.openclaw/config.json`).
**Note:** Hooks managed by plugins show `plugin:<id>` in `openclaw hooks list` and
cant be enabled/disabled here. Enable/disable the plugin instead.
**Note:** Workspace hooks are disabled by default until enabled here or in config. Hooks managed by plugins show `plugin:<id>` in `openclaw hooks list` and cant be enabled/disabled here. Enable/disable the plugin instead.
**Arguments:**
@@ -152,6 +151,9 @@ openclaw hooks enable session-memory
- Updates `hooks.internal.entries.<name>.enabled = true` in your config
- Saves config to disk
If the hook came from `<workspace>/hooks/`, this opt-in step is required before
the Gateway will load it.
**After enabling:**
- Restart the gateway so hooks reload (menu bar app restart on macOS, or restart your gateway process in dev).
@@ -230,6 +232,9 @@ openclaw hooks install @openclaw/my-hook-pack
openclaw hooks install -l ./my-hook-pack
```
Linked hook packs are treated as managed hooks from an operator-configured
directory, not as workspace hooks.
## Update Hooks
```bash