Skip to content

[Docs Bug]: Correct hook timeout semantics and document a safe cron host adapter #104083

Description

@steipete

Documentation issue

The plugin hook documentation currently describes timeoutMs as aborting a hook handler. The implementation only stops awaiting the handler; the underlying promise and side effects continue.

That distinction is important for host adapters: once the hook timeout expires, Gateway suspension accounting can stop waiting even though an external scheduler write is still in progress.

The cron hook documentation also recommends an initial full-list reconciliation but does not provide a complete safe adapter pattern for coalescing overlapping changes, waiting for durable external acceptance, retrying, or cleanup.

Location

  • docs/plugins/hooks.md
  • Cron hook/lifecycle sections in the plugin SDK documentation

Expected documentation

  • State precisely that timeoutMs bounds how long OpenClaw awaits a hook; it does not cancel the handler.
  • Provide a vendor-neutral cron host-adapter example that:
    • reconciles the full list at the authoritative cron lifecycle boundary;
    • serializes and coalesces overlapping cron_changed events;
    • publishes the full snapshot rather than applying lossy deltas;
    • keeps the hook promise pending until the external store durably accepts the snapshot;
    • retries transient failures without a core-owned outbox;
    • cleans up on gateway_stop.
  • Explain the ownership boundary: OpenClaw exposes lifecycle facts; the host/plugin owns external scheduler durability and policy.

Additional context

This should land after the typed cron reconciliation lifecycle contract so the example documents a real public API rather than a proposed one.

Metadata

Metadata

Assignees

Labels

P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.docsImprovements or additions to documentationissue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions