fix(plugins): narrow optional tool cold loads

This commit is contained in:
Peter Steinberger
2026-05-04 00:40:53 +01:00
parent 07b52b4a01
commit baadd74b6b
10 changed files with 313 additions and 58 deletions

View File

@@ -252,6 +252,11 @@ plugin manifest:
{
"contracts": {
"tools": ["my_tool", "workflow_tool"]
},
"toolMetadata": {
"workflow_tool": {
"optional": true
}
}
}
```
@@ -260,6 +265,9 @@ OpenClaw captures and caches the validated descriptor from the registered tool,
so plugins do not duplicate `description` or schema data in the manifest. The
manifest contract only declares ownership and discovery; execution still calls
the live registered tool implementation.
Set `toolMetadata.<tool>.optional: true` for tools registered with
`api.registerTool(..., { optional: true })` so OpenClaw can avoid loading that
plugin runtime until the tool is explicitly allowlisted.
Users enable optional tools in config: