User guide: Continue a terminal session anywhere. Related: Live terminal sessions.

What it is

Session start lets any surface (phone, web, another computer) or the StartSession tool begin a real session on a paired computer, in a folder and permission mode the caller picks. The paired computer does the work. The caller only sends one request and then drives the session through the routes it already knows. Fixtures for every request, response and error live in docs/contracts/session-start/ in the platform repo. Surfaces code against those files.

Routes

Both routes live on the computer and are reached through the cloud relay at /api/v1/runtime-devices/:id/proxy.
The cloud keeps a snapshot of each computer’s options so a surface can show folders while that computer is asleep:
GET /api/v1/runtime-presence gains two additive fields: remoteStart (boolean) and kind (desktop, cloud or server).

Options response

One round trip returns everything a picker needs. It does not list installed tools. The app already knows those per computer from its runtime registry. Mode ids are the app’s own ids: auto, default (ask before actions), plan (read-only) and bypass.

Start request

Start response

The call returns 201 with one of two shapes, chosen by runtime.

Errors

Every error body is { error, message, action }.

The two kinds

  • Engine session. Gizzi starts as an engine session with directory set to the folder. The existing message, permission, abort and event routes drive it, so approvals arrive as cards.
  • Pane terminal. Every other coding CLI starts as a pane terminal. The thread hosts the AgentFrame composer view over that terminal.

Capability and safety switch

The cloud requires the runtime:remote_start capability for session-start. That rule is matched first, because later rules match substrings such as workspace, so folder paths travel in the request body only. The safety switch is on by default. A phone can already open a shell through Code, so on adds no new power and keeps setup at zero. Turning it off drops runtime:remote_start and refuses relayed starts, relayed terminal create, and adopt new and copy. Each remote start shows a notification on the computer.

Idempotency and guards

  • Send an Idempotency-Key header. A repeated key returns the first result and starts nothing new.
  • The mode can never be above the caller’s own mode.
  • origin.depth is at most 3.
  • At most 6 starts per minute per computer.

Asleep computers

While a computer is online it pushes a folder snapshot to the cloud with the PUT route above. If it is asleep, a surface can offer a cloud computer for the same folder by sending folder.git, which the cloud computer clones through the existing Code cloud-environment path. A folder without git cannot move, and the picker says so. Choosing the asleep computer anyway fails with a plain message and shows the cloud offer again.