{"record":{"id":"af1dea351d00c7cb","repo":"Zackriya-Solutions/meetily","slug":"sidecar-error","errorCode":null,"errorMessage":"Sidecar error: {}","messagePattern":"Sidecar error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/summary/summary_engine/client.rs","lineNumber":244,"sourceCode":"        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 {\n        log::info!(\"Detaching sidecar manager for graceful shutdown\");\n\n        // Spawn background task to wait for active requests and then kill\n        tokio::spawn(async move {\n            if let Err(e) = manager.shutdown_gracefully().await {\n                log::error!(\"Error during graceful shutdown: {}\", e);","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/summary/summary_engine/client.rs#L226-L262","documentation":"The sidecar replied with a top-level Error message instead of a Response — the request was rejected before generation started. This is transport/protocol level: a model the sidecar has not loaded, a request shape the sidecar version does not understand, or a request racing against graceful shutdown of the manager.","triggerScenarios":"Sending a model name the sidecar has not loaded; version skew between the manager and the sidecar binary after an app update; issuing a request during shutdown_sidecar_gracefully while active requests are being drained; the sidecar restarting underneath the manager.","commonSituations":"App update replaced the sidecar binary while an old manager instance persists; user closes the window as generation fires; race between download completion and sidecar model registration.","solutions":["Retry once after confirming the model is fully downloaded and the sidecar initialized with it","Restart the app (or force sidecar re-init) so manager and sidecar versions match","Check sidecar logs in the terminal/Developer console for the exact rejection reason","Check app lifecycle state before issuing generation to avoid firing during shutdown"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match generate_builtin(...).await {\n    Err(e) if e.to_string().starts_with(\"Sidecar error\") => {\n        // Request rejected pre-inference: reset sidecar, or fall back to an external provider\n        shutdown_sidecar_gracefully().await.ok();\n        generate_builtin(...).await // re-initializes a fresh sidecar\n    }\n    other => other,\n}","preventionTips":["Do not issue generation during app shutdown; check lifecycle state first","After app updates, recreate the sidecar manager so binary and manager versions match","Log sidecar stderr — top-level Error messages usually identify the rejected field"],"tags":["sidecar","llm","subprocess","rust"],"backgroundTag":"sidecar-process-error","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}