Skip to content

OpenClaw 2026.5.x compat: missing contracts.tools + runBackup TypeError #744

@BART740204

Description

@BART740204

On OpenClaw host 2026.5.3 with memory-lancedb-pro at master HEAD 47b635d, two issues seen at every gateway start.

1. Manifest missing contracts.tools declaration

OpenClaw 2026.5.x added a check that requires non-bundled plugins to declare every agent tool they register inside contracts.tools in the manifest. The check lives in openclaw/dist/tool-contracts-*.js:

function normalizePluginToolContractNames(contracts) {
  return normalizePluginToolNames(contracts?.tools);  // expects string[]
}

Since openclaw.plugin.json has no contracts field, every gateway start logs:

[ERROR] [plugins] plugin must declare contracts.tools before registering agent tools
        (plugin=memory-lancedb-pro, source=.../plugins/memory-lancedb-pro/index.ts)

(fires 5x per startup)

The plugin still loads via the skills path and memory_recall / memory_store work, but new tool-registration paths are blocked.

Suggested fix

Add to openclaw.plugin.json:

{
  "id": "memory-lancedb-pro",
  "kind": "memory",
  "contracts": {
    "tools": [
      "memory_recall",
      "memory_store",
      "memory_update",
      "memory_forget",
      "memory_list",
      "memory_stats",
      "memory_debug",
      "memory_compact",
      "memory_archive",
      "memory_promote",
      "memory_explain_rank",
      "self_improvement_log",
      "self_improvement_extract_skill",
      "self_improvement_review"
    ]
  }
}

Names extracted from src/tools.ts. If enableManagementTools=false, the management-only ones could be omitted, but listing all 14 is harmless — the host only enforces that registered tools are a subset of declared ones.

2. runBackup throws TypeError → daily backup never runs

In index.ts:4011, the backup function references resolvedDbPath, which IS correctly destructured from singleton state at index.ts:2022. At plugin registration the path resolves fine — the gateway log shows:

plugin registered (db: /Users/<redacted>/.openclaw/memory/lancedb-pro, ...)

But ~24h later the backup fires and:

[WARN] memory-lancedb-pro: backup failed: TypeError [ERR_INVALID_ARG_TYPE]:
       The "path" argument must be of type string or an instance of Buffer or URL.
       Received undefined

The error is consistent — fires every backup interval. Something between index.ts:4008 and 4013 ends up passing undefined into a node:path call. Possibilities I considered but couldn't confirm without instrumenting:

  • api.resolvePath(join(resolvedDbPath, "..", "backups")) returning undefined for that input shape
  • _singletonState being reset/cleared between initial registration and the timer firing
  • A subsequent register() call mutating closure state

Reproduction

  1. Install plugin at master HEAD with default dbPath config
  2. Wait for backup interval (24h)
  3. Observe backup failed: TypeError in logs; no JSONL file created in <dbPath>/../backups/

Consequence

Daily JSONL backups have not been running in production. Memory data itself is safe in LanceDB, but the JSONL safety net is silently broken.

Environment

  • OpenClaw: 2026.5.3 (06d46f7)
  • Plugin: memory-lancedb-pro@1.1.0-beta.10 (master HEAD 47b635d)
  • Node: 25.6.0
  • OS: macOS 26.3.1 (arm64)

Happy to test patches if helpful.

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