Plan de reintentos con espera
backoff-scheduleCalcula los tiempos de espera entre reintentos (exponencial, lineal o constante) con tope y jitter opcional. Cuándo: un flujo de agente necesita un resultado exacto y repetible para un paso auxiliar (tokens, costos, reintentos, fragmentos, ranking, limpieza de JSON). No para: interpretar Retry-After (retry-after-parse). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Computes retry delays for exponential, linear or constant backoff with a cap and optional jitter (full, equal or decorrelated; seeded for reproducibility), and the cumulative wait. When: an agent loop needs an exact, repeatable result for a bookkeeping step (tokens, costs, retries, chunking, ranking, JSON clean-up). Not for: parsing an HTTP Retry-After value (retry-after-parse). [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Seed for jitter (reproducible) (string; optional; up to 100 chars). | |
| factor | No | Multiplier for exponential (number; optional; default 2; min 1; max 10). | |
| jitter | No | Jitter (optional; one of: none, full, equal, decorrelated; default "none"). | none |
| max_ms | No | Cap per delay ms (number; optional; default 30000; min 0; max 86400000). | |
| base_ms | No | Base delay ms (number; optional; default 500; min 0; max 3600000). | |
| retries | No | Number of retries (integer; optional; default 5; min 1; max 100). | |
| strategy | No | Strategy (optional; one of: exponential, linear, constant; default "exponential"). | exponential |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total_ms | No | ||
| delays_ms | No | ||
| cumulative_ms | No |