Skip to content

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

feat(agent): add suppress_transcript_autoload per-turn override

oxoxDev94e297eea284
diff --git a/src/openhuman/agent/harness/session/turn/core.rs b/src/openhuman/agent/harness/session/turn/core.rs
index df745b6c60..96d752f481 100644
--- a/src/openhuman/agent/harness/session/turn/core.rs
+++ b/src/openhuman/agent/harness/session/turn/core.rs
@@ -213,7 +213,10 @@ impl Agent {
// On a fresh session (empty history), look for a previous
// transcript to pre-populate the exact provider messages for
// KV cache prefix reuse.
- if self.history.is_empty() && self.cached_transcript_messages.is_none() {
+ if self.history.is_empty()
+ && self.cached_transcript_messages.is_none()
+ && !turn_overrides.suppress_transcript_autoload
+ {
self.try_load_session_transcript();
}
diff --git a/src/openhuman/agent/harness/session/turn_tests.rs b/src/openhuman/agent/harness/session/turn_tests.rs
index a50777f3a2..a54266d96b 100644
--- a/src/openhuman/agent/harness/session/turn_tests.rs
+++ b/src/openhuman/agent/harness/session/turn_tests.rs
@@ -1198,6 +1198,7 @@ async fn turn_override_suppress_memory_agent_skips_memory_trigger() {
suppress_memory_agent: true,
suppress_tools: true,
suppress_active_goal: true,
+ suppress_transcript_autoload: false,
});
let response = agent.turn("hi there").await.expect("turn should succeed");
assert_eq!(response, "parent final");
diff --git a/src/openhuman/agent/harness/session/types.rs b/src/openhuman/agent/harness/session/types.rs
index 226e440681..89a3ffe923 100644
--- a/src/openhuman/agent/harness/session/types.rs
+++ b/src/openhuman/agent/harness/session/types.rs
@@ -54,6 +54,15 @@ pub struct TurnOverrides {
/// pre-turn `agent_memory` retrieval even when the agent's policy is
/// `Always`. The agent's built policy is left untouched for later turns.
pub suppress_memory_agent: bool,
+ /// Skip auto-resuming this turn from the agent's most-recent on-disk
+ /// transcript (`try_load_session_transcript`, which resolves the *latest*
+ /// transcript for the agent name -- NOT thread-scoped). A host that has just
+ /// re-bound the in-memory history to a different chat sets this so a cleared
+ /// history is not silently repopulated from an unrelated thread's transcript
+ /// (opencompany #1725). Thread-correct resume via
+ /// `Agent::seed_resume_from_thread_transcript` still works -- it seeds
+ /// `cached_transcript_messages`, which this path never touches.
+ pub suppress_transcript_autoload: bool,
}
/// An autonomous or semi-autonomous AI agent.