-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Plugin loaded but registerTool fails — "plugin must declare contracts.tools" #80621
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
openclaw.plugin.json declares "contracts": { "tools": true }, but registerTool still fails with "plugin must declare contracts.tools before registering agent tools". The plugin loads (status: loaded) but no tools appear.
Steps to reproduce
Create a native plugin with openclaw.plugin.json containing:
{
"id": "my-plugin",
"entry": "./dist/index.js",
"configSchema": { "type": "object", "properties": {} },
"contracts": { "tools": true }
}
In dist/index.js, export a register function that calls api.registerTool({ name: "test", description: "...", parameters: { type: "object", properties: {} }, handler: async () => {} })
Install plugin: openclaw plugins install
Enable plugin: openclaw plugins enable my-plugin
Restart gateway: openclaw gateway restart
Inspect: openclaw plugins inspect my-plugin --runtime --json
Expected behavior
api.registerTool should succeed. tools array should contain the registered tool. No error should appear in diagnostics.
Actual behavior
openclaw plugins inspect --runtime --json returns:
OpenClaw version
2026.5.7
Operating system
Windows 10
Install method
npm install -g openclaw
Model
NOT_ENOUGH_INFO
Provider / routing chain
NOT_ENOUGH_INFO
Additional provider/model setup details
NOT_ENOUGH_INFO
Logs, screenshots, and evidence
Impact and severity
Blocks all plugin developers from registering agent tools via the native plugin format. Any plugin that needs to expose tools to agents cannot function. Affects: plugin developers. Severity: blocks workflow. Frequency: always.
Additional information
Also tested registerCommand and registerCli — both have similar documentation gaps. registerCommand succeeds (commands appear in inspect output) but commands are not routable from chat channels (Feishu). registerCli fails with "cli registration missing explicit commands metadata". The plugin SDK docs at https://docs.openclaw.ai/tools/plugin do not mention contracts.tools or its required location.