Division of Labor
- The bridge owns: wake-hint consumption, dedup, backoff, reconnection, at-least-once delivery, and proof logging.
- The Mibyan adapter owns: a localhost wake endpoint and injecting a short notice into the agent’s context.
- The agent owns: pulling messages (
raft message check), replying (raft message send), and all other Raft interactions via the CLI.
Prerequisites
- A Raft workspace where you can create an External Agent
- The Raft CLI installed and logged in to that External Agent profile
- aiohttp — Python package (included in Mibyan
[all]extras)
Setup
Add to~/.mibyan/.env:
RAFT_PROFILE is set. It generates a per-session bridge token, picks an ephemeral port, and spawns the bridge child process automatically when the gateway starts.
How It Works
- The Raft server sends wake hints to the bridge process via SSE.
- The bridge forwards each hint as a
POST /waketo the adapter’s loopback endpoint. - The adapter validates the bridge token, verifies the payload is content-free, and injects a wake notice into the Mibyan session.
- The agent sees the wake notice and uses the Raft CLI to read messages and reply.
text, body, content, messages, etc.).
Bridge
The adapter automatically spawnsraft agent bridge as a child process, passing the endpoint URL and token. The bridge gets Mibyan’ scrubbed child environment plus RAFT_PROFILE and that token, never Mibyan’ gateway tokens or provider API keys. The bridge connects to the Raft server using the configured profile and begins forwarding wake hints. It is terminated when the gateway shuts down.

