{"record":{"id":"9e63d32ea6ece3b9","repo":"Zackriya-Solutions/meetily","slug":"unknown-template","errorCode":null,"errorMessage":"Unknown template: {}","messagePattern":"Unknown template: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/summary/summary_engine/models.rs","lineNumber":305,"sourceCode":"\n/// Format a prompt using the specified template\n///\n/// # Arguments\n/// * `template_name` - Template identifier (e.g., \"gemma3\", \"chatml\", \"llama3\")\n/// * `system_prompt` - System message (instructions for the model)\n/// * `user_prompt` - User message (actual task/question)\n///\n/// # Returns\n/// Formatted prompt string ready to send to llama-helper\npub fn format_prompt(\n    template_name: &str,\n    system_prompt: &str,\n    user_prompt: &str,\n) -> Result<String> {\n    let template = match template_name {\n        \"gemma3\" => GEMMA3_TEMPLATE,\n        \"qwen3.5_nonthinking\" => QWEN35_NONTHINKING_TEMPLATE,\n        _ => return Err(anyhow!(\"Unknown template: {}\", template_name)),\n    };\n\n    let escaped_user_prompt = escape_user_prompt_control_markers(user_prompt);\n\n    let formatted = template\n        .replace(\"{system_prompt}\", system_prompt)\n        .replace(\"{user_prompt}\", &escaped_user_prompt);\n\n    Ok(formatted)\n}\n\n// ============================================================================\n// Configuration Constants\n// ============================================================================\n\n/// Default max tokens for generation (increased for better summary quality)\npub const DEFAULT_MAX_TOKENS: i32 = 4096;\n","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/summary/summary_engine/models.rs#L287-L323","documentation":"format_prompt supports exactly two chat templates: 'gemma3' and 'qwen3.5_nonthinking'. Any other template_name hits the catch-all arm and returns this error before any string formatting.","triggerScenarios":"A ModelDef whose prompt_template field is not one of the two supported literals is passed to format_prompt - typically after adding a new model to the catalog in models.rs without also adding its template constant and match arm.","commonSituations":"Extending the model catalog with a new LLM but forgetting the template; typo or wrong case in the prompt_template string; renaming a template without updating the match arms.","solutions":["Set the model's prompt_template to 'gemma3' or 'qwen3.5_nonthinking' (whichever matches its chat format)","If adding a new model, define its template constant in models.rs and add a match arm in format_prompt before shipping the catalog entry","Check for typos and case differences in the ModelDef"],"exampleFix":"// models.rs - before: new model references a template with no match arm\nconst MY_MODEL: ModelDef = ModelDef { name: \"my-model\", prompt_template: \"llama3\", /* ... */ };\n// format_prompt -> Err(\"Unknown template: llama3\")\n\n// after: add the template constant and the match arm\nconst LLAMA3_TEMPLATE: &str = \"<|system|>\\n{system_prompt}<|user|>\\n{user_prompt}<|assistant|>\";\n\npub fn format_prompt(template_name: &str, system_prompt: &str, user_prompt: &str) -> Result<String> {\n    let template = match template_name {\n        \"gemma3\" => GEMMA3_TEMPLATE,\n        \"qwen3.5_nonthinking\" => QWEN35_NONTHINKING_TEMPLATE,\n        \"llama3\" => LLAMA3_TEMPLATE,\n        _ => return Err(anyhow!(\"Unknown template: {}\", template_name)),\n    };\n    // ...\n}","handlingStrategy":"type-guard","validationCode":"const SUPPORTED_TEMPLATES: &[&str] = &[\"gemma3\", \"qwen3.5_nonthinking\"];\nif !SUPPORTED_TEMPLATES.contains(&model.prompt_template.as_str()) {\n    return Err(anyhow!(\"model {} needs template {:?}; supported: {:?}\",\n        model.name, model.prompt_template, SUPPORTED_TEMPLATES));\n}","typeGuard":"fn is_supported_template(name: &str) -> bool {\n    matches!(name, \"gemma3\" | \"qwen3.5_nonthinking\")\n}","tryCatchPattern":null,"preventionTips":["Add a startup assert that every ModelDef in the catalog has a template with a matching arm in format_prompt","Add the match arm and template constant in the same commit that adds the catalog entry","Write a unit test iterating get_available_models() asserting format_prompt succeeds for each"],"tags":["prompt","template","models","api-misuse"],"backgroundTag":"unsupported-template-name","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}