Skip to content

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

refactor(core): remove unused context module

Steven Enamakelae3f0f1f8a4f
diff --git a/crates/openhuman-core/src/core/runtime/context.rs b/crates/openhuman-core/src/core/runtime/context.rs
index 4ec83a3d25..d2a7179565 100644
--- a/crates/openhuman-core/src/core/runtime/context.rs
+++ b/crates/openhuman-core/src/core/runtime/context.rs
@@ -103,6 +103,10 @@ pub struct CoreContext {
backend_transport: Option<Arc<dyn crate::backend::transport::BackendTransport>>,
/// Explicit authority on this derived turn context.
turn_origin: Option<crate::agent::turn_origin::AgentTurnOrigin>,
+ /// The agent whose stores a host-installed session store
+ /// ([`crate::agent::session_store`]) hands out to work under this
+ /// context. `None` for booted contexts, which use the shared default.
+ session_agent: Option<String>,
}
/// Per-agent overrides layered onto a booted context by
@@ -130,6 +134,9 @@ pub struct ContextOverlay {
pub tool_groups: crate::tools::toolpacks::ToolGroups,
/// Scan the operator's user-scope skill roots (`true` = today's behaviour).
pub user_skill_roots: bool,
+ /// The agent a host session store scopes this context's transcripts,
+ /// journal, goals and todos to. `None` keeps the parent's.
+ pub session_agent: Option<String>,
}
impl ContextOverlay {
@@ -144,6 +151,7 @@ impl ContextOverlay {
domains,
tool_groups,
user_skill_roots: true,
+ session_agent: None,
}
}
@@ -153,6 +161,12 @@ impl ContextOverlay {
self.user_skill_roots = false;
self
}
+
+ /// Scope a host session store to `agent_id` under the derived context.
+ pub fn session_agent(mut self, agent_id: impl Into<String>) -> Self {
+ self.session_agent = Some(agent_id.into());
+ self
+ }
}
/// The workspace a context is bound to.
@@ -420,9 +434,16 @@ impl CoreContext {
user_skill_roots: overlay.user_skill_roots,
backend_transport: self.backend_transport.clone(),
turn_origin: self.turn_origin.clone(),
+ session_agent: overlay.session_agent.or_else(|| self.session_agent.clone()),
})
}
+ /// The agent a host session store scopes work under this context to, if
+ /// this context was derived for one.
+ pub fn session_agent(&self) -> Option<&str> {
+ self.session_agent.as_deref()
+ }
+
/// The backend transport bound to this context, if the host supplied one.
pub fn backend_transport(
&self,