{"record":{"id":"0c96cc0b9710a35c","repo":"Zackriya-Solutions/meetily","slug":"unknown-model","errorCode":null,"errorMessage":"Unknown model: {}","messagePattern":"Unknown model: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/summary/summary_engine/client.rs","lineNumber":152,"sourceCode":"    app_data_dir: &PathBuf,\n    model_name: &str,\n    system_prompt: &str,\n    user_prompt: &str,\n    cancellation_token: Option<&CancellationToken>,\n) -> Result<String> {\n    // Check cancellation at start\n    if let Some(token) = cancellation_token {\n        if token.is_cancelled() {\n            return Err(anyhow!(\"Generation cancelled before starting\"));\n        }\n    }\n\n    log::info!(\"Built-in AI generation request\");\n    log::info!(\"Model: {}\", model_name);\n\n    // Get model definition\n    let model_def = models::get_model_by_name(model_name)\n        .ok_or_else(|| anyhow!(\"Unknown model: {}\", model_name))?;\n\n    // Resolve model path with caching (avoids repeated filesystem I/O)\n    let model_path = get_cached_model_path(app_data_dir, model_name)?;\n\n    // Apply model-specific chat template\n    let formatted_prompt =\n        models::format_prompt(&model_def.template, system_prompt, user_prompt)?;\n    // Get or initialize sidecar manager\n    let manager = {\n        let mut global_manager = SIDECAR_MANAGER.lock().await;\n        if global_manager.is_none() {\n            log::info!(\"Initializing sidecar manager\");\n            let new_manager = SidecarManager::new(app_data_dir.clone())?;\n            *global_manager = Some(Arc::new(new_manager));\n        }\n        global_manager.clone().unwrap()\n    };\n","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/summary/summary_engine/client.rs#L134-L170","documentation":"models::get_model_by_name performs an exact string match against the hardcoded registry; None produces this error. Valid names are 'qwen3.5:2b', 'qwen3.5:4b', 'gemma3:4b', 'gemma3:1b' — the ':size' suffix is part of the id. Any casing difference, whitespace, or a name from another engine's list fails.","triggerScenarios":"Passing 'gemma3' instead of 'gemma3:4b'; passing a whisper/parakeet model id to the summary engine; a persisted settings value referencing a model removed from the registry in a newer app version.","commonSituations":"Stored user preference survives an app update that renamed models; frontend dropdown bound to the wrong field; copy-pasted ids with stray whitespace.","solutions":["Use an exact registry name including the size suffix, e.g. 'gemma3:1b'","Populate the model picker from get_available_models()/the list-models command instead of hardcoding names in the frontend","Validate the stored preference at startup and fall back to get_default_model() when it is unknown","Trim input before passing model names across the Tauri boundary"],"exampleFix":"// caller: normalize + validate before generating\nlet model_name = model_name.trim();\nlet model_def = models::get_model_by_name(model_name)\n    .unwrap_or_else(models::get_default_model);\nlet text = client::generate_builtin(&app_data_dir, &model_def.name, sys, user, None).await?;","handlingStrategy":"validation","validationCode":"let model_name = input.trim();\nif models::get_model_by_name(model_name).is_none() {\n    return Err(anyhow!(\"Unknown model '{}' — valid: {:?}\",\n        model_name,\n        models::get_available_models().iter().map(|m| m.name.clone()).collect::<Vec<_>>()));\n}","typeGuard":"// Narrow to a known model id before calling into the engine\nfn known_model(name: &str) -> Option<&'static str> {\n    const KNOWN: [&str; 4] = [\"qwen3.5:2b\", \"qwen3.5:4b\", \"gemma3:4b\", \"gemma3:1b\"];\n    KNOWN.iter().find(|m| **m == name.trim()).copied()\n}","tryCatchPattern":null,"preventionTips":["Drive model pickers from get_available_models() so ids never drift from the registry","Validate persisted preferences at startup; reset to get_default_model() when unknown","Pass the exact id (with ':size' suffix), never the display name"],"tags":["model","validation","llm","rust"],"backgroundTag":"unknown-model-name","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}