mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 13:26:04 -06:00
fix(plugins): bound hook execution and retire stale registrations (#115695)
* fix(plugins): bound hooks and own legacy registrations * docs(hooks): clarify internal handler ownership * fix(cli): retain message hook shutdown deadline
This commit is contained in:
@@ -27,6 +27,8 @@ OpenClaw has several extension surfaces that look similar but solve different pr
|
||||
|
||||
Use internal hooks when you want automation that behaves like a small installed integration. Use typed plugin hooks when you need runtime lifecycle control.
|
||||
|
||||
Internal hook handlers are request/event handlers. They must not own long-lived timers, watchers, sockets, or clients; plugins should register a service or use the typed `gateway_start` / `gateway_stop` lifecycle instead.
|
||||
|
||||
## Quick start
|
||||
|
||||
```bash
|
||||
|
||||
@@ -93,6 +93,14 @@ receive a cancellation signal. The hook dispatch can release its Gateway
|
||||
admission while that plugin work is still in progress. Plugins that own
|
||||
long-running work must provide their own cancellation and shutdown lifecycle.
|
||||
|
||||
Policy hooks `before_tool_call` and `before_install` use a 15-second default per
|
||||
handler. A timeout fails closed: the tool call or installation is rejected
|
||||
instead of continuing without a policy decision.
|
||||
|
||||
`gateway_stop` uses a five-second default per handler. Timed-out handlers are
|
||||
logged and shutdown continues so plugin cleanup cannot consume the Gateway
|
||||
process watchdog.
|
||||
|
||||
Outbound modifying hooks `message_sending` and `reply_payload_sending` use a
|
||||
15-second default per handler. If one times out, OpenClaw logs the plugin error
|
||||
and continues with the latest payload so the serialized delivery lane can
|
||||
|
||||
Reference in New Issue
Block a user