cjpais/Handy · error · anyhow::Error
Complete model directory not found: {}
Error message
Complete model directory not found: {} What it means
For directory-based (non-HF) models, get_model_path requires models_dir/<filename> to exist as a directory AND no <filename>.partial marker file next to it. The .partial file is the download-in-progress sentinel; its presence vetoes the directory even if its contents look complete. This error fires when the directory is missing or the sentinel taints it.
Source
Thrown at src-tauri/src/managers/model.rs:2524
return Ok(local_path);
}
return Err(anyhow::anyhow!(
"Complete model file not found in HF cache or models dir: {}",
model_id
));
}
let model_path = self.models_dir.join(&model_info.filename);
let partial_path = self
.models_dir
.join(format!("{}.partial", &model_info.filename));
if model_info.is_directory {
// For directory-based models, ensure the directory exists and is complete
if model_path.exists() && model_path.is_dir() && !partial_path.exists() {
Ok(model_path)
} else {
Err(anyhow::anyhow!(
"Complete model directory not found: {}",
model_id
))
}
} else {
// For file-based models (existing logic)
if model_path.exists() && !partial_path.exists() {
Ok(model_path)
} else {
Err(anyhow::anyhow!(
"Complete model file not found: {}",
model_id
))
}
}
}
pub fn cancel_download(&self, model_id: &str) -> Result<()> {View on GitHub (pinned to 98a4d80cce)
Solutions
- If the directory is actually complete, delete the stale <filename>.partial file and retry
- Otherwise re-download: delete_model(model_id) then download_model(model_id), which recreates the directory and clears the marker
- Verify models_dir actually points at the location holding the model directory, then rescan_local_models
Defensive patterns
Strategy: validation
Validate before calling
let Some(info) = model_manager.get_model_info(model_id) else {
anyhow::bail!("Model not found: {}", model_id);
};
if info.is_directory {
let dir = model_manager.models_dir.join(&info.filename);
let partial = model_manager.models_dir.join(format!("{}.partial", info.filename));
if !(dir.is_dir() && !partial.exists()) {
// incomplete directory model — trigger a fresh download instead of loading
return re_download(model_id).await;
}
} Type guard
fn directory_model_complete(mm: &ModelManager, filename: &str) -> bool {
let dir = mm.models_dir.join(filename);
let partial = mm.models_dir.join(format!("{}.partial", filename));
dir.is_dir() && !partial.exists()
} Try / catch
match model_manager.get_model_path(model_id) {
Ok(p) => Ok(p),
Err(e) if e.to_string().starts_with("Complete model directory not found") => {
// safest fallback: remove any stale marker/directory and re-download
cleanup_partial_markers(model_id);
download_model_and_wait(model_id).await?;
model_manager.get_model_path(model_id)
}
Err(e) => Err(e),
} Prevention
- Treat any <filename>.partial next to a directory model as an incomplete download
- Cancel downloads through cancel_download so markers are cleaned up by the RAII guard
- Run rescan_local_models after manually touching the models directory
When it happens
Trigger: An interrupted directory download (e.g. a Parakeet ONNX bundle) left <filename>.partial behind; the directory was deleted or never fully written; registry says is_downloaded but the directory is absent.
Common situations: App killed mid-download of a directory model; user pruned the models folder; disk-full abort while extracting the bundle.
Related errors
- Complete model file not found: {}
- Model is currently downloading: {}
- Complete model file not found in HF cache or models dir: {}
- Model not downloaded
AI-assisted analysis of cjpais/Handy@98a4d80cce (2026-08-16).
Data as JSON: /api/errors/da75a47e038d118f.
Report an issue: GitHub.