Skip to content

fix: declare contracts.tools in plugin manifest (OpenClaw 5.2 compat)#737

Open
DaleXiao wants to merge 1 commit intoCortexReach:masterfrom
DaleXiao:fix/declare-contracts-tools
Open

fix: declare contracts.tools in plugin manifest (OpenClaw 5.2 compat)#737
DaleXiao wants to merge 1 commit intoCortexReach:masterfrom
DaleXiao:fix/declare-contracts-tools

Conversation

@DaleXiao
Copy link
Copy Markdown

@DaleXiao DaleXiao commented May 3, 2026

Summary

OpenClaw 5.2+ enforces a new plugin manifest contract: any plugin that calls api.registerTool() must first declare the tool names in contracts.tools: string[]. Without it, the gateway rejects every tool registration with:

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

Impact on memory-lancedb-pro

All 14 agent tools fail to register on 5.2:

  • memory_recall, memory_store, memory_forget, memory_update
  • memory_list, memory_stats, memory_archive, memory_compact
  • memory_debug, memory_explain_rank, memory_promote
  • self_improvement_log, self_improvement_extract_skill, self_improvement_review

This silently breaks agent-driven memory recall. Agents lose memory_recall from their toolset entirely. The bug hides easily because:

  • autoRecall (passive injection) bypasses the tool registry → still works
  • Users see "memory still injects 3 items into context" and assume everything is fine
  • But the agent has lost half the recall surface — it can no longer issue targeted queries via memory_recall("specific topic")

The only trace is 14 error lines in gateway.err.log per startup.

Fix

Declare all 14 tool names in openclaw.plugin.jsoncontracts.tools. 18-line addition, no behavior change on older OpenClaw versions (field is ignored if not enforced).

Verification

Tested on OpenClaw 2026.5.2 (npm openclaw@2026.5.2):

Before:

[gateway] [plugins] plugin must declare contracts.tools before registering agent tools (plugin=memory-lancedb-pro, ...)

×14 lines on each gateway start.

After:

[plugins] memory-lancedb-pro@1.1.0-beta.10: plugin registered
(db: ..., model: text-embedding-v4, smartExtraction: ON)

0 contracts.tools errors. All 14 tools available to agents.

Related

Companion to #727 (allowConversationAccess) — same OpenClaw 5.2 compatibility surface, complementary fixes. After both land, memory-lancedb-pro is fully compatible with 5.2 non-bundled installation.

Tool inventory source

The 14 tool names are extracted from src/tools.ts's api.registerTool({ name: ... }) calls (current master tip 0545c91).

OpenClaw 5.2+ enforces a new plugin manifest contract: any plugin that
calls api.registerTool() must first declare the tool names in
contracts.tools (string[]). Without this, the gateway rejects every
tool registration and emits this error per tool:

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

Concrete impact on memory-lancedb-pro:
  - All 14 agent tools (memory_recall / memory_store / memory_forget /
    memory_update / memory_list / memory_stats / memory_archive /
    memory_compact / memory_debug / memory_explain_rank / memory_promote /
    self_improvement_{log,extract_skill,review}) fail to register.
  - Agents lose the ability to ACTIVELY query memory via memory_recall
    (the tool simply isn't in their toolset).
  - autoRecall (passive injection) is unaffected because it bypasses
    the tool registry, so this often hides as 'memory still seems to
    work' while the agent has lost half the recall surface.

Fix: declare all 14 tool names in openclaw.plugin.json contracts.tools.

Verified locally on OpenClaw 2026.5.2: after the fix the contracts.tools
errors are gone and all tools register cleanly. No behavior change on
older OpenClaw versions (the field is ignored if not enforced).

Companion to CortexReach#727 (allowConversationAccess) — same 5.2 compat surface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant