Skip to content

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

fix(agent): handle missing session host in builder

Steven Enamakel167eb62eb594
diff --git a/crates/openhuman-core/src/agent/session_host/builder/setters.rs b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
index f9703ed259..53844d4220 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/setters.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
@@ -1,10 +1,8 @@
//! `SessionHostBuilder` fluent setters. See `builder_build.rs` for the `build()`
//! validator that assembles the final `OpenHumanSessionHost`.
-use crate::agent::harness::TriggerMemoryAgent;
use crate::agent::session_host::types::SessionHostBuilder;
use crate::config::ContextConfig;
-use crate::memory::Memory;
use std::sync::Arc;
use tinytools::Tool;
@@ -18,8 +16,6 @@ impl SessionHostBuilder {
visible_tool_names: None,
deferred_tools: Vec::new(),
subagent_tool_ceiling_names: None,
- memory: None,
- auto_recall: None,
prompt_builder: None,
tool_dispatcher: None,
config: None,
@@ -31,23 +27,17 @@ impl SessionHostBuilder {
action_dir: None,
workspace_descriptor: None,
workflows: None,
- auto_save: None,
post_turn_hooks: Vec::new(),
- learning_enabled: false,
- explicit_preferences_enabled: true,
event_session_id: None,
event_channel: None,
agent_definition_name: None,
session_definition: None,
session_parent_prefix: None,
session_history_locator: None,
- omit_profile: None,
- omit_memory_md: None,
+ omit_memory_context: None,
payload_summarizer: None,
- trigger_memory_agent: None,
tokenjuice_compression: crate::inference::tokenjuice::AgentTokenjuiceCompression::Full,
tool_policy: None,
- archivist_hook: None,
}
}
@@ -115,22 +105,6 @@ impl SessionHostBuilder {
self
}
- /// Sets the memory system for the agent.
- pub fn memory(mut self, memory: Arc<dyn Memory>) -> Self {
- self.memory = Some(memory);
- self
- }
-
- /// Binds Lane C, the gated pre-turn auto-recall of facts about the user
- /// (#6040). `None` leaves the lane out of the turn entirely.
- pub fn auto_recall(
- mut self,
- auto_recall: Option<Arc<crate::memory::auto_recall::AutoRecall>>,
- ) -> Self {
- self.auto_recall = auto_recall;
- self
- }
-
/// Sets the system prompt builder for the agent.
pub fn prompt_builder(
mut self,
@@ -210,12 +184,6 @@ impl SessionHostBuilder {
self
}
- /// Enables or disables automatic saving of conversation history to memory.
- pub fn auto_save(mut self, auto_save: bool) -> Self {
- self.auto_save = Some(auto_save);
- self
- }
-
/// Sets the post-turn hooks to be executed after each turn.
pub fn post_turn_hooks(
mut self,
@@ -225,22 +193,6 @@ impl SessionHostBuilder {
self
}
- /// Enables or disables learning features.
- pub fn learning_enabled(mut self, enabled: bool) -> Self {
- self.learning_enabled = enabled;
- self
- }
-
- /// Enables or disables explicit-preference injection.
- ///
- /// When `true` (the default), preferences stored via `remember_preference`
- /// are fetched from the `user_profile` namespace and injected into the
- /// system prompt on every turn, independent of `learning_enabled`.
- pub fn explicit_preferences_enabled(mut self, enabled: bool) -> Self {
- self.explicit_preferences_enabled = enabled;
- self
- }
-
/// Sets the event-bus `session_id` and `channel` used to tag
/// `DomainEvent`s emitted by this agent.
///
@@ -356,20 +308,11 @@ impl SessionHostBuilder {
self
}
- /// Forward the target agent definition's `omit_profile` flag so
- /// [`OpenHumanSessionHost::build_system_prompt`] can decide whether to inject
- /// `PROFILE.md`. Only opt-in agents (welcome, orchestrator, the
- /// trigger pair) should set this to `false`.
- pub fn omit_profile(mut self, omit: bool) -> Self {
- self.omit_profile = Some(omit);
- self
- }
-
- /// Forward the target agent definition's `omit_memory_md` flag so
- /// [`OpenHumanSessionHost::build_system_prompt`] can decide whether to inject
- /// `MEMORY.md`. Same opt-in set as `omit_profile`.
- pub fn omit_memory_md(mut self, omit: bool) -> Self {
- self.omit_memory_md = Some(omit);
+ /// Forward the target agent definition's `omit_memory_context` flag: when
+ /// `true`, a new session does not get `context.md` prepended to its first
+ /// user message.
+ pub fn omit_memory_context(mut self, omit: bool) -> Self {
+ self.omit_memory_context = Some(omit);
self
}
@@ -387,12 +330,6 @@ impl SessionHostBuilder {
self
}
- /// Forward the target agent definition's pre-turn memory policy.
- pub fn trigger_memory_agent(mut self, policy: TriggerMemoryAgent) -> Self {
- self.trigger_memory_agent = Some(policy);
- self
- }
-
/// Installs pre-execution policy middleware for tool calls.
///
/// The default policy allows all calls. Custom policies can deny a call
@@ -402,24 +339,6 @@ impl SessionHostBuilder {
self
}
- /// Attach the production [`ArchivistHook`] instance so the session
- /// turn loop can call [`ArchivistHook::flush_open_segment`] at
- /// session-wind-down time, guaranteeing the trailing open segment is
- /// always finalized with an LLM recap + embedding.
- ///
- /// Set from `build_session_agent_inner` when
- /// `config.learning.episodic_capture_enabled` is `true` and a
- /// SQLite connection is available. Callers that construct an `OpenHumanSessionHost`
- /// directly (tests, CLI) can leave this `None` — flush is a no-op
- /// when the hook is absent.
- pub fn archivist_hook(
- mut self,
- hook: Option<Arc<crate::agent::harness::archivist::ArchivistHook>>,
- ) -> Self {
- self.archivist_hook = hook;
- self
- }
-
/// Set the per-agent TokenJuice tool-output compression profile.
pub fn tokenjuice_compression(
mut self,