{"record":{"id":"da75a47e038d118f","repo":"cjpais/Handy","slug":"complete-model-directory-not-found","errorCode":null,"errorMessage":"Complete model directory not found: {}","messagePattern":"Complete model directory not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/model.rs","lineNumber":2612,"sourceCode":"                }\n                return Ok(local_path);\n            }\n            self.mark_model_unavailable(model_id);\n            return Err(anyhow::anyhow!(\n                \"Complete model file not found in HF cache or models dir: {}\",\n                model_id\n            ));\n        }\n\n        let model_path = self.models_dir.join(&model_info.filename);\n        let partial_path = self\n            .models_dir\n            .join(format!(\"{}.partial\", &model_info.filename));\n\n        if model_info.is_directory {\n            if !model_path.exists() || !model_path.is_dir() {\n                self.mark_model_unavailable(model_id);\n                return Err(anyhow::anyhow!(\n                    \"Complete model directory not found: {}\",\n                    model_id\n                ));\n            }\n            if partial_path.exists() {\n                return Err(anyhow::anyhow!(\n                    \"Model directory is incomplete: {}\",\n                    model_id\n                ));\n            }\n            Ok(model_path)\n        } else {\n            if !model_path.exists() {\n                self.mark_model_unavailable(model_id);\n                return Err(anyhow::anyhow!(\n                    \"Complete model file not found: {}\",\n                    model_id\n                ));","sourceCodeStart":2594,"sourceCodeEnd":2630,"githubUrl":"https://github.com/cjpais/Handy/blob/ba10ce1943ef34e93c09494027fc0b9ced2e8a44/src-tauri/src/managers/model.rs#L2594-L2630","documentation":"A directory-based model (is_directory, e.g. an extracted archive) is considered incomplete: either the final model directory does not exist / is not a directory, or a .partial marker still exists alongside it. The .partial file is the download/extract in-progress marker, so its presence vetoes the directory even if the directory itself exists.","triggerScenarios":"Extraction interrupted leaving the .partial marker behind; the extracted directory deleted or renamed by the user; extraction failed earlier (see [8]) so final_model_dir was never populated; partial file left over from a crashed download of the archive.","commonSituations":"App killed mid-extract; users manually cleaning the models dir; disk-full aborting the move from temp to final.","solutions":["Re-download the model — the pipeline cleans partials and re-extracts","If the directory is actually complete, delete the stray .partial file next to it and retry","Check earlier extraction errors in the log (model-extraction-failed) for the root cause"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// for directory models: complete dir present AND no .partial marker\nlet dir_ok = model_path.is_dir() && !partial_path.exists();\nif !dir_ok {\n    // stale .partial with an otherwise complete dir: clear the marker\n    if model_path.is_dir() && partial_path.exists() {\n        let _ = fs::remove_file(&partial_path);\n    } else {\n        anyhow::bail!(\"incomplete directory model — re-download\");\n    }\n}","typeGuard":null,"tryCatchPattern":"match manager.get_model_path(id) {\n    Err(e) if e.to_string().contains(\"directory not found\") => {\n        manager.delete_model(id)?;\n        manager.download_model(id).await?; // re-extracts cleanly\n    }\n    other => other?,\n}","preventionTips":["Treat a lingering .partial as an incomplete install: delete and re-download rather than ignoring it","Make extraction atomic (extract to temp, then rename) so .partial never survives success"],"tags":["rust","model","directory","missing-file","partial-download"],"backgroundTag":"missing-file-on-disk","analyzedSha":"ba10ce1943ef34e93c09494027fc0b9ced2e8a44","analyzedAt":"2026-09-17T15:09:05.215Z","contentChangedAt":"2026-09-17T15:09:05.215Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}