π Problem Statement
Knowte verifies Ollama is running during the initial setup wizard (curl http://localhost:11434/api/tags). However, after setup completes and the app is in normal use, if Ollama:
- Crashes or is killed by the OS (common on low-RAM machines processing large models)
- Is restarted on a different port
- Has its model unloaded
...the next LLM call from the Rust backend (src-tauri/) will fail with a low-level HTTP connection error. Without a graceful handler, this surfaces as either a frozen UI or an unhandled Rust panic.
π‘ Proposed Fix
Add a pre-inference health check in the Tauri command handler:
// src-tauri/src/llm.rs
use reqwest::Client;
async fn check_ollama_health(ollama_url: &str) -> Result<(), String> {
let client = Client::new();
match client
.get(format!("{}/api/tags", ollama_url))
.timeout(std::time::Duration::from_secs(3))
.send()
.await
{
Ok(resp) if resp.status().is_success() => Ok(()),
Ok(resp) => Err(format!("Ollama returned status {}", resp.status())),
Err(e) => Err(format!(
"Cannot reach Ollama at {}. Is it running? Error: {}",
ollama_url, e
)),
}
}
#[tauri::command]
pub async fn generate_notes(transcript: String, model: String) -> Result<String, String> {
check_ollama_health("http://localhost:11434").await?;
// ... proceed with LLM call
}
Surface the error in the frontend as a dismissible banner:
// src/components/OllamaStatusBanner.tsx
{ollamaError && (
<div className="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded">
β οΈ Ollama is not running. Start it with <code>ollama serve</code> and retry.
</div>
)}
π Files to Modify
| File |
Change |
src-tauri/src/llm.rs |
Add check_ollama_health before every LLM invocation |
src/components/OllamaStatusBanner.tsx |
New β user-visible connectivity error banner |
src/ |
Propagate Tauri error string to UI state |
Suggested labels: bug, reliability, tauri, ux
I would like to work on this. Could you please assign it to me?
π Problem Statement
Knowte verifies Ollama is running during the initial setup wizard (
curl http://localhost:11434/api/tags). However, after setup completes and the app is in normal use, if Ollama:...the next LLM call from the Rust backend (
src-tauri/) will fail with a low-level HTTP connection error. Without a graceful handler, this surfaces as either a frozen UI or an unhandled Rust panic.π‘ Proposed Fix
Add a pre-inference health check in the Tauri command handler:
Surface the error in the frontend as a dismissible banner:
π Files to Modify
src-tauri/src/llm.rscheck_ollama_healthbefore every LLM invocationsrc/components/OllamaStatusBanner.tsxsrc/Suggested labels:
bug,reliability,tauri,uxI would like to work on this. Could you please assign it to me?