From 7d2d8732d0a19319f8b2bcd572a7bf1146566ed3 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 28 Apr 2026 10:12:23 -0700 Subject: [PATCH] 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. --- docs/plugins/hooks.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/plugins/hooks.md b/docs/plugins/hooks.md index 723dcbe13ac..5cc106798c0 100644 --- a/docs/plugins/hooks.md +++ b/docs/plugins/hooks.md @@ -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