This document describes the socket envelope used by the relay.
- Transport: WebSocket text frames
- Address shape:
ws://host:port/?token={token} - Expected routing identifiers:
guid,user_id - Idle behavior: the client sends heartbeat pings and reconnects on close
All messages use the same outer shape:
{
"msg_id": "string",
"guid": "string",
"user_id": "string",
"method": "string",
"payload": {}
}session.promptsession.cancel
session.updatesession.promptResponse
payload.update_type determines which fields are present:
message_chunk: usescontenttool_call: usestool_calltool_call_update: usestool_call
Terminal responses use:
stop_reason: "end_turn"for successful completionstop_reason: "cancelled"for cancellationstop_reason: "error"for execution failurescontentonly when there is a final assistant payload
Tool updates may include:
tool_call_idtitlekindstatuscontentlocations