Fail invalid plugin registration gates loudly (#72577)

* fix plugin registration gate failures
This commit is contained in:
Alex Knight
2026-04-27 15:46:50 +10:00
committed by GitHub
parent 85148f3b20
commit 06b3e4ef8a
4 changed files with 131 additions and 46 deletions

View File

@@ -81,6 +81,19 @@ describe("my-channel target resolution", () => {
## Testing patterns
### Testing registration contracts
Unit tests that pass a hand-written `api` mock to `register(api)` do not exercise
OpenClaw's loader acceptance gates. Add at least one loader-backed smoke test
for each registration surface your plugin depends on, especially hooks and
exclusive capabilities such as memory.
The real loader fails plugin registration when required metadata is missing or a
plugin calls a capability API it does not own. For example,
`api.registerHook(...)` requires a hook name, and
`api.registerMemoryCapability(...)` requires the plugin manifest or exported
entry to declare `kind: "memory"`.
### Unit testing a channel plugin
```typescript