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

推荐订阅源

小众软件
小众软件
博客园_首页
博客园 - 聂微东
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
D
Docker
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
Jina AI
Jina AI
博客园 - Franky
D
DataBreaches.Net

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
Revert "feat: expose plugin approval action metadata" (#8...
kevinslin · 2026-05-28 · via Recent Commits to openclaw:main

@@ -183,81 +183,12 @@ local proof.

183183

</Step>

184184

</Steps>

185185186-

## Plugin capabilities

187-188-

A single plugin can register any number of capabilities via the `api` object:

189-190-

| Capability | Registration method | Detailed guide |

191-

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

192-

| Text inference (LLM) | `api.registerProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins) |

193-

| CLI inference backend | `api.registerCliBackend(...)` | [CLI Backend Plugins](/plugins/cli-backend-plugins) |

194-

| Channel / messaging | `api.registerChannel(...)` | [Channel Plugins](/plugins/sdk-channel-plugins) |

195-

| Speech (TTS/STT) | `api.registerSpeechProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

196-

| Realtime transcription | `api.registerRealtimeTranscriptionProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

197-

| Realtime voice | `api.registerRealtimeVoiceProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

198-

| Media understanding | `api.registerMediaUnderstandingProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

199-

| Image generation | `api.registerImageGenerationProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

200-

| Music generation | `api.registerMusicGenerationProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

201-

| Video generation | `api.registerVideoGenerationProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

202-

| Web fetch | `api.registerWebFetchProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

203-

| Web search | `api.registerWebSearchProvider(...)` | [Provider Plugins](/plugins/sdk-provider-plugins#step-5-add-extra-capabilities) |

204-

| Tool-result middleware | `api.registerAgentToolResultMiddleware(...)` | [SDK Overview](/plugins/sdk-overview#registration-api) |

205-

| Agent tools | `api.registerTool(...)` | Below |

206-

| Custom commands | `api.registerCommand(...)` | [Entry Points](/plugins/sdk-entrypoints) |

207-

| Plugin hooks | `api.on(...)` | [Plugin hooks](/plugins/hooks) |

208-

| Internal event hooks | `api.registerHook(...)` | [Entry Points](/plugins/sdk-entrypoints) |

209-

| HTTP routes | `api.registerHttpRoute(...)` | [Internals](/plugins/architecture-internals#gateway-http-routes) |

210-

| CLI subcommands | `api.registerCli(...)` | [Entry Points](/plugins/sdk-entrypoints) |

211-212-

For the full registration API, see [SDK Overview](/plugins/sdk-overview#registration-api).

213-214-

Bundled plugins can use `api.registerAgentToolResultMiddleware(...)` when they

215-

need async tool-result rewriting before the model sees the output. Declare the

216-

targeted runtimes in `contracts.agentToolResultMiddleware`, for example

217-

`["pi", "codex"]`. This is a trusted bundled-plugin seam; external

218-

plugins should prefer regular OpenClaw plugin hooks unless OpenClaw grows an

219-

explicit trust policy for this capability.

220-221-

If your plugin registers custom gateway RPC methods, keep them on a

222-

plugin-specific prefix. Core admin namespaces (`config.*`,

223-

`exec.approvals.*`, `wizard.*`, `update.*`) stay reserved and always resolve to

224-

`operator.admin`, even if a plugin asks for a narrower scope.

225-226-

`openclaw/plugin-sdk/gateway-method-runtime` is a reserved control-plane bridge

227-

for plugin HTTP routes that declare

228-

`contracts.gatewayMethodDispatch: ["authenticated-request"]`. It is an

229-

intentional-use guard for reviewed native plugins, not a sandbox boundary.

230-231-

Hook guard semantics to keep in mind:

232-233-

- `before_tool_call`: `{ block: true }` is terminal and stops lower-priority handlers.

234-

- `before_tool_call`: `{ block: false }` is treated as no decision.

235-

- `before_tool_call`: `{ requireApproval: { ... } }` pauses agent execution and prompts the user for approval via the exec approval overlay, native channel approval clients, or the `/approve` command on any channel.

236-

- `before_install`: `{ block: true }` is terminal and stops lower-priority handlers.

237-

- `before_install`: `{ block: false }` is treated as no decision.

238-

- `message_sending`: `{ cancel: true }` is terminal and stops lower-priority handlers.

239-

- `message_sending`: `{ cancel: false }` is treated as no decision.

240-

- `message_received`: prefer the typed `threadId` field when you need inbound thread/topic routing. Keep `metadata` for channel-specific extras.

241-

- `message_sending`: prefer typed `replyToId` / `threadId` routing fields over channel-specific metadata keys.

242-243-

The `/approve` command handles both exec and plugin approvals with bounded fallback: when an exec approval id is not found, OpenClaw retries the same id through plugin approvals. Plugin approval forwarding can be configured independently via `approvals.plugin` in config.

244-245-

If custom approval plumbing needs to detect that same bounded fallback case,

246-

prefer `isApprovalNotFoundError` from `openclaw/plugin-sdk/error-runtime`

247-

instead of matching approval-expiry strings manually.

248-249-

See [Plugin hooks](/plugins/hooks) for examples and the hook reference.

250-251-

## Registering agent tools

252-253-

Tools are typed functions the LLM can call. They can be required (always

254-

available) or optional (user opt-in):

255-256-

For simple plugins that only own a fixed set of tools, prefer

257-

[`defineToolPlugin`](/plugins/tool-plugins). It generates manifest metadata and

258-

keeps `contracts.tools` aligned. Use the lower-level `api.registerTool(...)`

259-

surface when the plugin also owns channels, providers, hooks, services,

260-

commands, or fully dynamic tool registration.

186+

<a id="registering-agent-tools"></a>

187+188+

## Registering tools

189+190+

Tools can be required or optional. Required tools are always available when the

191+

plugin is enabled. Optional tools require user opt-in.

261192262193

```typescript

263194

register(api) {