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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
月光博客
月光博客
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More
美团技术团队
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
Vercel News
Vercel News
量子位
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
腾讯CDC
有赞技术团队
有赞技术团队

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
fix(plugins): deprecate deactivate hook alias · openclaw/...
vincentkoc · 2026-05-16 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -20,7 +20,7 @@ Docs: https://docs.openclaw.ai

2020

- Telegram: persist polling updates through restart replay so queued same-topic messages resume in order instead of losing context after a gateway restart. (#82256) Thanks @VACInc.

2121

- Gateway/Gmail: abort in-flight Gmail watcher startup and hot-reload restarts before shutdown so reloads cannot spawn `gog serve` after the Gateway is closing. Thanks @frankekn.

2222

- MCP plugin tools: forward host MCP `tools/call` `AbortSignal` through `createPluginToolsMcpHandlers().callTool` into plugin `tool.execute`, so host cancellation actually cancels in-flight plugin tool calls instead of letting them run to completion. Fixes #82424. (#82443) Thanks @joshavant.

23-

- Plugins: accept `api.on("deactivate")` as a compatibility alias for `gateway_stop`, so external plugin cleanup handlers run on Gateway shutdown instead of being ignored as unknown hooks.

23+

- Plugins: accept deprecated `api.on("deactivate")` registrations as a dated compatibility alias for `gateway_stop`, so external plugin cleanup handlers run on Gateway shutdown while authors get migration guidance.

2424

- Media: ignore image MIME and filename hints when bytes sniff as generic containers, so zip/octet-stream payloads mislabeled as images do not become local image media or keep image file extensions when staged.

2525

- Update/doctor: avoid materializing `groupAllowFrom` for channel schemas that reject it, so package-swap doctor repairs do not fail on externalized Slack configs.

2626

- Gateway/media: prevent image filenames from overriding generic non-image byte sniffing, so zip/octet-stream payloads mislabeled as images are offloaded or rejected before they become inline image attachments.

Original file line numberDiff line numberDiff line change

@@ -112,6 +112,8 @@ Current compatibility records include:

112112
113113

- legacy broad SDK imports such as `openclaw/plugin-sdk/compat`

114114

- legacy hook-only plugin shapes and `before_agent_start`

115+

- legacy `api.on("deactivate", ...)` cleanup hook names while plugins migrate to

116+

`gateway_stop`

115117

- legacy `activate(api)` plugin entrypoints while plugins migrate to

116118

`register(api)`

117119

- legacy SDK aliases such as `openclaw/extension-api`,

Original file line numberDiff line numberDiff line change

@@ -145,7 +145,7 @@ observation-only.

145145

**Lifecycle**

146146
147147

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

148-

- `deactivate` - compatibility alias for `gateway_stop`; prefer `gateway_stop` in new plugins

148+

- `deactivate` - deprecated compatibility alias for `gateway_stop`; use `gateway_stop` in new plugins

149149

- `cron_changed` - observe gateway-owned cron lifecycle changes (added, updated, removed, started, finished, scheduled)

150150

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

151151

@@ -438,8 +438,8 @@ before the next major release:

438438

- **`before_agent_start`** remains for compatibility. New plugins should use

439439

`before_model_resolve` and `before_prompt_build` instead of the combined

440440

phase.

441-

- **`deactivate`** remains as a cleanup compatibility alias. New plugins should

442-

use `gateway_stop`.

441+

- **`deactivate`** remains as a deprecated cleanup compatibility alias until

442+

after 2026-08-16. New plugins should use `gateway_stop`.

443443

- **`onResolution` in `before_tool_call`** now uses the typed

444444

`PluginApprovalResolution` union (`allow-once` / `allow-always` / `deny` /

445445

`timeout` / `cancelled`) instead of a free-form `string`.

Original file line numberDiff line numberDiff line change

@@ -757,6 +757,29 @@ canonical replacement.

757757
758758

</Accordion>

759759
760+

<Accordion title="deactivate hook → gateway_stop">

761+

**Old**: `api.on("deactivate", handler)`.

762+
763+

**New**: `api.on("gateway_stop", handler)`. The event and context are the

764+

same shutdown cleanup contract; only the hook name changes.

765+
766+

```typescript

767+

// Before

768+

api.on("deactivate", async (event, ctx) => {

769+

await stopPluginService(ctx);

770+

});

771+
772+

// After

773+

api.on("gateway_stop", async (event, ctx) => {

774+

await stopPluginService(ctx);

775+

});

776+

```

777+
778+

`deactivate` remains wired as a deprecated compatibility alias until after

779+

2026-08-16.

780+
781+

</Accordion>

782+
760783

<Accordion title="Provider discovery types → provider catalog types">

761784

Four discovery type aliases are now thin wrappers over the

762785

catalog-era types:

Original file line numberDiff line numberDiff line change

@@ -135,6 +135,11 @@ const knownDeprecatedSurfaceMarkers = [

135135

file: "src/plugin-sdk/compat.ts",

136136

marker: "@deprecated Use `openclaw/plugin-sdk/channel-message`.",

137137

},

138+

{

139+

code: "legacy-deactivate-hook-alias",

140+

file: "src/plugins/hook-types.ts",

141+

marker: "@deprecated Use gateway_stop",

142+

},

138143

{

139144

code: "channel-route-key-aliases",

140145

file: "src/plugin-sdk/channel-route.ts",

Original file line numberDiff line numberDiff line change

@@ -23,6 +23,22 @@ export const PLUGIN_COMPAT_RECORDS = [

2323

releaseNote:

2424

"Legacy `before_agent_start` hook compatibility remains wired while plugins migrate to modern hook stages.",

2525

},

26+

{

27+

code: "legacy-deactivate-hook-alias",

28+

status: "deprecated",

29+

owner: "sdk",

30+

introduced: "2026-05-16",

31+

deprecated: "2026-05-16",

32+

warningStarts: "2026-05-16",

33+

removeAfter: "2026-08-16",

34+

replacement: "`gateway_stop` hook",

35+

docsPath: "/plugins/hooks#upcoming-deprecations",

36+

surfaces: ["api.on(\"deactivate\", ...)", "plugin typed hook registration"],

37+

diagnostics: ["plugin runtime compatibility warning"],

38+

tests: ["src/plugins/loader.test.ts"],

39+

releaseNote:

40+

"`api.on(\"deactivate\", ...)` remains wired as a deprecated compatibility alias while plugins migrate to `gateway_stop`.",

41+

},

2642

{

2743

code: "hook-only-plugin-shape",

2844

status: "active",

Original file line numberDiff line numberDiff line change

@@ -94,6 +94,7 @@ export type PluginHookName =

9494

| "subagent_delivery_target"

9595

| "subagent_spawned"

9696

| "subagent_ended"

97+

/** @deprecated Use gateway_stop. */

9798

| "deactivate"

9899

| "gateway_start"

99100

| "gateway_stop"

@@ -1003,11 +1004,13 @@ export type PluginHookHandlerMap = {

10031004

ctx: PluginHookSubagentContext,

10041005

) => Promise<void> | void;

10051006

/**

1006-

* Compatibility alias for gateway_stop.

1007+

* Deprecated compatibility alias for gateway_stop.

10071008

*

10081009

* New plugins should register gateway_stop directly; the loader normalizes

10091010

* deactivate registrations onto gateway_stop so cleanup handlers still run

10101011

* during Gateway shutdown.

1012+

*

1013+

* @deprecated Use gateway_stop.

10111014

*/

10121015

deactivate: (

10131016

event: PluginHookGatewayStopEvent,

Original file line numberDiff line numberDiff line change

@@ -5939,7 +5939,8 @@ module.exports = {

59395939

registry.diagnostics.some(

59405940

(diag) =>

59415941

diag.pluginId === "legacy-deactivate-hook" &&

5942-

diag.message === 'typed hook "deactivate" is a compatibility alias for "gateway_stop"',

5942+

diag.message ===

5943+

'typed hook "deactivate" is deprecated (legacy-deactivate-hook-alias); use "gateway_stop". This compatibility alias will be removed after 2026-08-16.',

59435944

),

59445945

).toBe(true);

59455946

});

Original file line numberDiff line numberDiff line change

@@ -51,6 +51,7 @@ import {

5151

import { buildPluginApi } from "./api-builder.js";

5252

import { normalizeRegisteredChannelPlugin } from "./channel-validation.js";

5353

import { CODEX_APP_SERVER_EXTENSION_RUNTIME_ID } from "./codex-app-server-extension-factory.js";

54+

import { getPluginCompatRecord } from "./compat/registry.js";

5455

import type { CodexAppServerExtensionFactory } from "./codex-app-server-extension-types.js";

5556

import {

5657

isReservedCommandName,

@@ -187,6 +188,16 @@ export type PluginHttpRouteRegistration = RegistryTypesPluginHttpRouteRegistrati

187188

};

188189
189190

const GATEWAY_METHOD_DISPATCH_CONTRACT = "authenticated-request";

191+

const LEGACY_DEACTIVATE_HOOK_ALIAS_COMPAT = getPluginCompatRecord("legacy-deactivate-hook-alias");

192+
193+

function formatLegacyDeactivateHookAliasDiagnostic(): string {

194+

const removeAfter =

195+

LEGACY_DEACTIVATE_HOOK_ALIAS_COMPAT.removeAfter ?? "a future breaking release";

196+

return (

197+

`typed hook "deactivate" is deprecated (${LEGACY_DEACTIVATE_HOOK_ALIAS_COMPAT.code}); ` +

198+

`use "gateway_stop". This compatibility alias will be removed after ${removeAfter}.`

199+

);

200+

}

190201
191202

type PluginOwnedProviderRegistration<T extends { id: string }> = {

192203

pluginId: string;

@@ -2304,7 +2315,7 @@ export function createPluginRegistry(registryParams: PluginRegistryParams) {

23042315

level: "warn",

23052316

pluginId: record.id,

23062317

source: record.source,

2307-

message: 'typed hook "deactivate" is a compatibility alias for "gateway_stop"',

2318+

message: formatLegacyDeactivateHookAliasDiagnostic(),

23082319

});

23092320

}

23102321

let effectiveHandler = handler;