End-to-end Fabric inbound→Plexum→Fabric outbound now works against a
live Fabric stack:
alice posts in bt2-clean (Fabric REST)
→ guild emits message.created over socket.io
→ plugin's wakeup gate decides dispatch
→ notifications/plexum/channel/inbound to host
→ Plexum agent runs (echo provider)
→ outbound `send` tool posts via Fabric REST
→ fabrictester reply visible in channel
internal/socketio/ (~280 LOC + 2 tests):
- Minimal Engine.IO v4 + Socket.IO v5 client over websocket
- WebSocket-only transport (skip polling upgrade dance)
- AuthFunc callback re-evaluated on every (re)connect — fixes the
stale-JWT-on-reconnect bug openclaw plugin documented for the JS
client's single-shot auth, which the available Go socket.io
library (zishang520) doesn't address either
- PING/PONG per server-supplied interval
- Caller-driven reconnect: Connect returns on close, supervisor
re-dials with fresh token
internal/tokens/ (~95 LOC + 9 tests):
- Per-agent session cache with 8min TTL (matches openclaw's
TOKEN_TTL_MS); guild tokens are ~15min so 8min keeps a margin
- Invalidate forces re-login (used by inbound when CONNECT auth fires)
- GuildToken helper picks the per-guild JWT from the cached session;
if the guild is missing from the cache, invalidate + retry once
internal/inbound/ (~290 LOC):
- Supervisor: one socket.io conn per (agent, guild); reconnect with
fresh token on drop; ChannelSyncInterval (60s) polling + push
channel.joined/channel.left handlers
- Wakeup gate: dm channels deliver any non-self message; other
x_types require wakeup=true (record-only for non-wake non-dm
deferred — Plexum has no history-injection equivalent in v1)
- Self-author filter on selfUserId from cached session
- Per-(agent,msgId) dedup bounded to 5000 entries
- Per-channel serial queue with 5s idle drain so concurrent inbounds
on the same channel run one-at-a-time (matches openclaw plugin)
- Emits notifications/plexum/channel/inbound with session_id =
"s_fab_<fabric_channel_id>" for stable per-channel session continuity
cmd/plexum-fabric-channel-plugin:
- Wires inbound supervisor at Init; runs in a background goroutine
for the plugin's lifetime
- Replaces F-1's sessions map with tokens.Cache (same warm-sessions
behavior, now backed by TTL)
- hostLogHandler: bridges slog records from inbound supervisor to
HostAPI.Log notifications
F-2 deferred to F-3+:
- record-only history injection (Plexum v1 has no equivalent)
- tools.ts port (15 MCP tools — channel/canvas/sub-discussion family)
- presence-sync, command-sync, attachments, coalesce parity
Tests: 22 (5 identity + 6 config + 9 tokens + 2 socketio).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Plexum-fabric-channel-plugin
Native Plexum channel plugin connecting Plexum agents to Fabric guilds as
real channel members. Inspired by Fabric.OpenclawPlugin — Plexum port,
delivered in phases.
Status
Phase F-1 (foundation) — current: identity registry, Center auth, REST
client, plugin scaffold, channel-binding discovery. The send outbound tool
posts plain text to a Fabric channel as the bound agent.
Phase F-2 (deferred): socket.io inbound, wakeup-gated dispatch, token refresh, per-channel serial queue.
Phase F-3+ (deferred): tools.ts port (~15 MCP tools — channel/canvas/ sub-discussion/etc.), presence sync, command sync, attachments, coalesce parity.
Install
cd ~/Plexum-fabric-channel-plugin
./scripts/install.sh # build + install plugin + register CLI
Then:
-
Mint a Center API key for each Plexum agent that should speak in Fabric:
docker exec fabric-backend-center node dist/cli.js user apikey --email <agent-email> -
Register the key with Plexum:
plexum-fabric-register --agent-id alice --api-key fak_xxxx # writes ~/.plexum/fabric-identity.json -
Configure plugin-level settings at
~/.plexum/plugins/plexum-fabric-channel/config.json:{ "center_api_base": "http://localhost:7001/api" } -
Bind a Plexum channel name to a Fabric channel at
~/.plexum/channels/<plexum-channel-name>.json:{ "agent_id": "alice", "plugin": "plexum-fabric-channel", "fabric": { "guild_node_id": "test-guild1", "channel_id": "ch_xxxxxxxxx" } } -
Allow the plugin in
~/.plexum/plexum.json:{"plugins": {"allow": ["plexum-fabric-channel"]}} -
Restart the gateway:
systemctl --user restart plexum
What you get in F-1
- Plugin loads at gateway start, validates every bound agent's API key
against Center via
agentLogin, and warms a session per agent. sendMCP tool posts plain text to the bound Fabric channel as the agent user.- No inbound yet — Fabric → Plexum routing arrives in F-2.
Build manually
go build -o bin/plexum-fabric-channel-plugin ./cmd/plexum-fabric-channel-plugin
go build -o bin/plexum-fabric-register ./cmd/plexum-fabric-register
License
Same as Plexum.