Note Fleet State • AI Agent SDK

note_fleet_state: Trip the breaker when too large a fraction of the fleet is failing.

note_fleet_state

Method

</div>

This is a method of the FleetSupervisionPolicy class in the protocols module.

Trip the breaker when too large a fraction of the fleet is failing.

A systemic fault often shows up as many channels simultaneously in a failing/parked state rather than as a raw restart rate. When at least `failing_channel_fraction` of the fleet is failing, trip and start the cooldown.

Signature

python
def note_fleet_state(failing_channels: int, total_channels: int, now: float) -> bool

Parameters

ParamField int

Number of channels currently failing/parked.

ParamField int

Total number of supervised channels.

ParamField float

A monotonic timestamp for this evaluation.

Returns

ResponseField bool

`True` when the breaker is tripped (now or still cooling down).

Uses

  • tripped

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 6476