/ws for JSON-RPC 2.0 communication. This is the primary transport for the CLI and web dashboard.
Connection
Connect to the WebSocket endpoint with authentication to establish a JSON-RPC session.Connection Examples
4001 (Unauthorized).
Protocol
All communication uses JSON-RPC 2.0 over text WebSocket frames. Binary frames are not supported and will receive a parse error response.Request/Response Exchange
"jsonrpc": "2.0"— protocol version (required)"method"— the method name innamespace.methodformat"id"— a unique request identifier (integer or string)"params"— method parameters (optional, defaults to{})
id to correlate request and response. Notifications (requests without id) do not receive a response.
Batch Requests
Send an array of JSON-RPC requests to execute multiple methods in a single message. Responses are returned as an array in the same order.gateway.maxBatchSize. Exceeding the limit returns a -32600 error.
Heartbeat
The server sends periodic heartbeat notifications to all connected clients. Heartbeats are JSON-RPC notifications (noid field) and do not require a response.
Heartbeats serve as a keep-alive mechanism, preventing proxy timeouts and allowing clients to detect stale connections.
Rate Limiting
Each WebSocket connection has an independent sliding-window rate limiter that tracks message frequency.
When the rate limit is exceeded, the server responds with an error and discards the message:
Message Size Limit
Messages exceeding the configured maximum size are rejected before parsing.Error Codes
JSON-RPC error codes returned by the WebSocket handler.
All error responses follow the JSON-RPC 2.0 error format:
Close Codes
WebSocket close codes used by the Comis gateway.
The server sends close code
1001 with reason "Server shutting down" during graceful shutdown, giving clients time to reconnect after restart.
Server Notifications
The server can push unsolicited notifications to connected clients. Notifications are JSON-RPC messages without anid field — clients must not send a response.
Targeted Notifications
The server can send notifications to a specific client (identified byclientId from the token configuration):
Broadcast Notifications
Some notifications (such as sub-agent completion announcements) are broadcast to all connected clients when the target client cannot be determined.Related
JSON-RPC Methods
All available JSON-RPC methods with parameters and examples
HTTP Gateway
HTTP endpoint reference and authentication
Rate Limiting
Rate limiting configuration and behavior
Config YAML
Gateway configuration options
