Skip to content

Commit 722582c

Browse files
committed
Count patch_details_failed as CLI transport evidence
A scan whose per-package detail fetch exhausts the CLI's 429/503 retry still exits zero and reports the failure as a patch_details_failed warning carrying the rate-limit or 5xx text. The zero-exit classifier only inspected api_batch_failed warnings, so a case failing solely on that warning was never retried. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014tWUsNuPcS5ByUDhzx9xh8
1 parent 10c7b08 commit 722582c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎scripts/backtest-poetry.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def diagnostic(value):
185185
found = transport_diagnostic(json.dumps(value["error"]))
186186
if found:
187187
return found
188-
if (value.get("errorCode") or value.get("code") == "api_batch_failed"
188+
if (value.get("errorCode") or value.get("code") in ("api_batch_failed", "patch_details_failed")
189189
or value.get("action") in ("failed", "skipped")):
190190
found = transport_diagnostic(json.dumps(value))
191191
if found:

‎scripts/tests/test_poetry_retry.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def test_successful_installer_retry_warnings_are_not_terminal(self):
208208
def test_zero_exit_cli_errors_are_structured_and_terminal(self):
209209
for envelope in ({"error": {"message": TRANSPORT}},
210210
{"warnings": [{"code": "api_batch_failed", "detail": TRANSPORT}]},
211+
{"warnings": [{"code": "patch_details_failed", "detail": "could not fetch details for pkg:pypi/urllib3@1.26.18: Rate limit exceeded (HTTP 429, gave up after 3 retries). Please try again later."}]},
211212
{"vendor": {"events": [{"action": "skipped", "errorCode": "download_failed", "reason": TRANSPORT}]}}):
212213
with self.subTest(envelope=envelope):
213214
self.assertTrue(poetry.operation_transport_failure(operation(rc=0, out=json.dumps(envelope), err="")))

0 commit comments

Comments
 (0)