Skip to content

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

feat(queued_turn): add stable id and text preview function

Steven Enamakel34420533da42
diff --git a/crates/openhuman-core/src/agent/queued_turn.rs b/crates/openhuman-core/src/agent/queued_turn.rs
index d2128974b8..0b79a99f82 100644
--- a/crates/openhuman-core/src/agent/queued_turn.rs
+++ b/crates/openhuman-core/src/agent/queued_turn.rs
@@ -10,6 +10,11 @@
/// the host boundary when the item is pushed into TinyAgents' `RunQueue`.
#[derive(Debug, Clone)]
pub struct QueuedTurn {
+ /// Stable id for this queued item (minted once, at push time). Carried on
+ /// `RunQueue*` domain events (`item_id`) and the `queue_item_*` web-channel
+ /// events so the frontend can key a queued-message row and later target it
+ /// with `channel.web_queue_remove`.
+ pub id: String,
pub text: String,
pub client_id: String,
pub thread_id: String,
@@ -18,3 +23,11 @@ pub struct QueuedTurn {
pub temperature: Option<f64>,
pub locale: Option<String>,
}
+
+/// Clip a queued message's text to a short, non-sensitive preview for
+/// `RunQueue*` domain events and `queue_item_*` web-channel events — never
+/// the raw message body at full length.
+#[must_use]
+pub fn text_preview(text: &str) -> String {
+ crate::core::events::clip_to_chars(text, 80)
+}