fix: don't retry 404

This commit is contained in:
Ian 2026-10-07 21:15:51 -04:00
parent 15941e080d
commit 8b249109bb
2 changed files with 2 additions and 3 deletions

View file

@ -184,7 +184,7 @@ def _is_transient_model_error(exc: BaseException) -> bool:
return True
code = _model_error_status_code(exc)
if code is not None:
return code >= 400 and code not in (401, 402, 403)
return code >= 400 and code not in (401, 402, 403, 404)
return isinstance(exc, APIError)

View file

@ -84,8 +84,7 @@ def test_client_errors_are_transient() -> None:
"bad", response=httpx.Response(400, request=_request()), body=None
)
assert execution._is_transient_model_error(bad_request) is True
assert execution._is_transient_model_error(_status_error(404)) is True
for status in (401, 402, 403):
for status in (401, 402, 403, 404):
assert execution._is_transient_model_error(_status_error(status)) is False
assert execution._is_transient_model_error(ValueError("nope")) is False