pub fn compute_backoff(
count: u64,
base: i64,
max: i64,
allow_extended: bool,
) -> i64Expand description
Compute exponential backoff duration using base-3 growth.
Returns min(base * 3^(count-1), max) for count >= 1.
For count == 0 or 1 (first failure), returns base.
| count | base=300s | result |
|---|---|---|
| 0 | 300 | 300 |
| 1 | 300 | 300 |
| 2 | 300 | 900 |
| 3 | 300 | 2700 |
| 4 | 300 | 8100 |
| 5-6 | 14400 | 14400 (max, not yet extended) |
| 7-9 | 86400 | 86400 (24h extended tier) |
| 10+ | 172800 | 172800 (48h extended tier) |
The extended tier applies when the model has hit the max cap multiple times, indicating a persistently broken model that won’t self-resolve quickly.