Skip to content

Commit c478aec

Browse files
committed
docs: cover cron_changed plugin hook and legacy env-var deprecation
- docs/plugins/hooks.md: add `cron_changed` to the Lifecycle hook catalog and a Gateway lifecycle paragraph describing its typed event payload, run status, delivery status, and removed-event job snapshot, so plugin authors picking up f155a5f (#72773) have a canonical reference beyond the sdk-overview bullet that already shipped in the same SHA. - docs/help/environment.md: add a "Legacy environment variables" section for aa1834a so users see that `CLAWDBOT_*` and `MOLTBOT_*` prefixes are now ignored and trigger an `OPENCLAW_LEGACY_ENV_VARS` deprecation warning, with a rename example to `OPENCLAW_*`.
1 parent f155a5f commit c478aec

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

docs/help/environment.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ openclaw gateway run
156156
Do not rely on writing only to `~/.openclaw/.env` for this variable; Node reads
157157
`NODE_EXTRA_CA_CERTS` at process startup.
158158

159+
## Legacy environment variables
160+
161+
OpenClaw only reads `OPENCLAW_*` environment variables. The legacy
162+
`CLAWDBOT_*` and `MOLTBOT_*` prefixes from earlier releases are silently
163+
ignored.
164+
165+
If any are still set on the Gateway process at startup, OpenClaw emits a
166+
single Node deprecation warning (`OPENCLAW_LEGACY_ENV_VARS`) listing the
167+
detected prefixes and the total count. Rename each value by replacing the
168+
legacy prefix with `OPENCLAW_` (for example `CLAWDBOT_GATEWAY_TOKEN`
169+
`OPENCLAW_GATEWAY_TOKEN`); the old names take no effect.
170+
159171
## Related
160172

161173
- [Gateway configuration](/gateway/configuration)

docs/plugins/hooks.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ observation-only.
109109
**Lifecycle**
110110

111111
- `gateway_start` / `gateway_stop` — start or stop plugin-owned services with the Gateway
112+
- `cron_changed` — observe gateway-owned cron lifecycle changes (added, updated, removed, started, finished, scheduled)
112113
- **`before_install`** — inspect skill or plugin install scans and optionally block
113114

114115
## Tool call policy
@@ -313,6 +314,17 @@ resources.
313314
Do not rely on the internal `gateway:startup` hook for plugin-owned runtime
314315
services.
315316

317+
`cron_changed` fires for gateway-owned cron lifecycle events with a typed
318+
event payload covering `added`, `updated`, `removed`, `started`, `finished`,
319+
and `scheduled` reasons. The event carries a `PluginHookGatewayCronJob`
320+
snapshot (including `state.nextRunAtMs`, `state.lastRunStatus`, and
321+
`state.lastError` when present) plus a `PluginHookGatewayCronDeliveryStatus`
322+
of `not-requested` | `delivered` | `not-delivered` | `unknown`. Removed
323+
events still carry the deleted job snapshot so external schedulers can
324+
reconcile state. Use `ctx.getCron?.()` and `ctx.config` from the runtime
325+
context when syncing external wake schedulers, and keep OpenClaw as the
326+
source of truth for due checks and execution.
327+
316328
## Upcoming deprecations
317329

318330
A few hook-adjacent surfaces are deprecated but still supported. Migrate

0 commit comments

Comments
 (0)