Connection liveness
session.readydeclaresheartbeat_interval_ms. Each side MUST sendpingat least everyheartbeat_interval_msand MUST answerpingwithpongwithinheartbeat_interval_ms.[AWP-SAF-001]- A side MUST treat the control connection as lost after three consecutive intervals without a
pong(or any other message) from the peer, and the world MUST then move the session toSuspended(AWP-SES-003).[AWP-SAF-002]
Watchdog and safe-state entry
- Every world with a streaming time model MUST declare
safety_policy.safe_statewithbehavior(hold,safe_stop,park, or a vendor value) andwatchdog_ms. The watchdog measures time since the last control-channel message the agent originated on this session: any request or notification from the agent, including its ownping. Responses to the world’s requests — including the pong answering the world’sping— do not reset it, so a connection kept alive only by a transport library that answers pings trips the watchdog. A world MUST NOT declare areconnect_window_msinsession.readyshorter than itswatchdog_ms; the robotics profile default is 2000 and the maximum permitted there is 5000.[AWP-SAF-003] - When the watchdog expires, the world MUST, in order: (1) begin the declared
behavioron every embodiment bound to the session, except a shared embodiment on which another session’s action is executing, which that session keeps (AWP-MA-003, AWP-MA-004); (2) transition everyexecutingaction tofailed(reasonconnection_lost) and everypending_approval,queued, oracceptedaction tocancelled(reasonsafe_state); (3) emitworld.event: safe_state_entered, one per bound embodiment (AWP-EVT-004). Safe-state entry does not depend on whether the session isActiveorSuspended.[AWP-SAF-004] - Safe-state entry is independent of the heartbeat: a connection that answers the world’s pings but originates no agent traffic still trips the watchdog once
watchdog_mselapses. Agents in streaming sessions SHOULD originate a message (apingsuffices) at least everywatchdog_ms / 2while they intend to remain in control, and SHOULD send it from the loop that produces intents rather than from an independent timer, so that a stalled policy also stops the heartbeat that holds the watchdog off.[AWP-SAF-005] - Streaming command channels have their own, tighter, per-action watchdog (
watchdog_mson the action type, AWP-CMD-005). Both apply; the action-level watchdog fires first by construction.[AWP-SAF-006]
Session retention and resumption
reconnect_window_msgoverns only how long the world retains the session (token, grants, unacknowledged notifications,action_idhistory) after suspension. It does not govern motion; motion is governed by the watchdog. On window expiry the session isClosedand the embodiment released after safe state (AWP-SES-005, AWP-EMB-002).[AWP-SAF-007]- On
session.resumethe embodiment remains in its safe state. The world MUST NOT resume any action terminated by safe-state entry, and MUST NOT interpret a valid session token as permission to continue motion. The agent regains control by submitting new actions; the world emitsworld.event: safe_state_exitedwhen the first action admitted after safe-state entry begins executing, whether or not the session was suspended in between.[AWP-SAF-008]
Channel degradation, stale intents, and stalled inference
- If the world cannot deliver frames on a
reliableobservation channel for longer than that channel’sstale_after_ms(manifest, default 2 × the channel period), it MUST emitworld.event: channel_degradednaming the channel. Loss onlatest-winschannels is expected and not an event.[AWP-SAF-009] - Agents SHOULD NOT submit an action whose basis observation is stale — its staleness at the moment of use exceeding the channel’s
stale_after_ms— and SHOULD carrybasis_ts_mono_nson every submission so that the world can enforce AWP-SAF-013.[AWP-SAF-010] - Stalled inference. The protocol cannot observe a policy directly; it bounds how long motion continues without fresh intent. A streaming-duration action stops when its command frames stop (AWP-CMD-005). An extended action is a commitment to one motion and continues to its goal or to its effective deadline — the smaller of
deadline_msand the type’smax_duration_ms(AWP-ACT-008) — even if the policy stalls meanwhile; the watchdog catches a stalled policy only when the agent follows AWP-SAF-005 and its heartbeat stalls with it. Worlds that actuate SHOULD declaremax_duration_mson every extended type; the robotics profile requires it (AWP-ROB-007).[AWP-SAF-011] - Stale-intent enforcement. When the manifest declares
safety_policy.max_basis_age_ms, the world MUST reject withAWP_STALE_INTENTanyaction.submitwhosereceived_ts_mono_ns − basis_ts_mono_nsexceeds it or whosevalid_until_nshas already passed, and MUST transition torejected(reasonstale_intent) anypending_approvalorqueuedaction for which either bound is exceeded — basis age measured against the current session time — at the moment it would becomeaccepted. A world that declaresmax_basis_age_msMAY additionally requirebasis_ts_mono_nson every submission, rejecting its absence withAWP_STALE_INTENT. Likedeadline_ms, these bounds are binding in streaming and advisory in lockstep.[AWP-SAF-013]
Testing the bound
Adapters MUST verify their watchdog with a measured test: disconnect the agent abruptly during anexecuting extended action and record, on the world’s clock, the interval from the last received control message to the moment the behavior command reaches the actuator. That interval MUST be ≤ watchdog_ms + 100 ms, and the conformance report records the measured value. [AWP-SAF-012]