Upgrade to WebSocket for streaming exec/PTY
Upgrades the HTTP connection to a WebSocket. The sandbox must exist.
This endpoint is for authenticated exec/PTY lifecycle traffic. Public
exposed-port and SSH websocket access is returned as websocket_url
from POST /v1/sandboxes/{id}/host when edge ingress is enabled. See
docs/product/reference/websocket-protocol.md for the message format.
The PTY control stream accepts RuntimeWsClientMessage frames and emits
RuntimeWsServerMessage frames. PTY reconnect accepts exactly one of
session_id or legacy pid; PTY input accepts exactly one of
byte-safe data_base64 or legacy text data. PTY session_id and
legacy pid reconnect are scoped to the current running sandbox
execution and are not durable across hibernate/resume.
The server sends WebSocket Ping frames every 15 seconds and closes
after two missed Pong responses.