Skip to content

Plugin context engines can resolve before plugin registration (Lossless Claw / contextEngine slot) #40232

@dgarman194

Description

@dgarman194

Bug: plugin context engine resolves before plugin registration in OpenClaw 2026.3.7

Summary

When plugins.slots.contextEngine is set to lossless-claw, OpenClaw 2026.3.7 loads the Lossless Claw plugin successfully, but the gateway fails engine resolution at boot with:

Context engine "lossless-claw" is not registered. Available engines: legacy

This suggests context-engine resolution is happening before plugin-provided context engines are registered.

Environment

  • OpenClaw version: 2026.3.7
  • Install path: Homebrew-managed npm/global install under /opt/homebrew/lib/node_modules/openclaw
  • Plugin: @martian-engineering/lossless-claw@0.2.3
  • Node: v25.6.1
  • SQLite FTS5: available/working
  • macOS: Darwin 25.0.0 arm64

Repro

  1. Install plugin:
    openclaw plugins install @martian-engineering/lossless-claw
  2. Confirm plugin loads successfully.
  3. Set config:
    "plugins": {
      "slots": {
        "memory": "openclaw-mem0",
        "contextEngine": "lossless-claw"
      }
    }
  4. Restart gateway:
    openclaw gateway restart

Expected

Gateway should resolve and activate the lossless-claw context engine.

Actual

  • Plugin loads and lcm.db is created/used.
  • Plugin tools/data layer appear healthy.
  • Gateway log reports:
    Context engine "lossless-claw" is not registered. Available engines: legacy
  • Removing the contextEngine slot restores clean startup.

Evidence

  • Plugin source calls api.registerContextEngine("lossless-claw", () => lcm);
  • OpenClaw dist contains registerContextEngine() / resolveContextEngine() support and plugins.slots.contextEngine handling.
  • Dist also registers legacy eagerly in core.
  • Logs show plugin load happening after the gateway has already proceeded with runtime startup.

Relevant log ordering

After rollback, startup consistently shows plugin registration late in the sequence, e.g.:

  • Checking channel status (probe)…
  • Gateway reachable ...
  • later: [lcm] Plugin loaded (enabled=true, db=/Users/dakotagarman/.openclaw/lcm.db, threshold=0.75)

Earlier, when plugins.slots.contextEngine = "lossless-claw" was set, the gateway logged:

  • Context engine "lossless-claw" is not registered. Available engines: legacy

That ordering strongly suggests configured context-engine resolution is happening before plugin-provided context engines are registered.

Hypothesis

A load-order / initialization timing bug: configured context-engine resolution occurs before plugin registration has populated the registry with plugin-provided engines.

Potential fixes

  • Ensure plugin context engines are registered before resolveContextEngine(config) is called.
  • Or defer configured engine resolution until plugin initialization completes.
  • Or retry engine resolution after plugin load/registry initialization.

Notes

This is not a generic plugin-install problem:

  • plugin install succeeds
  • plugin load succeeds
  • plugin DB/tools initialize
  • only host-level engine selection fails at boot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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