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

python
def classify_resource_pressure() -> Dict[str, str]

Returns

ResponseField Dict[str, str]

&lt;level&gt;, “disk”: &lt;level&gt;&#125;“ with values drawn from the closed vocabulary above.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 6322