docs(plugins/hooks): document per-hook timeoutMs registration option · openclaw/openclaw@7d2d873
vincentkoc
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -52,6 +52,15 @@ export default definePluginEntry({
|
52 | 52 | Hook handlers run sequentially in descending `priority`. Same-priority hooks |
53 | 53 | keep registration order. |
54 | 54 | |
| 55 | +`api.on(name, handler, opts?)` accepts: |
| 56 | + |
| 57 | +- `priority` — handler ordering (higher runs first). |
| 58 | +- `timeoutMs` — optional per-hook budget. When set, the hook runner aborts that |
| 59 | + handler after the budget elapses and continues with the next one, instead of |
| 60 | + letting slow setup or recall work consume the caller's configured model |
| 61 | + timeout. Omit it to use the default observation/decision timeout that the |
| 62 | + hook runner applies generically. |
| 63 | + |
55 | 64 | Each hook receives `event.context.pluginConfig`, the resolved config for the |
56 | 65 | plugin that registered that handler. Use it for hook decisions that need |
57 | 66 | current plugin options; OpenClaw injects it per handler without mutating the |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。