Bridge between OpenClaw (multi-channel hub) and interactive Claude Code, keeping autonomous agent usage on the subscription quota after the 2026-06-15 Agent SDK credit split. Initial scaffolding only — two submodules with skeletons: - SynthesisAgent.ClaudePlugin: stdio MCP server registered as a --channels source. Declares experimental.claude/channel capability (verified 2026-05-14 against the official Anthropic discord plugin) and emits notifications/claude/channel to push OpenClaw inbound messages into the Claude turn loop. - SynthesisAgent.OpenclawPlugin: process manager + session mapping + bridge WebSocket. Currently shaped around a custom ws protocol; will be rewritten as a model-provider HTTP server (contractor-agent pattern) so OpenClaw routes inbound channel messages through it via /v1/chat/completions. See STATUS.md for the open punch list and docs/wire-protocol.md for the (soon-to-change) inter-plugin frame schema.
4.2 KiB
4.2 KiB
SynthesisAgent — Status (paused 2026-05-14)
Where we left off
Scaffolding complete. Two submodules wired up with their core skeletons:
SynthesisAgent.ClaudePlugin/server.ts— stdio MCP server + bridge WebSocket client. Reads 4 env vars, forwardstool_call/permission_requestto OpenClaw side, translatesinbound_messageframes tonotifications/claude/channel.SynthesisAgent.OpenclawPlugin— process manager (spawn/resume/idle-GC), session mapping (JSON persist), bridge WS server, OpenClaw plugin entry. Tool-dispatch and inbound-event-subscription are stubbed.
Wire protocol fully specified in docs/wire-protocol.md.
Open blockers (in priority order)
Done / validated 2026-05-14 on laptop (SSH via T2)
- ✅
--channelsflag exists in Claude Code 2.1.140/141 (hidden from--help) - ✅ Syntax:
plugin:<name>@<marketplace>orserver:<name> - ✅
--plugin-dir <path>IS documented and works for local plugin loading - ✅ Capability declaration must be
experimental.claude/channelnot top-level — scaffolding patched - ✅
-pmode does NOT trigger turns from channel notifications — interactive only - ✅ Full gating chain decoded from binary (see
memory/claude_channels_protocol.md) - ❌ Did NOT capture an end-to-end "claude responds to channel notification" trace — got stuck at
--dangerously-load-development-channelsallowlist gate in script-PTY runs (interactive confirm may not have flowed through). Indirect evidence is overwhelming via the Discord plugin's working production pattern; remaining doubt is small.
Remaining
.mcp.jsonnot written — sandbox flagged it as sensitive on Write. Five-line file, need to drop in by hand or approve the write.- Confirm channel notification → new turn empirically — Have user run interactively (no PTY tricks):
(in a trusted dir), confirm dev mode at the prompt, watch for the stub's 1.5s-delayed channel-test ping triggering a turn.
claude --mcp-config /tmp/synthesis-mcp.json \ --channels server:synthesis-stub \ --dangerously-load-development-channels server:synthesis-stub - Decide deployment path:
server:channels are flagged "dangerous dev only" — fine for our own use, awkward for shippingplugin:channels need to be in marketplace allowlist (orgallowedChannelPlugins) — requires distribution mechanism- Easiest dev path: local marketplace pointing at our repo
- OpenClaw plugin-sdk inbound subscription API —
index.tshas a TODO whereapi.channels.onInbound(...)should live. Need to readcontractor-agent/index.tscarefully and copy the actual pattern. - Tool catalog source —
web/bridge-server.tssends an emptytools: []inhello_ack. Must enumerate OpenClaw's real tool surface and forward. tool_calldispatch — currently returnsnot implemented. Need to wire to OpenClaw's tool execution path.- Permission routing back to source channel — bridge auto-denies any
permission_requesttoday.
Quick-start tests to run when resuming
# 0. write .mcp.json (blocked last time)
# 1. verify --channels accepts local path or local marketplace
claude --channels plugin:synthesis-claude@/root/.openclaw/workspace/workspace-developer/SynthesisAgent/SynthesisAgent.ClaudePlugin 2>&1 | head -20
# 2. once #1 works: smoke-test notifications/claude/channel from a stub server
# (build a 30-line MCP server that fakes inbound_message after 5s)
Files to start from when picking up
README.md— context refresherdocs/wire-protocol.md— protocol contractSynthesisAgent.OpenclawPlugin/README.md— TODO list for that sideSynthesisAgent.ClaudePlugin/README.md— TODO list for that side
Reference implementations to crib from:
~/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/discord/server.ts— channel protocol model/root/.openclaw/plugins/contractor-agent/index.ts— OpenClaw plugin lifecycle model
Why paused
User pivoted to investigate a recurrence of the Discord duplicate-messages bug (discord_duplicate_messages). SynthesisAgent is the longer-term fix for that whole class of problem; the duplicate-messages bug is the short-term hotfix path.