Skip to content

feat([issue-5855]): sweep abandoned resumable-download leftovers - #5868

Merged
atomanticagent merged 1 commit into
mainfrom
next/issue-5855
Sep 2, 2026
Merged

feat([issue-5855]): sweep abandoned resumable-download leftovers#5868
atomanticagent merged 1 commit into
mainfrom
next/issue-5855

Conversation

@atomanticagent

Copy link
Copy Markdown
Collaborator

Summary

  • Add sweepOrphanedPartials so leftover ${dest}.partial files (and their .partial.etag sidecars) older than 7 days are removed from the dirs the resumable-download path can write to: LoRAs, spec-decode GGUF parents, Ollama, and LM Studio.
  • Wire a delayed boot pass plus a daily tick in bootstrap.js (same createSweepScheduler shape as the image-refs / image-clean GCs). Recent files and in-flight spec-decode dests are never touched.
  • Focused unit tests cover old-removed, recent-kept, in-flight-protected, missing-dir, nested trees, and sidecar cleanup.

Closes #5855

Test plan

  • cd server && npx vitest run lib/downloadPreflight.test.js — 32 passed
  • Boot a running install, confirm orphaned-partial-gc is scheduled (no deletion of a fresh .partial)
  • Place a 8-day-old .partial (+ .etag) under data/loras/ and confirm the next sweep removes both without touching neighboring complete files

Dropped LoRA and GGUF transfers were leaving invisible .partial files on disk forever. A boot + daily age-gated pass now removes ones older than a week, while recent and in-flight downloads stay put.
@atomanticagent
atomanticagent merged commit 989ea4b into main Sep 2, 2026
7 checks passed
@atomanticagent
atomanticagent deleted the next/issue-5855 branch September 2, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sweep orphaned .partial downloads left by the resumable-download preflight

1 participant