docs(plugins/hooks): document per-hook timeoutMs registration option

For 891c7d9f1c: docs/plugins/hooks.md "Quick start" now lists the `priority`
and new `timeoutMs` opts that `api.on(...)` accepts, explaining that the
per-hook budget aborts a slow handler instead of letting plugin setup or
recall work consume the caller's configured model timeout. The change is
traceable to the new `OpenClawPluginApi.on` `{ priority?; timeoutMs? }`
signature and `PluginHookRegistration.timeoutMs` field added in the same
SHA.
This commit is contained in:
Vincent Koc
2026-04-28 10:12:23 -07:00
parent c0ec58f4b6
commit 7d2d8732d0

View File

@@ -52,6 +52,15 @@ export default definePluginEntry({
Hook handlers run sequentially in descending `priority`. Same-priority hooks
keep registration order.
`api.on(name, handler, opts?)` accepts:
- `priority` — handler ordering (higher runs first).
- `timeoutMs` — optional per-hook budget. When set, the hook runner aborts that
handler after the budget elapses and continues with the next one, instead of
letting slow setup or recall work consume the caller's configured model
timeout. Omit it to use the default observation/decision timeout that the
hook runner applies generically.
Each hook receives `event.context.pluginConfig`, the resolved config for the
plugin that registered that handler. Use it for hook decisions that need
current plugin options; OpenClaw injects it per handler without mutating the