Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(threads): simplify search query construction

Steven Enamakelf01e7b851b3c
diff --git a/crates/openhuman-core/src/threads/ops/search.rs b/crates/openhuman-core/src/threads/ops/search.rs
index 7a18984fbb..008e0a9214 100644
--- a/crates/openhuman-core/src/threads/ops/search.rs
+++ b/crates/openhuman-core/src/threads/ops/search.rs
@@ -6,6 +6,7 @@
//! message, so a broad query never ships every long transcript to the UI.
use super::crud::transcript_search;
+use crate::core::runtime::DispatchCtx;
use super::support::envelope;
use crate::core::Outcome;
use crate::threads::ApiEnvelope;
@@ -45,6 +46,7 @@ pub struct ThreadSearchResponse {
/// See the module docs. A blank query answers no hits without reading.
pub async fn thread_search(
+ ctx: &DispatchCtx,
request: ThreadSearchRequest,
) -> Result<Outcome<ApiEnvelope<ThreadSearchResponse>>, String> {
let query = request.query.trim();
@@ -56,7 +58,7 @@ pub async fn thread_search(
));
}
let limit = request.limit.unwrap_or(DEFAULT_LIMIT).clamp(1, MAX_LIMIT);
- let hits = transcript_search(query, limit, None)
+ let hits = transcript_search(ctx, query, limit, None)
.await?
.into_iter()
.map(|hit| ThreadSearchHit {