Skip to content

fix(memos-local-openclaw): declare contracts.tools in plugin manifest#1757

Open
Richard-JC-Yan wants to merge 1 commit into
MemTensor:mainfrom
Richard-JC-Yan:fix/declare-contracts-tools
Open

fix(memos-local-openclaw): declare contracts.tools in plugin manifest#1757
Richard-JC-Yan wants to merge 1 commit into
MemTensor:mainfrom
Richard-JC-Yan:fix/declare-contracts-tools

Conversation

@Richard-JC-Yan

Copy link
Copy Markdown

Summary

OpenClaw runtime requires every plugin to declare contracts.tools before registering agent tools. The memos-local-openclaw-plugin (apps/memos-local-openclaw) currently does not declare this field, causing OpenClaw to emit a warning every time the plugin registers a tool:

[plugins] plugin must declare contracts.tools before registering agent tools
  (plugin=memos-local-openclaw-plugin, source=.../index.js)

In a production OpenClaw deployment with active memos plugin, this warning flooded gateway.err.log at ~1300 lines/day (~33MB/day), masking real errors.

Fix

Add contracts.tools field listing all 20 tools the plugin actually registers (grep'd from api.registerTool({ name: "X", ... }) calls in index.ts):

  • memory_*: get, search, share, timeline, unshare, viewer, write_public
  • network_*: memory_detail, skill_pull, team_info
  • skill_*: file_get, files, get, install, publish, search, unpublish
  • task_*: share, summary, unshare

Verification

Post-deploy in production OpenClaw 2026.5.7 host:

  • Pre-fix: tail -200 gateway.err.log | grep -c 'plugin must declare contracts.tools' = 1372 (1 day window)
  • Post-fix + gateway restart: same grep = 0

No functional change — contracts.tools is a declaration field per OpenClaw plugin spec, not a runtime gate. Used as reference by other plugins like openclaw-lark (see their manifest for similar format).

Test plan

  • Reviewer confirms 20 tools list matches actual api.registerTool(...) calls in index.ts
  • If memos-cloud-openclaw-plugin (apps/MemOS-Cloud-OpenClaw-Plugin) has same gap, follow-up PR can apply same fix there (currently out of scope)

🤖 Generated with Claude Code

OpenClaw runtime requires every plugin to declare contracts.tools
before registering agent tools. Without it, the gateway logs the
following warning on every registration:

    [plugins] plugin must declare contracts.tools before registering
    agent tools (plugin=memos-local-openclaw-plugin, source=index.js)

In a production OpenClaw deployment with active memos plugin, this
warning flooded gateway.err.log at ~1300 lines/day, masking real
errors and bloating logs by ~33MB/day.

This commit declares all 20 tools the plugin actually registers
(grep'd via `api.registerTool(...)` calls in index.ts):

  - memory_*: get, search, share, timeline, unshare, viewer, write_public
  - network_*: memory_detail, skill_pull, team_info
  - skill_*: file_get, files, get, install, publish, search, unpublish
  - task_*: share, summary, unshare

Verified: post-deploy gateway.err.log warning count = 0.

Refs: contracts.tools field per OpenClaw plugin spec (see
openclaw-lark and similar plugins as reference).
@Memtensor-AI Memtensor-AI changed the base branch from main to dev-20260604-v2.0.19 June 10, 2026 15:44
@Memtensor-AI Memtensor-AI changed the base branch from dev-20260604-v2.0.19 to dev-v2.0.22 July 1, 2026 13:17
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: PASSED

Cloud test-engine rerun against dev-v2.0.22 completed successfully.

  • Run: tr-5842bcc1-210 on cloud test-engine 10010
  • memos_local_openclaw/unit: 9 passed, 0 failed, 0 skipped

Manual code review is still required before merge.

@CarltonXiang CarltonXiang deleted the branch MemTensor:main July 3, 2026 07:25
@syzsunshine219 syzsunshine219 reopened this Jul 3, 2026
@syzsunshine219 syzsunshine219 added the needs-audit Requires manual audit before merge label Jul 3, 2026
@syzsunshine219 syzsunshine219 changed the base branch from dev-v2.0.22 to main July 3, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-audit Requires manual audit before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants