Skip to content

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

chore(openhuman-core): remove unused prefix recovery helper

Steven Enamakel83ee6c063cc2
diff --git a/Cargo.lock b/Cargo.lock
index c9e77e61df..217df35604 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6529,6 +6529,7 @@ version = "2.1.2"
dependencies = [
"async-trait",
"chrono",
+ "serde_json",
"thiserror 2.0.20",
"tinyagents-harness",
"tinyagents-session",
diff --git a/crates/openhuman-core/src/agent/session_host/prefix_snapshot.rs b/crates/openhuman-core/src/agent/session_host/prefix_snapshot.rs
index f96b957935..35ec8012db 100644
--- a/crates/openhuman-core/src/agent/session_host/prefix_snapshot.rs
+++ b/crates/openhuman-core/src/agent/session_host/prefix_snapshot.rs
@@ -2,9 +2,10 @@
//!
//! The prompt is rendered once per session as cache tiers (see
//! `agent::prompts::TieredPrompt::system_messages`) and sent as one leading
-//! system message per tier. These two helpers turn a rendered prompt into
-//! that prefix and recover it from a resumed transcript, so `runtime_session`
-//! never has to know how many messages a prefix is.
+//! system message per tier. This helper turns a rendered prompt into that
+//! prefix, so `runtime_session` never has to know how many messages a prefix
+//! is. A resumed thread's prefix is restored by the tinyagents session from
+//! the transcript's leading system rows; nothing here re-derives it.
use tinyagents_runtime::PrefixSnapshot;
use tinyinference_llm::message::Message;
@@ -24,14 +25,3 @@ pub(super) fn tiered_prefix_snapshot(tiered: &TieredPrompt) -> PrefixSnapshot {
);
PrefixSnapshot::new(messages.into_iter().map(Message::system).collect())
}
-
-/// The frozen prefix of a resumed transcript: every leading system message,
-/// not only the first, because the prompt is sent as one message per tier.
-pub(super) fn leading_system_prefix(history: &[Message]) -> Option<PrefixSnapshot> {
- let leading: Vec<Message> = history
- .iter()
- .take_while(|message| matches!(message, Message::System(_)))
- .cloned()
- .collect();
- (!leading.is_empty()).then(|| PrefixSnapshot::new(leading))
-}