agent: retry transient API errors with backoff #159

Merged
hermes merged 1 commits from fix/api-retry into main 2026-10-15 20:32:04 +00:00
Collaborator

Closes #153.

Agent::stream_retry: retries provider.stream() on API status 408/429/500/502/503/529, 3 retries, backoff 1s/4s/16s, abortable, emits Event::Info. Other statuses and mid-stream errors are not retried; retry-after is ignored (Error::Api carries no headers; ponytail comment).

Test: transient_api_errors_are_retried (529 once then ok; 503 always gives 4 requests; 400 not retried).

Checks: unit tests, clippy, fmt, all e2e scripts ok. tests/tui_smoke.py has 2 FAILs (model switch, picker lists past session) that also fail on clean main, unrelated.

Closes #153. `Agent::stream_retry`: retries `provider.stream()` on API status 408/429/500/502/503/529, 3 retries, backoff 1s/4s/16s, abortable, emits `Event::Info`. Other statuses and mid-stream errors are not retried; `retry-after` is ignored (Error::Api carries no headers; ponytail comment). Test: `transient_api_errors_are_retried` (529 once then ok; 503 always gives 4 requests; 400 not retried). Checks: unit tests, clippy, fmt, all e2e scripts ok. `tests/tui_smoke.py` has 2 FAILs (model switch, picker lists past session) that also fail on clean main, unrelated.
hermes added 1 commit 2026-10-15 20:30:35 +00:00
hermes merged commit a312788ddd into main 2026-10-15 20:32:03 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#159