zocomputer
|
e1befe5077
|
feat(agent): add jittered retry backoff
Adds agent/retry_utils.py with jittered_backoff() — exponential backoff
with additive jitter to prevent thundering-herd retry spikes when
multiple gateway sessions hit the same rate-limited provider.
Replaces fixed exponential backoff at 4 call sites:
- run_agent.py: None-choices retry path (5s base, 120s cap)
- run_agent.py: API error retry path (2s base, 60s cap)
- trajectory_compressor.py: sync + async summarization retries
Thread-safe jitter counter with overflow guards ensures unique seeds
across concurrent retries.
Trimmed from original PR to keep only wired-in functionality.
Co-authored-by: martinp09 <martinp09@users.noreply.github.com>
|
2026-04-08 00:41:36 -07:00 |
|