Skip to content

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

fix(search): handle empty search results in parallel search

Steven Enamakel9b701c7c41a0
diff --git a/crates/openhuman-core/src/search/tools/parallel/search.rs b/crates/openhuman-core/src/search/tools/parallel/search.rs
index a2e04a0bb9..fc80fedf06 100644
--- a/crates/openhuman-core/src/search/tools/parallel/search.rs
+++ b/crates/openhuman-core/src/search/tools/parallel/search.rs
@@ -2,17 +2,11 @@
use crate::integrations::IntegrationClient;
use crate::tools::traits::{Tool, ToolResult};
+use crate::util::truncate_chars_flagged as truncate_chars;
use async_trait::async_trait;
use serde::Deserialize;
use serde_json::json;
use std::sync::Arc;
-
-/// UTF-8 safe truncation: returns the truncated slice and whether it was truncated.
-pub(super) fn truncate_chars(s: &str, max_chars: usize) -> (&str, bool) {
- match s.char_indices().nth(max_chars) {
- Some((byte_idx, _)) => (&s[..byte_idx], true),
- None => (s, false),
- }
}
// ── Response types ──────────────────────────────────────────────────