惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
雷峰网
雷峰网
IT之家
IT之家
小众软件
小众软件
M
MIT News - Artificial intelligence
博客园 - 聂微东
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
C
Check Point Blog
云风的 BLOG
云风的 BLOG
腾讯CDC
H
Help Net Security
Y
Y Combinator Blog
I
InfoQ

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
docs(plugins/hooks): regroup hook catalog by surface, mar...
vincentkoc · 2026-04-25 · via Recent Commits to openclaw:main

@@ -52,25 +52,55 @@ export default definePluginEntry({

5252

Hook handlers run sequentially in descending `priority`. Same-priority hooks

5353

keep registration order.

545455-

## Common hooks

56-57-

| Hook | Use it for |

58-

| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |

59-

| `before_tool_call` | Rewrite tool params, block execution, or request user approval before a tool runs. |

60-

| `after_tool_call` | Observe tool results, errors, and duration after execution. |

61-

| `before_prompt_build` | Add dynamic context or system prompt text before the model call. |

62-

| `before_model_resolve` | Override provider or model before session messages are loaded. |

63-

| `before_agent_reply` | Short-circuit the model turn with a synthetic reply or silence. |

64-

| `llm_input` / `llm_output` | Observe provider input/output for conversation-aware plugins. |

65-

| `agent_end` | Observe final messages, success state, and run duration. |

66-

| `message_received` | Observe inbound channel messages after channel parsing. |

67-

| `message_sending` | Rewrite or cancel outbound channel messages. |

68-

| `message_sent` | Observe outbound delivery success or failure. |

69-

| `session_start` / `session_end` | Track session lifecycle boundaries. |

70-

| `before_compaction` / `after_compaction` | Observe or annotate compaction cycles. |

71-

| `subagent_spawning` / `subagent_delivery_target` / `subagent_spawned` / `subagent_ended` | Coordinate subagent routing and completion delivery. |

72-

| `gateway_start` / `gateway_stop` | Start or stop plugin services with the Gateway. |

73-

| `before_install` | Inspect skill or plugin install scans and optionally block. |

55+

## Hook catalog

56+57+

Hooks are grouped by the surface they extend. Names in **bold** accept a

58+

decision result (block, cancel, override, or require approval); all others are

59+

observation-only.

60+61+

**Agent turn**

62+63+

- `before_model_resolve` — override provider or model before session messages load

64+

- `before_prompt_build` — add dynamic context or system-prompt text before the model call

65+

- `before_agent_start` — compatibility-only combined phase; prefer the two hooks above

66+

- **`before_agent_reply`** — short-circuit the model turn with a synthetic reply or silence

67+

- `agent_end` — observe final messages, success state, and run duration

68+69+

**Conversation observation**

70+71+

- `llm_input` — observe provider input (system prompt, prompt, history)

72+

- `llm_output` — observe provider output

73+74+

**Tools**

75+76+

- **`before_tool_call`** — rewrite tool params, block execution, or require approval

77+

- `after_tool_call` — observe tool results, errors, and duration

78+

- **`tool_result_persist`** — rewrite the assistant message produced from a tool result

79+

- **`before_message_write`** — inspect or block an in-progress message write (rare)

80+81+

**Messages and delivery**

82+83+

- **`inbound_claim`** — claim an inbound message before agent routing (synthetic replies)

84+

- `message_received` — observe inbound content, sender, thread, and metadata

85+

- **`message_sending`** — rewrite outbound content or cancel delivery

86+

- `message_sent` — observe outbound delivery success or failure

87+

- **`before_dispatch`** — inspect or rewrite an outbound dispatch before channel handoff

88+

- **`reply_dispatch`** — participate in the final reply-dispatch pipeline

89+90+

**Sessions and compaction**

91+92+

- `session_start` / `session_end` — track session lifecycle boundaries

93+

- `before_compaction` / `after_compaction` — observe or annotate compaction cycles

94+

- `before_reset` — observe session-reset events (`/reset`, programmatic resets)

95+96+

**Subagents**

97+98+

- `subagent_spawning` / `subagent_delivery_target` / `subagent_spawned` / `subagent_ended` — coordinate subagent routing and completion delivery

99+100+

**Lifecycle**

101+102+

- `gateway_start` / `gateway_stop` — start or stop plugin-owned services with the Gateway

103+

- **`before_install`** — inspect skill or plugin install scans and optionally block

7410475105

## Tool call policy

76106

@@ -96,7 +126,10 @@ type BeforeToolCallResult = {

96126

severity?: "info" | "warning" | "critical";

97127

timeoutMs?: number;

98128

timeoutBehavior?: "allow" | "deny";

99-

onResolution?: (decision: string) => Promise<void> | void;

129+

pluginId?: string;

130+

onResolution?: (

131+

decision: "allow-once" | "allow-always" | "deny" | "timeout" | "cancelled",

132+

) => Promise<void> | void;

100133

};

101134

};

102135

```

@@ -110,6 +143,8 @@ Rules:

110143

approvals. The `/approve` command can approve both exec and plugin approvals.

111144

- A lower-priority `block: true` can still block after a higher-priority hook

112145

requested approval.

146+

- `onResolution` receives the resolved approval decision — `allow-once`,

147+

`allow-always`, `deny`, `timeout`, or `cancelled`.

113148114149

## Prompt and model hooks

115150