Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(search): give the Wikipedia fallback a timeout

purple732fd2c09328
diff --git a/src-tauri/src/commands/search.rs b/src-tauri/src/commands/search.rs
index 3ed4e08f..eee4fad4 100644
--- a/src-tauri/src/commands/search.rs
+++ b/src-tauri/src/commands/search.rs
@@ -226,7 +226,13 @@ async fn try_wikipedia(query: &str, count: usize) -> Result<Vec<SearchResult>, S
urlencoding::encode(query), count
);
- let resp = reqwest::get(&url)
+ let client = reqwest::Client::builder()
+ .timeout(std::time::Duration::from_secs(10))
+ .build()
+ .map_err(|e| e.to_string())?;
+ let resp = client
+ .get(&url)
+ .send()
.await
.map_err(|e| format!("Wikipedia: {}", e))?;