Gateway configuration

Every ROBOTELOS_GATEWAY_* environment variable of the gateway, with its default.

The gateway is a role of the data plane server (runtime/cmd/dataplane). Set ROBOTELOS_DATAPLANE_ROLES to the roles a process runs: gateway serves the conversation protocol, engine advances accepted work, and gateway,engine runs both. Unset means engine alone. A role name that is misspelled, repeated or empty stops the process with exit code 2.

The gateway reads its configuration from the environment at startup and validates all of it before it starts. Problems are reported together, and the process exits with code 2.

VariableDefaultMeaning
ROBOTELOS_GATEWAY_DATABASE_URLrequiredPostgreSQL connection as robotelos_app
ROBOTELOS_GATEWAY_WORKER_DATABASE_URLrequiredPostgreSQL connection as robotelos_worker
ROBOTELOS_GATEWAY_TOKENS_FILErequiredPath to the bearer-token file (JSON). Tokens must be at least 8 characters
ROBOTELOS_GATEWAY_HTTP_ADDR:8787SSE, WebSocket, /healthz and /readyz
ROBOTELOS_GATEWAY_GRPC_ADDR:8788gRPC listener; off disables it
ROBOTELOS_GATEWAY_ALLOWED_ORIGINSnoneComma separated origins whose web pages may open a WebSocket, for example app.example.com,*.partner.test. A * matches any characters except a slash, dots included. Empty allows only pages served from the gateway’s own host. A bare * is refused at startup
ROBOTELOS_GATEWAY_MAX_CONNECTIONS_PER_PRINCIPAL20Connections one principal may hold at once. The one over the limit is answered with limit_exceeded and closed. off removes the limit
ROBOTELOS_GATEWAY_MAX_SUBSCRIPTIONS_PER_CONNECTION100Conversations one connection may follow. Subscribing again to one already followed does not count. off removes the limit
ROBOTELOS_GATEWAY_COMMAND_RATE20Commands per second one principal may send over all its connections. Over the limit a command is answered with rate_limited and the wait. off removes the limit
ROBOTELOS_GATEWAY_COMMAND_BURSTtwice the rateCommands a principal may send at once before the rate applies
ROBOTELOS_GATEWAY_WORKERS8Concurrent agent turns per replica
ROBOTELOS_GATEWAY_TURN_LEASE30sA turn not finished within this time is claimed again
ROBOTELOS_GATEWAY_MAX_TURN_ATTEMPTS3After this many attempts the turn ends as failed
ROBOTELOS_GATEWAY_MAX_CONNS20Connection pool size per role
ROBOTELOS_GATEWAY_MOCK_AGENT_DELAY0Artificial reply delay of the mock agent
ROBOTELOS_GATEWAY_ALLOW_UNSAFE_DATABASE_ROLEfalseAllows an application role that can bypass row level security. Only for local experiments

Startup checks

  • The application role cannot bypass row level security.
  • The schema is at least migration 20261113121000, the newest migration the gateway needs. A database at an older version is refused with the reason.

If either check fails, the gateway exits with the reason.

Token file

{"tokens": {"a-long-random-secret": {"id": "par_alice", "account": "acct_1", "display": "Alice"}}}

Mount the file read-only and keep it out of version control.

Next steps