fix: limit DSH automatic retries to known failures
This commit is contained in:
1 parent
d667fa6c57
commit
2f58f07a5a
1 file changed
+3
-1
@@ -3,13 +3,15 @@ from __future__ import annotations
|
||||
from .actions import ActionProposal
|
||||
from .snapshot import TaskSnapshot
|
||||
|
||||
RETRYABLE_CODES = {"worker_error", "worker_timeout", "timeout", "quick_run_failed", "execution_failed", "native_failed"}
|
||||
|
||||
|
||||
def classify(snapshot: TaskSnapshot) -> str:
|
||||
status = snapshot.status.casefold()
|
||||
code = snapshot.issue_code.casefold()
|
||||
if status in {"uncertain", "blocked"} or "uncertain" in code:
|
||||
return "manual_review"
|
||||
if status in {"failed", "error"} and code not in {"invalid_rule", "permission_denied"}:
|
||||
if status in {"failed", "error"} and code in RETRYABLE_CODES:
|
||||
return "retryable"
|
||||
if status in {"timeout", "timed_out"}:
|
||||
return "retryable"
|
||||
|
||||
Reference in new issue
Block a user