Remote Session API

Core RemoteAgent Session methods and their boundaries

Remote Sessions provide get_info(), prompt(), stop(), subscribe(), messages(), system(), interactions(), respond(), status(), set({ security }), and fork().

const session = await agent.sessions.create();

const unsubscribe = session.subscribe(apply_mutation);
const turn = await session.prompt({ query: "Continue" });
await turn.finished;

const page = await session.messages();
const status = await session.status();

await session.set({
  security: { approval_mode: "always-allow" },
});
unsubscribe();

The subscription emits message | part | delta | turn | file_diff | session | warning. User participation is a pending Interaction on its Tool Part while that Tool is waiting-user; a failed model call emits warning / model_request. Submit structured user responses with session.respond(...).

A prompt requires a trusted host-bound actor. The same actor can append input to its active Turn; another actor receives session_busy. Read status.occupied_by to inspect ownership. stop(expected_turn_id) waits for stopping and rejects if the target Turn has changed.

Remote clients can set serializable security policy but do not select models through the Agent SDK. The server host owns model IDs, defaults, recovery, and runtime instance injection.