The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: remove dead code across the codebase
Steven Enamakel9409b80fff1d
diff --git a/crates/openhuman-core/src/agent/context/manager.rs b/crates/openhuman-core/src/agent/context/manager.rsindex 92962ebfcd..959cd55061 100644--- a/crates/openhuman-core/src/agent/context/manager.rs+++ b/crates/openhuman-core/src/agent/context/manager.rs@@ -240,22 +240,6 @@ impl ContextManager {self.default_prompt_builder.build_tiered(ctx)}- /// Assemble the system prompt via a caller-supplied builder.- ///- /// Sub-agents pass `SystemPromptBuilder::for_subagent(...)` and- /// channels pass `with_defaults()` chained with a- /// `ChannelCapabilitiesSection`. Either way the builder itself- /// lives in [`super::prompt`] — no caller needs to know how- /// sections are composed internally.- pub fn build_system_prompt_with(- &self,- builder: &SystemPromptBuilder,- ctx: &PromptContext<'_>,- ) -> Result<String> {- let prompt = builder.build(ctx)?;- Ok(prompt)- }-// ─── Observability ─────────────────────────────────────────────/// Read-only snapshot of the current budget state.diff --git a/crates/openhuman-core/src/agent/harness/fork_context.rs b/crates/openhuman-core/src/agent/harness/fork_context.rsindex 3ad06b8cd3..f38e00ae66 100644--- a/crates/openhuman-core/src/agent/harness/fork_context.rs+++ b/crates/openhuman-core/src/agent/harness/fork_context.rs@@ -199,28 +199,3 @@ where// the explicit usage ledger on `OpenHumanRunContext`.PARENT_CONTEXT.scope(ctx, Box::pin(future)).await}--/// Returns the one-shot context-preparation sources that have already run for-/// the current parent turn (a snapshot of the live list).-pub fn current_agent_context_prepared_sources() -> Vec<AgentContextPreparedSource> {- AGENT_CONTEXT_PREPARED_SOURCES- .try_with(|sources| sources.as_ref().clone())- .unwrap_or_default()-}--/// Run `future` with the current turn's already-prepared context sources-/// installed.-pub async fn with_agent_context_prepared_sources<F, R>(- sources: Vec<AgentContextPreparedSource>,- future: F,-) -> R-where- F: std::future::Future<Output = R>,-{- // Box before `scope` so only a pointer moves into the task-local frame- // rather than the whole nested turn generator — see the measurements on- // the explicit usage ledger on `OpenHumanRunContext`.- AGENT_CONTEXT_PREPARED_SOURCES- .scope(Arc::new(sources), Box::pin(future))- .await-}diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops.rsindex 9f667c7ef6..852ea6f564 100644--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops.rs+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops.rs@@ -55,14 +55,6 @@ pub fn list_definitions() -> WorkflowDefinitionListResponse {}}-pub fn validate_definition(definition: &WorkflowDefinition) -> Vec<DefinitionError> {- let mut errors = validate_structure(definition);- if let Some(registry) = AgentDefinitionRegistry::global() {- errors.extend(validate_agents(definition, |id| registry.get(id).is_some()));- }- errors-}-pub fn list_runs(config: &Config,request: &WorkflowRunListRequest,diff --git a/crates/openhuman-core/src/agent/orchestration/worktree.rs b/crates/openhuman-core/src/agent/orchestration/worktree.rsindex 5f88966966..6b27cd0506 100644--- a/crates/openhuman-core/src/agent/orchestration/worktree.rs+++ b/crates/openhuman-core/src/agent/orchestration/worktree.rs@@ -178,36 +178,6 @@ impl WorkspaceIsolation for OpenHumanWorktreeIsolation {}}-/// Fail-closed workspace path gate that mirrors-/// [`WorkspaceDescriptor::enforce`] but routes the violation onto OpenHuman's-/// global event bus instead of the SDK [`EventSink`], so audit/observability-/// subscribers see out-of-root rejections.-///-/// This is a **carrier-side check only** — it publishes a-/// [`DomainEvent::WorkspaceViolation`] and returns an error when `path` escapes-/// the descriptor's allowed roots. It does **not** replace the authoritative-/// enforcement done by `SecurityPolicy`/landlock; it is an additional-/// observability + fail-closed signal keyed on the descriptor the isolated run-/// carries.-///-/// [`EventSink`]: tinyagents_harness::events::EventSink-pub fn enforce_workspace_path(- descriptor: &WorkspaceDescriptor,- path: &Path,-) -> std::result::Result<(), WorkspacePathError> {- if descriptor.allows(path) {- return Ok(());- }- let rendered = path.display().to_string();- tracing::warn!(- path = %rendered,- policy_id = %descriptor.policy_id,- "[workspace] workspace_violation"- );- BUS.publish(DomainEvent::WorkspaceViolation { path: rendered });- Err(WorkspacePathError::OutsideWorkspace(path.to_path_buf()))-}-/// Rejection from [`enforce_workspace_path`].////// Separate from `GitWorktreeError` (which is TinyAgents' git-plumbing error)diff --git a/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rs b/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rsindex 84ad6e977b..a4e60aebd2 100644--- a/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rs+++ b/crates/openhuman-core/src/agent/prompts/render_helpers/section_renderers.rs@@ -25,19 +25,6 @@ pub fn render_user_files(ctx: &PromptContext<'_>) -> Result<String> {UserFilesSection.build(ctx)}-/// Render the tree-summariser user-memory block.-pub fn render_user_memory(ctx: &PromptContext<'_>) -> Result<String> {- UserMemorySection.build(ctx)-}--/// Render the `## Project instructions (AGENTS.md)` block from the pre-loaded-/// global + local content on [`PromptContext`]. Empty when neither layer-/// carries content. Dynamic `agents/<id>/prompt.rs` builders call this so they-/// inherit the same AGENTS.md injection as the default section chain.-pub fn render_agents_md(ctx: &PromptContext<'_>) -> Result<String> {- AgentsInstructionsSection.build(ctx)-}-/// Render the privileged `## User Reflections` block. Empty when the/// learning subsystem has not captured any reflections yet.pub fn render_user_reflections(ctx: &PromptContext<'_>) -> Result<String> {@@ -56,14 +43,6 @@ pub fn render_safety() -> String {.expect("SafetySection::build is infallible")}-/// Render the canonical grounding / anti-hallucination contract-/// ([`GROUNDING_BODY`]). Dynamic `agents/<id>/prompt.rs` builders call this-/// so they inherit the exact same anti-fabrication floor as the static-/// section chain — single source of truth, no drift.-pub fn render_grounding() -> &'static str {- GROUNDING_BODY-}-// `render_skills` and `render_connected_integrations` helpers are// gone — the connected-integrations / delegation-guide blocks each live in// their owning agent's `prompt.rs` so no branching-on-agent-id logicdiff --git a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rsindex 5a154ff911..0bdf422176 100644--- a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs@@ -69,15 +69,6 @@ impl OpenHumanSessionHost {Arc::clone(&self.tools)}- /// Clone the agent's synthesised delegation tools `Arc`.- ///- /// Replaced wholesale on every [`OpenHumanSessionHost::refresh_delegation_tools`], so a- /// clone taken here is a stable snapshot for the rest of the caller's turn- /// even if the connection set changes underneath it.- pub fn synthesized_tools_arc(&self) -> Arc<Vec<Box<dyn Tool>>> {- Arc::clone(&self.synthesized_tools)- }-/// Every tool this agent can execute: the durable registry first, then the/// synthesised delegation set — the same order as [`Self::tool_specs`] and/// turn dispatch.@@ -171,19 +162,6 @@ impl OpenHumanSessionHost {})}- /// Whether the config-dependent capability adapters can be built from this- /// session.- ///- /// Four of the ten host capabilities (`BudgetGate`, `ContextComposer`,- /// `ModelResolver`, and the policy half of `SecurityGate`) need a full- /// `Config`, which only the factory path supplies. This is the one-line- /// check a caller uses before reaching for them, so "this session cannot- /// answer that" stays distinguishable from "the capability failed" — the- /// same absence-versus-failure rule the traits themselves are built on.- pub fn host_capabilities_available(&self) -> bool {- self.runtime_config.is_some()- }-/// The agent's working directory.pub fn workspace_dir(&self) -> &std::path::Path {&self.workspace_dirdiff --git a/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rs b/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rsindex 9ef929dd66..4fdfce61aa 100644--- a/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rs@@ -135,36 +135,4 @@ impl OpenHumanSessionHost {}}- /// Runs an interactive CLI loop, reading from standard input and printing to standard output.- ///- /// This method starts a persistent session where the user can chat with the agent- /// directly from the console. It handles input until a termination command- /// (e.g., `/quit`) is received.- pub async fn run_interactive(&mut self) -> Result<()> {- println!("🦀 OpenHuman Interactive Mode");- println!("Type /quit to exit.\n");-- let (tx, mut rx) = tokio::sync::mpsc::channel(32);- let cli = crate::channels::CliChannel::new();-- let listen_handle = tokio::spawn(async move {- let _ = crate::channels::Channel::listen(&cli, tx).await;- });-- while let Some(msg) = rx.recv().await {- match self.run_single(&msg.content).await {- Ok(response) => println!("\n{response}\n"),- Err(e) => {- // `run_single` already publishes `AgentError` and- // sanitises the payload; surface a concise line here- // for the CLI user and continue the loop.- eprintln!("\nError: {e}\n");- continue;- }- }- }-- listen_handle.abort();- Ok(())- }}diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rsindex 7039db58c3..85bf7d911a 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs@@ -176,13 +176,6 @@ impl OpenHumanContextComposer {self}- /// Attaches a pre-fetched learned-context snapshot — see the TODO on- /// [`Self::learned`].- pub fn with_learned_context(mut self, learned: LearnedContextData) -> Self {- self.learned = learned;- self- }-/// Loads the two AGENTS.md layers, honouring the `agents_md_enabled` gate.////// Split out so the gate has exactly one enforcement point and the testsdiff --git a/crates/openhuman-core/src/agent/triage/evaluator/chain.rs b/crates/openhuman-core/src/agent/triage/evaluator/chain.rsindex 7db582dad9..36df152441 100644--- a/crates/openhuman-core/src/agent/triage/evaluator/chain.rs+++ b/crates/openhuman-core/src/agent/triage/evaluator/chain.rs@@ -95,23 +95,6 @@ pub async fn run_triage(envelope: &TriggerEnvelope) -> anyhow::Result<TriageOutcoutcome}-/// Production entry point that takes already-resolved arms and acquires-/// the global LLM permit via [`scheduler_gate::wait_for_capacity`].-///-/// Use [`run_triage_with_arms_for_test`] in tests to bypass the shared-/// semaphore. This function is `pub` for integration callers outside-/// this module that supply pre-resolved providers.-pub async fn run_triage_with_arms(- cloud: ResolvedProvider,- local: Option<ResolvedProvider>,- envelope: &TriggerEnvelope,-) -> anyhow::Result<TriageOutcome> {- run_triage_with_arms_inner(cloud, local, envelope, Some(retry_state()), || {- crate::cron::scheduler_gate::wait_for_capacity()- })- .await-}-/// Test-only entry point: skip the global LLM permit acquisition so the/// triage tests don't contend with `scheduler_gate`'s process-wide/// 1-slot semaphore or get trapped by a stale `Paused` policy left indiff --git a/crates/openhuman-core/src/agent/triage/routing.rs b/crates/openhuman-core/src/agent/triage/routing.rsindex ab1ea1fb56..fb9278b83e 100644--- a/crates/openhuman-core/src/agent/triage/routing.rs+++ b/crates/openhuman-core/src/agent/triage/routing.rs@@ -39,15 +39,6 @@ pub struct ResolvedProvider {// ── Public API ──────────────────────────────────────────────────────────-/// Resolve a provider for a single triage turn. Always returns the remote-/// backend — local AI is hard-disabled for the chat/triage path.-pub async fn resolve_provider() -> anyhow::Result<ResolvedProvider> {- let config = Config::load_or_init()- .await- .context("loading config for triage provider resolution")?;- resolve_provider_with_config(&config).await-}-/// Inner half of [`resolve_provider`] that takes an already-loaded/// [`Config`]. Exposed for tests and for the evaluator's retry path.pub async fn resolve_provider_with_config(config: &Config) -> anyhow::Result<ResolvedProvider> {diff --git a/crates/openhuman-core/src/channels/host/mod.rs b/crates/openhuman-core/src/channels/host/mod.rsindex 1d9aaa36b7..587531bb09 100644--- a/crates/openhuman-core/src/channels/host/mod.rs+++ b/crates/openhuman-core/src/channels/host/mod.rs@@ -57,16 +57,6 @@ pub fn build_channel_host(config: Arc<Config>) -> Arc<dyn ChannelHost> {.build()}-/// Build the [`ProviderContext`] handed to a channel provider at construction:-/// the assembled host + the channels config + a pre-built HTTP client.-pub fn build_provider_context(config: &Config, http_client: reqwest::Client) -> ProviderContext {- ProviderContext::new(- build_channel_host(Arc::new(config.clone())),- config.channels_config.clone(),- http_client,- )-}-#[cfg(test)]#[path = "host_tests.rs"]mod tests;diff --git a/crates/openhuman-core/src/config/schema/load/dirs.rs b/crates/openhuman-core/src/config/schema/load/dirs.rsindex 9a91f000cc..70352b8ef7 100644--- a/crates/openhuman-core/src/config/schema/load/dirs.rs+++ b/crates/openhuman-core/src/config/schema/load/dirs.rs@@ -48,11 +48,6 @@ fn default_root_dir_name() -> &'static str {}}-#[cfg(test)]-pub(crate) fn default_root_dir_name_pub() -> &'static str {- default_root_dir_name()-}-/// Returns the root openhuman directory (`~/.openhuman`), independent of any/// per-user scoping. Used to locate `active_user.toml` and the shared/// `users/` tree.diff --git a/crates/openhuman-core/src/cron/scheduler_gate/gate.rs b/crates/openhuman-core/src/cron/scheduler_gate/gate.rsindex bba5a2efd3..a1129731ee 100644--- a/crates/openhuman-core/src/cron/scheduler_gate/gate.rs+++ b/crates/openhuman-core/src/cron/scheduler_gate/gate.rs@@ -290,16 +290,6 @@ impl Drop for SignedOutTestGuard {}}-/// Most recent sampled signals, or a neutral default if the sampler hasn't run.-pub fn current_signals() -> Signals {- STATE.get().map(|s| s.read().signals()).unwrap_or(Signals {- on_ac_power: true,- battery_charge: None,- cpu_usage_pct: 0.0,- server_mode: false,- })-}-/// Cooperatively block a caller until the host is ready for LLM-bound/// work, then hand back an [`LlmPermit`] that holds a slot in the global/// LLM semaphore.diff --git a/crates/openhuman-core/src/inference/provider/ops/provider_factory.rs b/crates/openhuman-core/src/inference/provider/ops/provider_factory.rsindex a03c88e8e5..b4f51e92bb 100644--- a/crates/openhuman-core/src/inference/provider/ops/provider_factory.rs+++ b/crates/openhuman-core/src/inference/provider/ops/provider_factory.rs@@ -41,28 +41,3 @@ pub fn list_providers() -> Vec<ProviderInfo> {}// Legacy provider alias stubs (integrations / config); remote providers were removed.-pub fn is_glm_alias(_name: &str) -> bool {- false-}-pub fn is_zai_alias(_name: &str) -> bool {- false-}-pub fn is_minimax_alias(_name: &str) -> bool {- false-}-pub fn is_moonshot_alias(_name: &str) -> bool {- false-}-pub fn is_qianfan_alias(_name: &str) -> bool {- false-}-pub fn is_qwen_alias(_name: &str) -> bool {- false-}-pub fn is_qwen_oauth_alias(_name: &str) -> bool {- false-}-pub fn canonical_china_provider_name(_name: &str) -> Option<&'static str> {- let _ = _name;- None-}diff --git a/crates/openhuman-core/src/inference/provider/types.rs b/crates/openhuman-core/src/inference/provider/types.rsindex a2a5cce2d6..4d077831d6 100644--- a/crates/openhuman-core/src/inference/provider/types.rs+++ b/crates/openhuman-core/src/inference/provider/types.rs@@ -70,35 +70,3 @@ pub enum ProviderDelta {/// natural end well below the cap on normal turns — while cutting the/// reservation 4× versus a 64k window.pub const AGENT_TURN_MAX_OUTPUT_TOKENS: u32 = 16384;--/// Request payload for provider chat calls.-///-/// The system prompt is built once at session start and frozen for the-/// rest of the session — the inference backend's automatic prefix-/// cache covers the whole thing, so there is no explicit cache-boundary-/// to thread through the request.-#[derive(Debug, Clone, Copy)]-pub struct ChatRequest<'a> {- pub messages: &'a [ChatMessage],- pub tools: Option<&'a [ToolSpec]>,- /// Optional sink for `ProviderDelta` events. When `Some`, providers- /// that support streaming will ask the upstream API for SSE and- /// forward fine-grained events here. Providers without a streaming- /// implementation ignore the sender and return only the aggregated- /// response.- pub stream: Option<&'a tokio::sync::mpsc::Sender<ProviderDelta>>,- /// Optional upper bound on output tokens to request from the provider- /// (`max_tokens` on the OpenAI-compatible wire).- ///- /// Left `None` only for the orchestrator's open-ended generation. Agent- /// turns cap at [`AGENT_TURN_MAX_OUTPUT_TOKENS`] and callers whose output- /// is bounded by construction set a small concrete value — notably memory- /// extraction, whose response is a tiny structured-JSON object.- /// Beyond capping wasted generation, this stops credit-metered providers- /// (e.g. OpenRouter) from reserving the model's *entire* output window- /// during their pre-flight balance check: an unset `max_tokens` makes- /// OpenRouter price the request against the full 64k+ window and 402 a- /// low-balance BYO user who could easily afford the few thousand tokens- /// the turn actually needs (TAURI-RUST-C62).- pub max_tokens: Option<u32>,-}diff --git a/crates/openhuman-core/src/integrations/client/construct.rs b/crates/openhuman-core/src/integrations/client/construct.rsindex 4fbdbf5a4c..a5ce4166e6 100644--- a/crates/openhuman-core/src/integrations/client/construct.rs+++ b/crates/openhuman-core/src/integrations/client/construct.rs@@ -79,18 +79,6 @@ impl IntegrationClient {Self::new_inner(backend_url, credential, None)}- pub fn new_with_budget_config(- backend_url: String,- auth_token: String,- config: Arc<crate::config::Config>,- ) -> Self {- Self::new_inner(- backend_url,- crate::security::credentials::session_support::BackendCredential::Session(auth_token),- Some(config),- )- }-/// Credential-aware variant of [`Self::new_with_budget_config`].pub fn new_with_credential_and_budget_config(backend_url: String,diff --git a/crates/openhuman-core/src/integrations/composio/ops/user_scopes.rs b/crates/openhuman-core/src/integrations/composio/ops/user_scopes.rsindex 35a7a53298..b8a10bec8c 100644--- a/crates/openhuman-core/src/integrations/composio/ops/user_scopes.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/user_scopes.rs@@ -55,86 +55,6 @@ fn kv_key(toolkit: &str) -> String {toolkit.trim().to_ascii_lowercase()}-/// The scope pref stored for `toolkit`, or the default when none is.-///-/// **This read fails open, and that is inherited behaviour, not a new-/// decision.** The engine's `load` documented it: "the agent should always be-/// able to use connected integrations productively, even if pref storage is-/// temporarily unavailable". Every failure mode — no driver, no `Graph` family,-/// a backend error, a row that will not deserialise — lands on the same default-/// (`read+write`, no `admin`) that a user who has never opened the toggle gets.-/// Each is logged with its own reason so "defaulted because nothing is stored"-/// stays distinguishable from "defaulted because the store is down".-///-/// The opposite choice would be worse: a failed read is not evidence that the-/// user revoked anything, and refusing every integration on a transient KV-/// error would break a working app to protect a preference it could not see.-/// The **write** below does not fail open — see [`save`].-pub(crate) async fn load_or_default(config: &Config, toolkit: &str) -> UserScopePref {- let key = kv_key(toolkit);- if key.is_empty() {- return UserScopePref::default();- }-- let binding = match crate::memory::binding::for_config(config) {- Ok(binding) => binding,- Err(error) => {- tracing::warn!(- toolkit = %key,- %error,- "[composio][scopes] memory driver unavailable, using default pref (read+write)"- );- return UserScopePref::default();- }- };- let Some(graph) = binding.provider().as_graph() else {- tracing::warn!(- toolkit = %key,- driver = binding.driver_id(),- "[composio][scopes] driver does not serve Graph, using default pref (read+write)"- );- return UserScopePref::default();- };-- match graph.kv_get(Some(KV_NAMESPACE), &key).await {- Ok(Some(record)) => match serde_json::from_value::<UserScopePref>(record.value) {- Ok(pref) => {- tracing::debug!(- toolkit = %key,- read = pref.read,- write = pref.write,- admin = pref.admin,- "[composio][scopes] pref loaded"- );- pref- }- Err(error) => {- tracing::warn!(- toolkit = %key,- %error,- "[composio][scopes] pref deserialize failed, falling back to default"- );- UserScopePref::default()- }- },- Ok(None) => {- tracing::debug!(- toolkit = %key,- "[composio][scopes] no pref stored, using default (read+write)"- );- UserScopePref::default()- }- Err(error) => {- tracing::warn!(- toolkit = %key,- %error,- "[composio][scopes] kv_get failed, falling back to default"- );- UserScopePref::default()- }- }-}-/// Persist the scope pref for `toolkit`.////// **This one fails closed.** A write that reported success without storingdiff --git a/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs b/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rsindex 2aa796b13a..bd617d62e1 100644--- a/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs+++ b/crates/openhuman-core/src/memory/tree/tree_runtime/ops.rs@@ -350,38 +350,6 @@ pub(crate) fn create_provider(.map_err(|e| format!("tree summarizer: failed to build cloud provider: {e:#}"))}-/// Whether a summarization provider can be resolved for "Build Summary Trees"-/// under the current config — the single source of truth the memory doctor-/// reuses so its `summary_tree` stage matches the runtime path (#002 FR-007).-///-/// Routes through [`create_provider`] (the SAME resolver the runtime uses):-/// - local AI enabled ⇒ available (local Ollama path).-/// - local AI off + `memory_tree.cloud_summarization_opt_in = true` ⇒-/// available iff the configured summarization-role provider resolves.-/// - local AI off + opt-in `false` (default) ⇒ unavailable — explicit-/// consent required before routing workspace memory summaries to a cloud-/// provider. Enable via the `memory_tree.cloud_summarization_opt_in` setting.-///-/// The provider built for the `Ok` check is dropped — construction is cheap-/// (no network) and confirming by build beats guessing.-pub fn summarizer_available(config: &Config) -> (bool, &'static str) {- let local = config.local_ai.runtime_enabled;- match create_provider(config) {- Ok(_) if local => (- true,- "local AI enabled — Build Summary Trees runs on the local model",- ),- Ok(_) => (- true,- "local AI off — Build Summary Trees runs on the configured cloud provider",- ),- Err(_) => (- false,- "no summarization provider available — enable local AI, or opt in to cloud summarization (memory_tree.cloud_summarization_opt_in) with a provider set in Connections → API keys → LLM",- ),- }-}-#[cfg(test)]#[path = "ops_tests.rs"]mod tests;diff --git a/crates/openhuman-core/src/platform/cost/types.rs b/crates/openhuman-core/src/platform/cost/types.rsindex 07e80cbae5..4bdc1b207d 100644--- a/crates/openhuman-core/src/platform/cost/types.rs+++ b/crates/openhuman-core/src/platform/cost/types.rs@@ -102,14 +102,6 @@ impl TokenUsage {}}-/// Time period for cost aggregation.-#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]-pub enum UsagePeriod {- Session,- Day,- Month,-}-/// A single cost record for persistent storage.#[derive(Debug, Clone, Serialize, Deserialize)]pub struct CostRecord {diff --git a/crates/openhuman-core/src/runtime/python/bootstrap.rs b/crates/openhuman-core/src/runtime/python/bootstrap.rsindex f4461a0426..1a421c5a46 100644--- a/crates/openhuman-core/src/runtime/python/bootstrap.rs+++ b/crates/openhuman-core/src/runtime/python/bootstrap.rs@@ -162,19 +162,6 @@ impl PythonBootstrap {self.adopt(&resolved)}- /// Launch a long-lived stdio Python child.- ///- /// # Errors- ///- /// When the interpreter cannot be resolved, or the child cannot be spawned.- pub async fn spawn_stdio(- &self,- spec: &super::process::PythonLaunchSpec,- ) -> Result<tokio::process::Child> {- let resolved = self.resolve().await?;- super::process::spawn_stdio_process(&resolved, spec)- }-/// Adapt a module resolution and remember it.fn adopt(&self, resolved: &ResolvedRuntime) -> Result<ResolvedPython> {let adapted = ResolvedPython::from_module(resolved)?;diff --git a/crates/openhuman-core/src/security/live_policy.rs b/crates/openhuman-core/src/security/live_policy.rsindex c4b5c75c3d..7b0c76d3a8 100644--- a/crates/openhuman-core/src/security/live_policy.rs+++ b/crates/openhuman-core/src/security/live_policy.rs@@ -182,74 +182,6 @@ pub fn generation() -> u64 {.map_or(0, |s| s.generation.load(Ordering::Relaxed))}-/// Swap in a new `action_dir` and rebuild the live policy around it,-/// bumping the generation counter. Used by-/// [`config_set_action_dir`](crate::config::ops::set_action_dir)-/// (issue #3240) so a Settings-driven change of the agent's writable root-/// takes effect immediately instead of waiting for the next session.-///-/// Returns the new generation on success, or `Err` if no policy is-/// installed yet (typically a CLI-only invocation that never started a-/// session runtime).-pub fn update_action_dir(new_action_dir: PathBuf) -> Result<u64, String> {- let Some(state) = STATE.get() else {- return Err(- "[security:live_policy] no policy installed yet — cannot update action_dir".into(),- );- };- {- let mut guard = state- .action_dir- .write()- .map_err(|e| format!("[security:live_policy] action_dir lock poisoned: {e}"))?;- *guard = new_action_dir.clone();- }- // Rebuild the policy by cloning the current one and swapping the- // action_dir field. This preserves the entire autonomy + trusted_roots- // + forbidden_paths state — the only thing changing is the sandbox root.- let current_policy = state- .policy- .read()- .map(|g| Arc::clone(&g))- .map_err(|e| format!("[security:live_policy] policy lock poisoned: {e}"))?;- let mut rebuilt: SecurityPolicy = (*current_policy).clone();- let previous_action_dir = rebuilt.action_dir.clone();- rebuilt.action_dir = new_action_dir.clone();- // The action dir is a granted read-write root (see- // `SecurityPolicy::from_config`), and this path does not go through- // `from_config` — so move the grant with the root. Without both halves a- // Settings-driven working-folder change either leaves writes refused in the- // new folder, or leaves the old folder writable after the user moved off it.- let previous_path = previous_action_dir.to_string_lossy().to_string();- rebuilt- .trusted_roots- .retain(|r| r.path != previous_path || previous_action_dir == new_action_dir);- let new_path = new_action_dir.to_string_lossy().to_string();- let covers_workspace = rebuilt.workspace_dir.starts_with(&new_action_dir);- if !new_path.is_empty()- && !covers_workspace- && !rebuilt.trusted_roots.iter().any(|r| r.path == new_path)- {- rebuilt.trusted_roots.push(crate::security::TrustedRoot {- path: new_path,- access: crate::security::TrustedAccess::ReadWrite,- });- }- {- let mut guard = state- .policy- .write()- .map_err(|e| format!("[security:live_policy] policy write lock poisoned: {e}"))?;- *guard = Arc::new(rebuilt);- }- let gen = state.generation.fetch_add(1, Ordering::Relaxed) + 1;- tracing::info!(- generation = gen,- "[security:live_policy] SecurityPolicy reloaded after action_dir change"- );- Ok(gen)-}-/// Rebuild the policy from `autonomy_config` against the stored workspace dir/// and swap it in, bumping the generation counter. No-op if nothing has been/// installed yet (e.g. a CLI invocation that never started a session runtime).diff --git a/crates/openhuman-core/src/skills/ops_parse.rs b/crates/openhuman-core/src/skills/ops_parse.rsindex a93dfe570d..91440e64ef 100644--- a/crates/openhuman-core/src/skills/ops_parse.rs+++ b/crates/openhuman-core/src/skills/ops_parse.rs@@ -5,11 +5,3 @@ use std::path::Path;use super::ops_types::WorkflowFrontmatter;pub use tinyskills::inventory_resources;--pub fn parse_workflow_md(path: &Path) -> Option<(WorkflowFrontmatter, String, Vec<String>)> {- tinyskills::parse_skill(path)-}--pub fn parse_workflow_md_str(content: &str) -> Option<(WorkflowFrontmatter, String, Vec<String>)> {- tinyskills::parse_skill_str(content)-}diff --git a/crates/openhuman-core/src/tools/timeout/mod.rs b/crates/openhuman-core/src/tools/timeout/mod.rsindex 5be47eb790..d796bdc595 100644--- a/crates/openhuman-core/src/tools/timeout/mod.rs+++ b/crates/openhuman-core/src/tools/timeout/mod.rs@@ -172,19 +172,6 @@ pub fn explicit_call_timeout_duration(requested: Option<u64>, cap: u64) -> Optio/// reported on a timeout is the un-padded request.const TOOL_TIMEOUT_GRACE_SECS: u64 = 5;-/// Resolve a tool's [`ToolTimeout`] policy into the `(deadline, timeout_secs)`-/// pair the agent tool-execution loop enforces:-/// - `Inherit` → the global config-driven timeout (a finite deadline).-/// - `Millis(req)` → the clamped request, padded by [`TOOL_TIMEOUT_GRACE_SECS`]-/// for the actual deadline while `timeout_secs` reports the un-padded budget.-/// - `Unbounded` → `(None, 0)`: no deadline; the tool runs to completion.-///-/// Moved out of the retired legacy `engine::tools` module during the tinyagents-/// migration (issue #4249); it lives here next to the timeout constants it uses.-pub fn resolve_tool_deadline(policy: ToolTimeout) -> (Option<Duration>, u64) {- resolve_with(settings(), policy)-}-/// Pure core of [`resolve_tool_deadline`]: the inherited timeout is a parameter/// so tests can table-drive it without touching the process-global.#[cfg(test)]diff --git a/crates/openhuman-core/src/tools/toolpacks/groups.rs b/crates/openhuman-core/src/tools/toolpacks/groups.rsindex 68f7fdcb68..3d4c6fdc36 100644--- a/crates/openhuman-core/src/tools/toolpacks/groups.rs+++ b/crates/openhuman-core/src/tools/toolpacks/groups.rs@@ -165,28 +165,6 @@ impl ToolGroups {/// [`CoreContext`]: crate::core::runtime::context::CoreContextstatic PROCESS_GROUPS: std::sync::OnceLock<ToolGroups> = std::sync::OnceLock::new();-/// Declare the process-wide groups without standing up a [`CoreContext`].-///-/// For an **embedder that does its own tool routing**: a host which registers-/// its own tools and gates them itself gains nothing from pack withholding and-/// pays the capability for it. That is the audience-/// [`ToolGroups::advertised`] already names, and until this existed it was the-/// one audience that could not reach it — the only public way to set the groups-/// is [`CoreContext::init_with_config`], which is `async`, while the places-/// that read them are not: a roster build, an agent build (packs are stripped-/// in `builder_build`, long before any turn), and an embedder's own synchronous-/// test fixtures.-///-/// First call wins, matching `DEFAULT_CONTEXT`'s own rule. A scoped context-/// still takes precedence in [`current`], so multi-tenant dispatch is-/// unaffected: this changes only what a caller with **no** context resolves to.-///-/// [`CoreContext`]: crate::core::runtime::context::CoreContext-/// [`CoreContext::init_with_config`]: crate::core::runtime::context::CoreContext::init_with_config-pub fn set_process_default(groups: ToolGroups) {- let _ = PROCESS_GROUPS.set(groups);-}-/// The ambient groups for the running core.////// Resolution order: the scoped [`CoreContext`], then the process default fromdiff --git a/crates/openhuman-core/src/util/text.rs b/crates/openhuman-core/src/util/text.rsindex ab85a17123..450af1d32e 100644--- a/crates/openhuman-core/src/util/text.rs+++ b/crates/openhuman-core/src/util/text.rs@@ -3,25 +3,6 @@//! UTF-8-safe truncation, char-boundary rounding, and the non-leaky//! provenance tag used by the cross-chat context block.-/// Render a short, non-leaky provenance tag for a session/thread id.-///-/// The channel-side `session_id` is typically a JSON blob-/// (`{"client_id": "...", "thread_id": "..."}`); rendering it verbatim-/// in a model prompt or log line would leak the raw `client_id` /-/// socket UUID. Hash the input with `DefaultHasher` and emit only the-/// low 32 bits as `chat:xxxxxxxx` — short, stable per id, and not-/// reversible to the original blob.-///-/// Used by the cross-chat context block (issue #1505) so the prompt-/// can attribute hits without surfacing raw identifiers.-pub fn provenance_tag(session_id: &str) -> String {- use std::hash::{Hash, Hasher};- let mut hasher = std::collections::hash_map::DefaultHasher::new();- session_id.hash(&mut hasher);- let h = hasher.finish();- format!("chat:{:08x}", (h & 0xFFFF_FFFF) as u32)-}-/// Truncate a string to at most `max_chars` characters, appending "..." if truncated.////// This function safely handles multi-byte UTF-8 characters (emoji, CJK, accented characters)@@ -56,17 +37,6 @@ pub fn truncate_with_ellipsis(s: &str, max_chars: usize) -> String {truncate_with_suffix(s, max_chars, "...")}-/// Truncate `s` to at most `max_chars` characters (UTF-8-safe), returning the-/// truncated slice plus whether truncation actually happened — so a caller-/// can append its own marker only when needed, instead of always appending a-/// fixed suffix like [`truncate_with_suffix`].-pub fn truncate_chars_flagged(s: &str, max_chars: usize) -> (&str, bool) {- match s.char_indices().nth(max_chars) {- Some((byte_idx, _)) => (&s[..byte_idx], true),- None => (s, false),- }-}-/// Truncate a string to at most `max_chars` characters, appending `suffix` if truncated.pub fn truncate_with_suffix(s: &str, max_chars: usize, suffix: &str) -> String {match s.char_indices().nth(max_chars) {diff --git a/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs b/crates/openhuman-core/src/voice/audio_toolkit/schemas.rsindex 6432b755f2..8e3522bc62 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs+++ b/crates/openhuman-core/src/voice/audio_toolkit/schemas.rs@@ -27,14 +27,6 @@ struct GenerateAndEmailParams {attachment_name: Option<String>,}-pub fn all_audio_toolkit_controller_schemas() -> Vec<ControllerSchema> {- vec![- audio_toolkit_schemas("generate_podcast"),- audio_toolkit_schemas("email_podcast"),- audio_toolkit_schemas("generate_and_email_podcast"),- ]-}-pub fn all_audio_toolkit_registered_controllers() -> Vec<RegisteredController> {vec![RegisteredController {