Thaw Policy Protocol • AI Agent SDK
ThawPolicyProtocol: Protocol for freeze-thaw (involuntary host-suspend) detection.
ThawPolicyProtocol
Defined in the protocols module.
AI Agent
Protocol for freeze-thaw (involuntary host-suspend) detection.
Pure, import-free decision contract consumed by the wrapper’s `BotOS run-loop. The wrapper ticks the policy with a matched pair of time.monotonic() and time.time() readings; the policy compares the elapsed monotonic delta against the elapsed wall-clock delta and returns a :class:ThawDecision. On Linux CLOCK_MONOTONIC` does not advance while the host is suspended, so a wall-clock delta that runs far ahead of the monotonic delta is a positive signature of a freeze the process could not otherwise observe. Concrete recovery (restart channel sockets when idle, refresh presence, reconcile the scheduler) lives in the wrapper; this contract keeps the detection testable in isolation.
Methods
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 4308