Skip to content

boot-md hook misses gateway:startup event (race condition) #30257

@sterling-prog

Description

@sterling-prog

Summary

The boot-md hook registers for the gateway:startup event, but the hook loader completes registration after the startup event has already been emitted. The hook never fires.

Evidence from gateway logs

01:05:02.501Z [gateway] listening on ws://0.0.0.0:18789 (PID 454677)   ← startup complete
01:05:02.987Z [hooks:loader] Registered hook: boot-md -> gateway:startup  ← hook registers ~500ms later

The gateway:startup event fires at 01:05:02.5. The boot-md hook doesn't register until 01:05:03.0. By the time it's listening, the event has already been emitted and missed.

Expected behavior

boot-md should fire after every gateway startup. Either:

  1. Defer the gateway:startup event until all hooks are registered
  2. Replay the startup event to hooks that register for it after it fires
  3. Run boot-md handlers directly after hook registration completes

Environment

  • OpenClaw version: 2026.2.26
  • OS: Ubuntu Linux 6.8.0-101-generic (x64)
  • Node: v25.4.0

Workaround

Using a delayed cron as a substitute for the boot-md hook until this is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions