Mock bridge mode
Run Claire without real messaging accounts for safe local development and tests.
MOCK_BRIDGE=true boots the server with zero external dependencies — no Docker, no Supabase, no WhatsApp, Matrix, Telegram, or Instagram. A MockBridgeAdapter replaces every real platform adapter and emits deterministic fixture messages.
Usage#
MOCK_BRIDGE=true bun run src/index.tsOr set MOCK_BRIDGE=true in .env.
Fixture inventory#
- User
00000000-0000-0000-0000-000000000001 - Platforms3 — WhatsApp, Telegram, Instagram
- Chats4 — three individual, one WhatsApp group
- Messages10
- Loop-bearing1
| Chat ID | Platform | Name |
|---|---|---|
mock-chat-wa-alice | Alice (WA) | |
mock-chat-tg-bob | Telegram | Bob (TG) |
mock-chat-ig-carol | Carol (IG) | |
mock-chat-wa-group | Team Chat (group) |
The loop message#
I'll send you the report by FridaySent by the user (isFromMe=true) in the WhatsApp/Alice chat. The loop detector should flag it as a commitment with the deadline Friday. It exists so loop detection has a stable target to assert against.
Seed and reset endpoints#
These routes exist only when MOCK_BRIDGE=true.
| Route | Effect |
|---|---|
GET /seed/fixtures | Fixture counts and IDs, for test assertions |
POST /seed/reset | Truncate mock-user rows and replay the fixture messages |
How it works#
server/src/config/index.tsparses theMOCK_BRIDGEenvironment variable.- When
mockBridgeConfig.enabled,server/src/index.tscallsplatformManager.setMatrixMode(mockBridgeAdapter)instead of wiring any real adapter. MockBridgeAdapter.initialize()emitsMOCK_MESSAGESasmessageevents viasetImmediate, so the normal unified message handler processes them end to end.- The seed route truncates and replays those messages for test isolation.
The important property is that mock mode exercises the real message pipeline. Only the source of events is faked.