Class LlmChaosProfile


public class LlmChaosProfile extends ObjectWithJsonToString
Declarative fault/chaos injection for an HttpLlmResponse, for testing agent resilience: probabilistic provider errors (e.g. 429/529 with a Retry-After header), mid-stream truncation, and malformed SSE chunks.

Determinism: with errorProbability of 1.0 (always) or 0.0/null (never) the error decision is fully deterministic. A fractional probability draws once per response; set seed to make that single draw reproducible (note: a fixed seed yields the same decision every time). Truncation and malformed-SSE are deterministic. Follows the model field/withX/getter convention so it round-trips without a bespoke (de)serializer.

It also carries an optional stateful request quota (a fixed-window rate limit): when quotaName, quotaLimit, and quotaWindowMillis are set, requests beyond quotaLimit within the window are rejected with quotaErrorStatus (default 429) and the retryAfter header. Unlike the probabilistic error this is deterministic and counts real requests across the process (see LlmQuotaRegistry); expectations sharing a quotaName share one counter.