From a188fdfe9d56f7b88519d13fc11bb1c48b796caa Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Wed, 03 Jun 2026 15:31:19 +0800
Subject: [PATCH] Record Round 4 QA progress

---
 privatevoice.src/internal/model/model_test.go |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/privatevoice.src/internal/model/model_test.go b/privatevoice.src/internal/model/model_test.go
index b85c5ad..f0e822c 100644
--- a/privatevoice.src/internal/model/model_test.go
+++ b/privatevoice.src/internal/model/model_test.go
@@ -377,6 +377,20 @@
 	}
 }
 
+func TestDownloadProfileRemovesStalePartialDownload(t *testing.T) {
+	root := t.TempDir()
+	stalePath := filepath.Join(root, ".downloads", DefaultModelID, "old-run", "model_package")
+	writeTestFile(t, stalePath, "partial")
+
+	err := DownloadProfile(DefaultModelProfile(), []string{"://bad-url"}, root, nil)
+	if err == nil {
+		t.Fatal("expected download failure")
+	}
+	if _, statErr := os.Stat(filepath.Dir(stalePath)); !os.IsNotExist(statErr) {
+		t.Fatalf("stale download run still exists or stat failed: %v", statErr)
+	}
+}
+
 func TestDownloadProfileFallsBackWhenPrimaryArchiveInvalid(t *testing.T) {
 	root := t.TempDir()
 	validArchive := tarArchive(t, map[string]string{

--
Gitblit v1.9.3