Skip to content

fix: declare OpenClaw memory plugin contracts#834

Open
rickthomasjr wants to merge 1 commit into
CortexReach:masterfrom
rickthomasjr:fix/openclaw-memory-hooks-compat
Open

fix: declare OpenClaw memory plugin contracts#834
rickthomasjr wants to merge 1 commit into
CortexReach:masterfrom
rickthomasjr:fix/openclaw-memory-hooks-compat

Conversation

@rickthomasjr
Copy link
Copy Markdown

Summary

  • declare OpenClaw tool contracts for memory tools so current OpenClaw builds allow registration
  • document required hooks.allowConversationAccess for agent_end auto-capture
  • add embedding.maxInputChars and a conservative nomic-embed-text default to avoid small local embedding-server batch limits
  • fix backup path construction when dbPath is already resolved
  • update plugin-sdk import path for stringEnum

Verification

  • npm test
  • openclaw plugins registry --refresh
  • openclaw plugins doctor
  • node/jiti import of index.ts

Note: a direct tsc --noEmit check still exposes pre-existing LanceDB/typebox typing issues in store/tools that are outside this compatibility patch.

@rwmjhb
Copy link
Copy Markdown
Collaborator

rwmjhb commented May 31, 2026

PR #834 Review: fix: declare OpenClaw memory plugin contracts

Verdict: RESOLVE-CONFLICTS-FIRST | Author: rickthomasjr | Merge state: DIRTY

Pipeline short-circuited at the conflict gate after R0 verification. Deep review deferred until the branch rebases cleanly onto the base.

Problem Statement (R1)

Current OpenClaw builds require declared plugin tool contracts and hook permissions for memory tools and agent_end auto-capture to work reliably. Local embedding servers can also reject oversized inputs, especially with nomic-embed-text defaults.

Why This Stopped Here

GitHub reports mergeable=CONFLICTING (merge_state_status=DIRTY) for this PR. Reviewing the diff now would:

  1. Give feedback against a branch the author must rewrite anyway
  2. Produce findings that may be invalidated by the conflict resolution
  3. Waste review cycles on code that cannot be merged as-is

Recommended Action

Author should:

  1. Rebase this branch onto the latest base (or merge the base into this branch)
  2. Resolve all merge conflicts
  3. Push the rebased branch — the re-review will be picked up automatically

Reviewed at 2026-05-31T04:57:35Z | R0+R1 gate | Conflict gate

@marzliak
Copy link
Copy Markdown

marzliak commented Jun 3, 2026

Production confirmation + a note for the 1.1.x line

Running the equivalent contracts.tools declaration in production on OpenClaw 2026.5.28 with memory-lancedb-pro 1.1.0-beta.9 for the past 12 days. Result: the gateway registers the memory tools cleanly and the "plugin must declare contracts.tools before registering agent tools" error is gone:

[plugins] memory-lancedb-pro@1.1.0-beta.9: plugin registered (db: …/lancedb-pro, model: gemini-embedding-2-preview, smartExtraction: ON)

So the approach in this PR is correct and solves a real breakage on OpenClaw 2026.5.27+. 👍

One gap worth addressing before merge: this PR declares 6 tools, but the 1.1.x line registers 3 additional agent tools (self_improvement_log, self_improvement_extract_skill, self_improvement_review). On 2026.5.27+ those also get dropped unless declared. The full set we run is:

"contracts": { "tools": [
  "memory_recall","memory_store","memory_forget","memory_update","memory_stats","memory_list",
  "self_improvement_log","self_improvement_extract_skill","self_improvement_review"
]}

Note the last two self-improvement tools are only registered when enableManagementTools: true, so declaring them is harmless when the flag is off.

(Disclosure: I did not run the PR's npm test — this confirmation is from runtime in production, not a fresh build.)

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.

3 participants