Skip to content

hindsight-openclaw plugin does not restart daemon after OpenClaw gateway SIGUSR1 restart #264

@GodsBoy

Description

@GodsBoy

Summary

The @vectorize-io/hindsight-openclaw plugin (v0.4.6) starts the hindsight-embed daemon during initial plugin load. When the OpenClaw gateway receives SIGUSR1 (soft restart, which is the default restart signal for config changes and updates), the daemon process is killed but the plugin does not re-initialize it. The daemon stays dead until a full gateway restart (openclaw gateway restart).

Details

In hindsight-integrations/openclaw/src/index.ts, the plugin initializes the daemon during the default export function call:

  1. embedManager = new HindsightEmbedManager(...)
  2. await embedManager.start() (starts the daemon process)
  3. isInitialized = true

The plugin registers a service with start() and stop() methods. However:

  • The start() method only waits for the already-resolved initPromise. It does not check if the daemon is actually still running.
  • After a SIGUSR1 soft restart, the gateway kills child processes (including the daemon), then re-loads plugins. But the module-level state (isInitialized, initPromise, embedManager) may persist or be in a stale state.
  • There is no health check or reconnection logic in the service lifecycle.

Steps to Reproduce

  1. Start OpenClaw gateway with the hindsight-openclaw plugin
  2. Verify the daemon is running (curl http://127.0.0.1:8889/health)
  3. Send SIGUSR1 to the gateway process (or trigger a config change that causes soft restart)
  4. Try to use hindsight memory features
  5. Observe that the daemon is no longer running and memory operations fail

Expected Behavior

The plugin should detect when the daemon is no longer running (either during service start() or via periodic health checks) and restart it. Alternatively, the service stop()/start() lifecycle should fully tear down and reinitialize the daemon.

Impact

This affects every OpenClaw user with the hindsight plugin installed. SIGUSR1 is the default restart signal used by openclaw gateway for config changes and updates, so this is triggered frequently.

Environment

  • OpenClaw v2026.1.29
  • hindsight-openclaw v0.4.6
  • Hetzner VPS Ubuntu 24.04

Workaround

Run hindsight-api as a standalone systemd service independently of the OpenClaw gateway. This avoids the lifecycle dependency entirely.

Related

See #261 for related context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions