fix: detect completed downloads via byte comparison

When scanning existing download status, a download could report
status "in_progress" or "not_started" even though all bytes have
been downloaded. This adds a fallback check: if downloaded >= total
bytes (and total > 0), treat it as completed regardless of the
reported status string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Cheema
2026-02-21 07:21:44 -08:00
parent 1780e4ade4
commit 3b54e7dfa7

View File

@@ -388,7 +388,9 @@ class DownloadCoordinator:
if model_id in self.active_downloads:
continue
if progress.status == "complete":
if progress.status == "complete" or (
progress.downloaded.in_bytes >= progress.total.in_bytes > 0
):
status: DownloadProgress = DownloadCompleted(
node_id=self.node_id,
shard_metadata=progress.shard,