Shutdown Forensics Protocol • AI Agent SDK
ShutdownForensicsProtocol: Protocol for capturing forensics when a gateway dies unexpectedly.
ShutdownForensicsProtocol
Defined in the protocols module.
AI Agent
Protocol for capturing forensics when a gateway dies unexpectedly.
Pure contract consumed by the wrapper’s signal handlers. `snapshot must be fast (<10ms), never raise, and never block the asyncio teardown; spawn_diagnostic` is fire-and-forget and must run the diagnostic in a
detached session so a `SIGKILL on the process group does not also kill the diagnostic. Concrete OS I/O (/proc reads, os.getrusage, os.getloadavg`, subprocess spawn) lives in the wrapper implementation.
Methods
Return a small, JSON-serialisable forensic context.
spawn_diagnostic()Fire-and-forget a detached diagnostic into `log_dir`.
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 5737