Classify Resource Pressure • AI Agent SDK
classify_resource_pressure: Classify coarse memory + disk pressure for the health surface (pure).
classify_resource_pressure
Function
</div>
This function is defined in the protocols module.
Classify coarse memory + disk pressure for the health surface (pure).
A tiny, redaction-safe classifier that folds the wrapper’s `/proc/cgroup memory-budget fraction and free-disk sample into a closed ok / elevated / critical / unknown` vocabulary. Lives in core so the SDK and the bot classify identically; the wrapper owns the sampling.
`unknown is returned when a signal is missing and — per the issue — must never be treated as healthy by callers (it is deliberately not ok`).
Signature
def classify_resource_pressure() -> Dict[str, str]Returns
Dict[str, str]<level>, “disk”: <level>}“ with values drawn from the closed vocabulary above.
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 6322