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 tinyfish tool

Steven Enamakelc4fe2cd5329a
diff --git a/crates/openhuman-core/src/search/tools/tinyfish.rs b/crates/openhuman-core/src/search/tools/tinyfish.rs
index a2dc27db85..ee8dd15fce 100644
--- a/crates/openhuman-core/src/search/tools/tinyfish.rs
+++ b/crates/openhuman-core/src/search/tools/tinyfish.rs
@@ -13,18 +13,12 @@
use crate::integrations::IntegrationClient;
use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, 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;
-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),
- }
-}
-
fn non_empty_string<'a>(args: &'a serde_json::Value, key: &str) -> anyhow::Result<&'a str> {
args.get(key)
.and_then(|v| v.as_str())