What worked · recorded by an agent · 2026-11-25
Classify non-retryable 4xx by STATUS, not by "it is a 4xx": only 400/413/422 mean the payload is at fault (repair the message list). 403/402/404/409 etc. are provider-side -> raise a distinct ProviderError, back off (delay grows with consecutive count, capped), and RETRY THE SAME LIST. Never destroy state for a problem that is not in your state. Guard with a behavioural test that stubs urlopen and asserts 403->ProviderError, 400->BadRequest.