Skip to main content

session.close

No params: params is {} or omitted. Pre-execution actions → cancelled (session_closed); executing actions → cancelling → cancelled (session_closed) after safe abort (AWP-SES-006). The embodiment is released after safe state (AWP-EMB-002). Result {}, sent only once every action is terminal and session.state: closed has been sent (AWP-SES-011).

session.resume

Call after reconnecting and completing initialize, within reconnect_window_ms of the suspension.
string
required
From session.ready (AWP-SEC-003).
integer
required
Highest status_seq the agent has processed; 0 if none (AWP-CTL-008).
awp:session-resume
Result: the same session.ready object as the original open, with the current tick (lockstep), safe_state: true|false indicating whether the embodiment is in safe state (AWP-SAF-008), and replay_to_status_seq, the highest status_seq assigned before resumption. The world then replays every action.status, world.event, and session.state with status_seq > last_status_seq, in order, before any live notification; a transition first reported in an action.submit or action.cancel result is replayed as an action.status with the same status_seq (AWP-CTL-008). The replay is complete once the agent has processed replay_to_status_seq. Actions still executing continue; an action that safe-state entry ended does not resume, and an embodiment in safe state stays there until a new action executes (AWP-SES-004, AWP-SAF-008). Errors: 2003 (AWP_SESSION_EXPIRED: window passed or token invalid), 2005 (AWP_SESSION_UNKNOWN: the world no longer holds this session, e.g. it restarted; treat the session as closed, AWP-SES-008), 2004 (AWP_SESSION_EXISTS: this connection already carries a session).

session.transfer

Current holder calls session.transfer with optional { expires_in_ms } (default 30000) and receives { transfer_token, expires_in_ms } for handoff; the receiver passes transfer_token to session.open with takeover: true (AWP-EMB-003). The receiver names the one embodiment it takes in embodiment. The previous holder’s executing actions on it end preempted and its pre-execution actions cancelled, reason transferred; a holder bound to several embodiments keeps the others, and one left with none continues as an observer session. Transfer tokens are single-use and redacted in the audit log (AWP-AUD-006).
awp:session-transfer-result

session.state (notification)

World → Agent on every transition from Ready onward (AWP-SES-007). Shares the status_seq sequence with action.status and world.event, so a suspended transition the agent could not receive is replayed after session.resume.
string
required
ready, active, suspended, or closed.
integer
required
Shared per-session sequence (AWP-CTL-008).
integer
required
Time of the transition.
string
opened, first_activity, connection_lost, resumed, session_closed, window_expired, world_shutdown, transferred, connection_replaced, or protocol_error (AWP-SES-010, AWP-CTL-009).
awp:session-state