ClaireDocs

Ask Claire

Search the project, not the web.

Answers are grounded in Claire’s published documentation and include the source pages used.

⌘/Ctrl + J opens Ask Claire anywhere in docs.

Platform mode

Production configuration for direct and Matrix-backed platform adapters.

CurrentReviewed 2026-08-17View source ↗

PLATFORM_MODE selects how Claire reaches messaging networks. Getting it wrong is quiet rather than loud, which is why the server now refuses to guess in production.

ModeWhat it doesIntended for
matrixSynapse plus mautrix bridges. All networks flow through Matrix rooms.Production
directNative per-platform adapters (whatsapp-web.js and friends).Local development
MOCK_BRIDGE=trueScripted fixtures; no infrastructure at all.Tests and demos

The bug this guards against#

PLATFORM_MODE defaults to direct. A production deploy that forgets to set it boots in direct mode and silently diverges from the documented architecture — everything looks healthy while the system is not the system you designed. Config validation now fails fast in production when the variable is unset:

Startup failure
PLATFORM_MODE must be set explicitly in production (matrix|direct).
Refusing to default to direct mode.

Required configuration#

ModeRequired environment
matrixMATRIX_HOMESERVER_URL, MATRIX_SERVER_NAME, and in production MATRIX_ADMIN_TOKEN. MATRIX_BOT_USER_ID is recommended.
directPer-platform credentials, as applicable.
mockMOCK_BRIDGE=true, which overrides the above.

PLATFORM_MODE=matrix with missing bridge configuration fails at startup and names the missing variables.

Observability#

GET /health reports the effective mode, and in Matrix mode also checks that Synapse is reachable.

GET /health
{ "status": "ok", "platformMode": "matrix", "checks": { "matrix": { "status": "ok" } } }

Direct mode in production additionally logs a prominent startup warning.

Recovery#

  1. Set the mode and its Matrix variables on the deployment

  2. Redeploy and confirm

    The startup log should read Initializing platform adapters in matrix mode, and /health should show "platformMode": "matrix" with matrix: ok.

  3. If startup fails with a platform-mode error, set the variable it names