{"record":{"id":"7ff5e2c884381991","repo":"Zackriya-Solutions/meetily","slug":"generation-failed","errorCode":null,"errorMessage":"Generation failed: {}","messagePattern":"Generation failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/summary/summary_engine/client.rs","lineNumber":238,"sourceCode":"    } else {\n        manager.send_request(request_json, timeout).await?\n    };\n\n    // Check cancellation before parsing response\n    if let Some(token) = cancellation_token {\n        if token.is_cancelled() {\n            return Err(anyhow!(\"Generation cancelled\"));\n        }\n    }\n\n    // Parse response\n    let response: Response = serde_json::from_str(&response_json)\n        .with_context(|| format!(\"Failed to parse response: {}\", response_json))?;\n\n    match response {\n        Response::Response { text, error } => {\n            if let Some(err_msg) = error {\n                Err(anyhow!(\"Generation failed: {}\", err_msg))\n            } else {\n                log::info!(\"Generation completed: {} chars\", text.len());\n                Ok(text)\n            }\n        }\n        Response::Error { message } => Err(anyhow!(\"Sidecar error: {}\", message)),\n    }\n}\n\n/// Shutdown the global sidecar (graceful cleanup)\n/// Detaches the current manager and spawns a background task to drain active requests\npub async fn shutdown_sidecar_gracefully() -> Result<()> {\n    let manager_opt = {\n        let mut global_manager = SIDECAR_MANAGER.lock().await;\n        global_manager.take()\n    };\n\n    if let Some(manager) = manager_opt {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/summary/summary_engine/client.rs#L220-L256","documentation":"The built-in AI sidecar (local inference process) accepted the request but returned a response payload whose error field is set: inference started and then failed. The message comes from the sidecar itself — typical causes are context length exceeded, model load failure, invalid sampling parameters, or out-of-memory during generation.","triggerScenarios":"System prompt plus user prompt exceeding the model's context window; a corrupted or incompatible GGUF loaded by the sidecar; sampling parameters invalid for the model; the sidecar running out of memory mid-generation.","commonSituations":"Long meeting transcripts blowing past a small model's context; a model file that was resumed incorrectly after an interrupted download; low-RAM machines where mmap'd weights get evicted.","solutions":["Read the embedded sidecar message — it names the actual cause (context overflow, OOM, bad params)","Truncate or chunk the transcript so prompt + output fits the model's context window","Re-download the model if the sidecar reports a weight/format error","Restart the app or call shutdown_sidecar_gracefully then retry to reset a wedged sidecar"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match generate_builtin(...).await {\n    Err(e) if e.to_string().starts_with(\"Generation failed\") => {\n        // e carries the sidecar's own message: context overflow / OOM / bad params\n        if e.to_string().contains(\"context\") { truncate_prompt_and_retry() }\n        else { restart_sidecar_and_retry_once() }\n    }\n    other => other,\n}","preventionTips":["Estimate token count before generation and chunk/truncate long transcripts","Keep prompts well under the model's context window to leave room for output","Watch sidecar logs when failures repeat — the embedded message is the real diagnosis"],"tags":["llm","inference","sidecar","rust"],"backgroundTag":"llm-generation-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}