From 2f58f07a5af070f3c5de161530642e7a5002fbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=99=BD=E5=8F=94?= <11794527+absfan@user.noreply.gitee.com> Date: Fri, 30 Oct 2026 09:24:16 +0800 Subject: [PATCH] fix: limit DSH automatic retries to known failures --- src/dx_productivity/dsh/rules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dx_productivity/dsh/rules.py b/src/dx_productivity/dsh/rules.py index ad962f4..d421677 100644 --- a/src/dx_productivity/dsh/rules.py +++ b/src/dx_productivity/dsh/rules.py @@ -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"