Skip to content

Commit d02101d

Browse files
authored
docs(plugins): document session-end shutdown drain deadline (#118099)
1 parent 0335317 commit d02101d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎docs/plugins/hooks.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ turn with a synthetic reply or silence, use `before_agent_reply`.
192192
| `before_compaction` / `after_compaction` | Observe or annotate compaction cycles |
193193
| `before_reset` | Observe session-reset events (`/reset`, programmatic resets) |
194194

195+
Shutdown and restart share one **2-second total `session_end` drain budget**
196+
across all active sessions and plugin handlers; the budget is not per handler.
197+
Return quickly or keep finalization bounded and persistence crash-consistent.
198+
If the budget expires, OpenClaw logs `session-end-drain timed out` and continues
199+
shutdown, so unfinished plugin work can be interrupted.
200+
195201
For `sessions.create` calls with `parentSessionKey` and `emitCommandHooks: true`, a distinct child always receives `session_start`. Callers declare whether the parent also receives terminal `session_end` with `succeedsParent`: `true` means successor, `false` means parallel child. Omission preserves the legacy parent-rollover behavior. The `command:new` and `before_reset` hooks still describe the requested `/new` action in both cases.
196202

197203
**Subagents**

0 commit comments

Comments
 (0)