From c41424aff5865bd64ad5a088530e92b29f8e600d Mon Sep 17 00:00:00 2001 From: "openclaw-docs-sync[bot]" Date: Fri, 24 Apr 2026 18:39:54 +0000 Subject: [PATCH] chore(sync): mirror docs from openclaw/openclaw@3bd2ee78b6acf105c23656bb2d61416d6ccb2fa7 --- .openclaw-sync/source.json | 4 ++-- docs/plugins/hooks.md | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 545f7f3f5..ccb2ab0f6 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "a43c1f880757e830b5fb4d3c7b5532a625f0e3e4", - "syncedAt": "2026-04-24T18:34:48.414Z" + "sha": "3bd2ee78b6acf105c23656bb2d61416d6ccb2fa7", + "syncedAt": "2026-04-24T18:38:29.642Z" } diff --git a/docs/plugins/hooks.md b/docs/plugins/hooks.md index 843b67719..a8cfe86e0 100644 --- a/docs/plugins/hooks.md +++ b/docs/plugins/hooks.md @@ -159,6 +159,9 @@ Use the phase-specific hooks for new plugins: `before_agent_start` remains for compatibility. Prefer the explicit hooks above so your plugin does not depend on a legacy combined phase. +`before_agent_start` and `agent_end` include `event.runId` when OpenClaw can +identify the active run. The same value is also available on `ctx.runId`. + Non-bundled plugins that need `llm_input`, `llm_output`, or `agent_end` must set: ```json @@ -182,10 +185,16 @@ Prompt-mutating hooks can be disabled per plugin with Use message hooks for channel-level routing and delivery policy: -- `message_received`: observe inbound content, sender, `threadId`, and metadata. +- `message_received`: observe inbound content, sender, `threadId`, `messageId`, + `senderId`, optional run/session correlation, and metadata. - `message_sending`: rewrite `content` or return `{ cancel: true }`. - `message_sent`: observe final success or failure. +Message hook contexts expose stable correlation fields when available: +`ctx.sessionKey`, `ctx.runId`, `ctx.messageId`, `ctx.senderId`, `ctx.trace`, +`ctx.traceId`, `ctx.spanId`, `ctx.parentSpanId`, and `ctx.callDepth`. Prefer +these first-class fields before reading legacy metadata. + Prefer typed `threadId` and `replyToId` fields before using channel-specific metadata.