zhi 7a632697a9 chore: extract plugins into submodules
SynthesisAgent.ClaudePlugin and SynthesisAgent.OpenclawPlugin are now
separate gitea repos, referenced as submodules from this one. Each can be
iterated on independently while this repo stays as the cross-cutting
design/architecture / wire-protocol home.
2026-05-14 09:42:40 +00:00

SynthesisAgent

Bridge between OpenClaw (multi-channel hub) and Claude Code (interactive Claude session), letting OpenClaw drive Claude Code as an autonomous worker without using claude -p or the Agent SDK — so all usage stays on the interactive subscription quota.

Motivation

Starting 2026-06-15, Claude Agent SDK and claude -p usage on Max plans draws from a separate $100 monthly credit pool. Interactive Claude Code usage continues to draw from the subscription. Today OpenClaw's contractor agents spawn a fresh claude -p per external event, which after the cutover will consume credit instead of subscription.

SynthesisAgent moves contractor agents to a model where:

  • A long-lived interactive claude process serves each OpenClaw session.
  • External events (Discord, Telegram, Slack…) flow into that process via the official notifications/claude/channel MCP notification protocol, the same one Anthropic's own discord@claude-plugins-official plugin uses.
  • The process exposes OpenClaw's tool surface (pcexec, sessions_, memory_, wiki_*, canvas, …) back to the model.

Architecture

        Discord / Telegram / Slack / ...
                    │
                    ▼
            OpenClaw Gateway (existing)
                    │
                    ▼
        ┌──────────────────────────────────────┐
        │  SynthesisAgent.OpenclawPlugin       │
        │  - Process Manager (spawn / resume)  │
        │  - Session Mapping DB                │
        │  - Bridge WebSocket Server           │
        └──────────────────────────────────────┘
              │              ▲
              │ spawn        │ WebSocket
              ▼              │
        ┌──────────────────────────────────────┐
        │  claude --channels plugin:synthesis  │  (one per OpenClaw session)
        │  ├─ Claude Code (interactive)        │
        │  └─ SynthesisAgent.ClaudePlugin      │
        │       (MCP stdio server)             │
        │       - notifications/claude/channel │
        │       - tool proxy → OpenClaw        │
        │       - permission bridge            │
        └──────────────────────────────────────┘

Submodules

Module Lives in Role
SynthesisAgent.OpenclawPlugin OpenClaw process Spawns/manages Claude processes per session; bridges Claude OpenClaw event bus
SynthesisAgent.ClaudePlugin Each Claude process MCP stdio server registered as a --channels plugin; receives events from OpenclawPlugin bridge, proxies tool calls back

Wire protocol

See docs/wire-protocol.md for the message schema between the two plugins.

Status

Scaffolding only. Nothing wired up. See each submodule's TODO list.

License

Apache-2.0 (matches the upstream Anthropic Discord channel plugin this work is modeled after).

Description
No description provided
Readme 51 KiB
Languages
Markdown 100%