fix(skills_hub): clawhub 429 keeps a zero Retry-After as zero

The rebase resolution used 'parsed or 5', which turned a legitimate 0 s
(negative headers clamp to 0) into the 5 s default; the pre-refactor code
kept it. Test None explicitly.
This commit is contained in:
teknium1
2026-09-12 22:40:16 -07:00
committed by Teknium
parent 164c5ea142
commit db5827e3d2
+2 -1
View File
@@ -491,7 +491,8 @@ class ClawHubSource(GuardedFetchMixin, SkillSource):
if resp is None:
return files
if resp.status_code == 429:
retry_after = max(0, min(int(parse_retry_after_seconds(resp.headers) or 5), 15)) # Cap wait time
parsed = parse_retry_after_seconds(resp.headers)
retry_after = min(int(5 if parsed is None else parsed), 15) # Cap wait time
logger.debug(
"ClawHub download rate-limited for %s, retrying in %ds (attempt %d/%d)",
slug, retry_after, attempt + 1, max_retries,