mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:40:44 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user