Skip to content

Add OpenClaw plugin system for tools, memory, channels, and providers#103

Closed
buremba wants to merge 2 commits into
mainfrom
claude/openclaw-plugins-support-uopdS
Closed

Add OpenClaw plugin system for tools, memory, channels, and providers#103
buremba wants to merge 2 commits into
mainfrom
claude/openclaw-plugins-support-uopdS

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented Feb 19, 2026

Description

Implements a comprehensive plugin system for OpenClaw that enables dynamic loading and integration of:

  • Tool plugins: Custom agent capabilities injected into sessions
  • Memory plugins: Context recall/save backends for conversation history
  • Channel plugins: Messaging platform integrations (Slack, Teams, etc.)
  • Provider plugins: AI model inference backends

The system includes:

  1. Plugin Loader (packages/gateway/src/plugins/plugin-loader.ts): Discovers plugins from npm (@openclaw/, @/openclaw-*) and local directories, validates manifests, and loads them via dynamic import with a shim API that captures registrations
  2. Plugin Bridge (packages/worker/src/openclaw/plugin-bridge.ts): Adapts loaded plugins into worker-consumable components (ToolDefinition[], MemoryHooks, provider metadata)
  3. Channel Adapter (packages/gateway/src/plugins/channel-adapter.ts): Wraps channel plugins as Lobu PlatformAdapters for message routing
  4. Plugin Types (packages/core/src/plugin-types.ts): Shared TypeScript interfaces for plugin manifests, configurations, and registrations
  5. Integration Points:
    • Worker loads plugins and bridges tools/memory into agent sessions
    • Gateway loads and registers channel plugins as platform adapters
    • Agent settings store persists per-agent plugin configurations

Plugins are discovered from:

  • node_modules/@openclaw/* (official namespace)
  • node_modules/@*/openclaw-* (community namespace)
  • Configured local extension directories
  • Per-agent plugin config in settings

Memory plugins integrate with agent lifecycle (recall before prompt, save after response). Tool plugins are merged with custom tools. Channel plugins participate in message routing as first-class platform adapters.

Type of Change

  • New feature (non-breaking change which adds functionality)

Testing

  • Existing tests pass (no new test files added, but plugin loading is exercised through integration with worker and gateway)
  • Plugin discovery and loading logic is defensive with try-catch error handling
  • Dynamic imports are resolved relative to configured paths

Checklist

  • Code follows project style guidelines
  • Changes are self-contained and well-documented with inline comments
  • No new warnings introduced
  • Plugin system is extensible for future slot types

Related Issues

Implements OpenClaw plugin architecture for extensibility.

Additional Notes

The plugin system uses a shim API pattern to capture registrations without requiring plugins to have direct dependencies on Lobu internals. This allows third-party plugins to be developed independently. The exclusive slot constraint (e.g., only one memory plugin active) is enforced during loading based on pluginsConfig.slots configuration.

https://claude.ai/code/session_01TnnWVhe45TgmLSSbKBzYx3

…ider)

Implements full OpenClaw plugin lifecycle integration into Lobu:
- Plugin types and interfaces in packages/core (PluginManifest, LoadedPlugin, etc.)
- Plugin loader service in gateway with shim OpenClawPluginApi for discovery/registration
- Plugin bridge in worker converting tool/memory/provider plugins to pi-coding-agent format
- Channel adapter wrapping OpenClaw channel plugins as Lobu PlatformAdapters
- Plugin config wired through agent settings, API routes, and all message handlers

https://claude.ai/code/session_01TnnWVhe45TgmLSSbKBzYx3
… only

OpenClaw channel plugins can't support streaming, interactions, or file
handling — Lobu's native platform adapters (Slack/Telegram/WhatsApp) are
far richer. Provider plugins require deep pi-coding-agent integration
that isn't needed yet.

Removed:
- channel-adapter.ts (entire file)
- Channel/provider types (OpenClawChannelDef, OpenClawProviderDef, etc.)
- Channel plugin loading from gateway startup
- Provider bridge from plugin-bridge.ts
- Channel/provider registration from both gateway and worker shim APIs

Kept: tool + memory plugin slots with build-time npm installation.

https://claude.ai/code/session_01TnnWVhe45TgmLSSbKBzYx3
@buremba
Copy link
Copy Markdown
Member Author

buremba commented Feb 20, 2026

Closing: superseded by PR #106 which is now merged to main. PR #106 implements a cleaner plugin architecture (single worker-side loader, raw ToolDefinition passthrough, provider support via ModelRegistry). The memory plugin support from this PR can be added as a focused follow-up PR on top of #106's architecture when needed.

@buremba buremba closed this Feb 20, 2026
@buremba buremba deleted the claude/openclaw-plugins-support-uopdS branch February 26, 2026 10:33
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.

2 participants