Skip to content

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

refactor(host): remove harness memory and experience capabilities

Steven Enamakelf87d9e8795af
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
index c6c1a4bde1..d4253e84de 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
@@ -8,23 +8,21 @@
use std::sync::Arc;
use tinyagents_harness::host::{
- AgentMemory, BudgetGate, ContextComposer, ExperienceStore, HostCapabilities, LearningSink,
- ModelResolver, ProgressSink, SecurityGate, ToolOutcomeClassifier,
+ BudgetGate, ContextComposer, HostCapabilities, LearningSink, ModelResolver, ProgressSink,
+ SecurityGate, ToolOutcomeClassifier,
};
use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::hooks::PostTurnHook;
use crate::config::Config;
-use crate::memory::Memory;
use crate::security::policy::SecurityPolicy;
use crate::tools::agent_policy::ToolPolicySession;
use tinytools::Tool;
use super::{
- OpenHumanAgentMemory, OpenHumanBudgetGate, OpenHumanContextComposer,
- OpenHumanDefinitionRegistry, OpenHumanExperienceStore, OpenHumanLearningSink,
- OpenHumanModelResolver, OpenHumanProgressSink, OpenHumanRunContext, OpenHumanSecurityGate,
- OpenHumanToolOutcomeClassifier,
+ OpenHumanBudgetGate, OpenHumanContextComposer, OpenHumanDefinitionRegistry,
+ OpenHumanLearningSink, OpenHumanModelResolver, OpenHumanProgressSink, OpenHumanRunContext,
+ OpenHumanSecurityGate, OpenHumanToolOutcomeClassifier,
};
/// Runtime-owned inputs required to build every OpenHuman host capability.
@@ -38,7 +36,6 @@ pub struct OpenHumanHostBundleInputs {
pub security_policy: Arc<SecurityPolicy>,
pub tool_sets: Vec<Arc<Vec<Box<dyn Tool>>>>,
pub tool_policy: Option<Arc<ToolPolicySession>>,
- pub memory: Arc<dyn Memory>,
pub post_turn_hooks: Vec<Arc<dyn PostTurnHook>>,
/// See [`OpenHumanHostBase::session_definition`].
pub session_definition: Option<Arc<crate::agent::harness::definition::AgentDefinition>>,
@@ -54,7 +51,6 @@ pub struct OpenHumanHostBase {
pub config: Arc<Config>,
pub definitions: Arc<AgentDefinitionRegistry>,
pub security_policy: Arc<SecurityPolicy>,
- pub memory: Arc<dyn Memory>,
pub post_turn_hooks: Vec<Arc<dyn PostTurnHook>>,
/// The session's own caller-supplied definition, when it was built from one
/// rather than from a registry id — see
@@ -74,7 +70,9 @@ pub struct OpenHumanHostInvocationInputs {
pub model_resolver: Option<Arc<dyn ModelResolver<()>>>,
}
-/// OpenHuman's ten concrete capability adapters plus their erased crate bundle.
+/// OpenHuman's concrete capability adapters plus their erased crate bundle.
+/// The harness's memory and experience capabilities are left unset: memory is
+/// the `memory` tool, not a harness capability.
///
/// Typed handles make it possible to verify wiring without downcasting trait
/// objects. The runtime consumes [`Self::capabilities`]; the typed fields exist
@@ -85,12 +83,10 @@ pub struct OpenHumanHostBundle {
pub definitions: Arc<OpenHumanDefinitionRegistry>,
pub security: Arc<OpenHumanSecurityGate>,
pub models: Arc<OpenHumanModelResolver>,
- pub memory: Arc<OpenHumanAgentMemory>,
pub budget: Arc<OpenHumanBudgetGate>,
pub progress: Arc<OpenHumanProgressSink>,
pub learning: Arc<OpenHumanLearningSink>,
pub tool_outcomes: Arc<OpenHumanToolOutcomeClassifier>,
- pub experience: Arc<OpenHumanExperienceStore>,
}
/// Builds the full OpenHuman host bundle for an explicit turn.
@@ -110,7 +106,6 @@ impl OpenHumanHostBundleFactory {
security_policy: inputs.base.security_policy.clone(),
tool_sets: inputs.tool_sets,
tool_policy: inputs.tool_policy,
- memory: inputs.base.memory.clone(),
post_turn_hooks: inputs.base.post_turn_hooks.clone(),
session_definition: inputs.base.session_definition.clone(),
},
@@ -122,7 +117,7 @@ impl OpenHumanHostBundleFactory {
bundle
}
- /// Constructs all ten concrete adapters from a single session input set.
+ /// Constructs every concrete adapter from a single session input set.
///
/// The run context supplies per-turn state, while `inputs` supplies durable
/// session/runtime dependencies. No adapter is optional for OpenHuman. The
@@ -174,7 +169,6 @@ impl OpenHumanHostBundleFactory {
}
let security = Arc::new(security);
let models = Arc::new(OpenHumanModelResolver::new(Arc::clone(&inputs.config)));
- let memory = Arc::new(OpenHumanAgentMemory::new(Arc::clone(&inputs.memory)));
let budget = Arc::new(OpenHumanBudgetGate::new(Arc::clone(&inputs.config)));
// The turn's live `AgentProgress` channel is fed by exactly one
// producer: `OpenhumanEventBridge`, which `turn_runner` subscribes to
@@ -190,7 +184,6 @@ impl OpenHumanHostBundleFactory {
let progress = Arc::new(OpenHumanProgressSink::new(tokio::sync::mpsc::channel(1).0));
let learning = Arc::new(OpenHumanLearningSink::new(inputs.post_turn_hooks));
let tool_outcomes = Arc::new(OpenHumanToolOutcomeClassifier::new());
- let experience = Arc::new(OpenHumanExperienceStore::new(inputs.memory));
let capabilities = HostCapabilities::new(
context.clone() as Arc<dyn ContextComposer>,
@@ -198,12 +191,10 @@ impl OpenHumanHostBundleFactory {
security.clone() as Arc<dyn SecurityGate>,
models.clone() as Arc<dyn ModelResolver<()>>,
)
- .with_memory(memory.clone() as Arc<dyn AgentMemory>)
.with_budget(budget.clone() as Arc<dyn BudgetGate>)
.with_progress(progress.clone() as Arc<dyn ProgressSink>)
.with_learning(learning.clone() as Arc<dyn LearningSink>)
- .with_tool_outcomes(tool_outcomes.clone() as Arc<dyn ToolOutcomeClassifier>)
- .with_experience(experience.clone() as Arc<dyn ExperienceStore>);
+ .with_tool_outcomes(tool_outcomes.clone() as Arc<dyn ToolOutcomeClassifier>);
OpenHumanHostBundle {
capabilities,
@@ -211,12 +202,10 @@ impl OpenHumanHostBundleFactory {
definitions,
security,
models,
- memory,
budget,
progress,
learning,
tool_outcomes,
- experience,
}
}
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/learning_sink.rs b/crates/openhuman-core/src/agent/tinyagents/host/learning_sink.rs
index 91adb1156d..dd8a5f4aa8 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/learning_sink.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/learning_sink.rs
@@ -31,8 +31,6 @@ use crate::agent::hooks::{self, PostTurnHook, TurnContext};
/// installed is a composition decision the session builder already makes (see
/// `agent/session_host/builder/factory.rs`); duplicating that policy here
/// would give the generic runtime a second, silently divergent hook set.
-/// [`OpenHumanLearningSink::from_learning_config`] is a convenience for the
-/// hooks that need nothing but config and memory.
pub struct OpenHumanLearningSink {
/// Hooks fired, in parallel, for every completed turn.
hooks: Vec<Arc<dyn PostTurnHook>>,
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs b/crates/openhuman-core/src/agent/tinyagents/host/mod.rs
index 5499eb2fad..7b11cd8ccd 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/mod.rs
@@ -32,6 +32,7 @@ mod bundle;
pub mod context_composer;
pub mod definition_registry;
pub mod delegation;
+pub mod learning_sink;
pub mod model_resolver;
pub mod progress_sink;
pub mod run_context;
@@ -46,6 +47,7 @@ pub use bundle::{
};
pub use context_composer::OpenHumanContextComposer;
pub use definition_registry::OpenHumanDefinitionRegistry;
+pub use learning_sink::OpenHumanLearningSink;
pub use model_resolver::OpenHumanModelResolver;
pub use progress_sink::OpenHumanProgressSink;
pub(crate) use run_context::direct_subagent_child;
diff --git a/crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs b/crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs
new file mode 100644
index 0000000000..9704ce23af
--- /dev/null
+++ b/crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs
@@ -0,0 +1,103 @@
+//! Drops and eagerly re-warms the integrations cache when the user flips
+//! Composio between backend and direct mode.
+
+use async_trait::async_trait;
+use tinybus::EventHandler;
+
+use crate::config::rpc as config_rpc;
+use crate::core::events::DomainEvent;
+use crate::integrations::composio::ops;
+use crate::integrations::composio::FetchConnectedIntegrationsStatus;
+
+/// Drops the prompt-level integrations cache whenever the user flips
+/// `config.composio().mode` between `"backend"` and `"direct"` or
+/// stores/clears the direct-mode API key. Without this, the chat
+/// runtime keeps the old tenant's tool catalogue / connection list
+/// pinned until another event or process restart — that's the regression behind
+/// "I switched to Direct and my old integrations are still showing"
+/// (#1710).
+///
+/// The subscriber is intentionally tiny: it only clears the cache,
+/// then attempts a best-effort eager warm + `ComposioIntegrationsChanged`
+/// publish in a detached task so active sessions can refresh their
+/// delegation schema without waiting for the next turn boundary.
+///
+/// The warm/publish step is intentionally opportunistic: if config load
+/// or backend access fails we leave the cache cold and rely on the
+/// existing 5 s UI poll / next-turn fallback path.
+pub struct ComposioConfigChangedSubscriber;
+
+impl ComposioConfigChangedSubscriber {
+ pub fn new() -> Self {
+ Self
+ }
+}
+
+impl Default for ComposioConfigChangedSubscriber {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+#[async_trait]
+impl EventHandler<DomainEvent> for ComposioConfigChangedSubscriber {
+ fn name(&self) -> &str {
+ "composio::config_changed"
+ }
+
+ fn domains(&self) -> Option<&[&str]> {
+ Some(&["composio"])
+ }
+
+ async fn handle(&self, event: &DomainEvent) {
+ let DomainEvent::ComposioConfigChanged { mode, api_key_set } = event else {
+ return;
+ };
+
+ tracing::info!(
+ mode = %mode,
+ api_key_set = api_key_set,
+ "[composio-cache] config changed — invalidating integrations cache"
+ );
+ ops::invalidate_connected_integrations_cache();
+
+ tokio::spawn(async move {
+ let config = match config_rpc::load_config_with_timeout().await {
+ Ok(config) => config,
+ Err(error) => {
+ tracing::debug!(
+ error = %error,
+ "[composio-cache] config changed eager warm skipped: config load failed"
+ );
+ return;
+ }
+ };
+
+ match ops::fetch_connected_integrations_status(&config).await {
+ FetchConnectedIntegrationsStatus::Authoritative(entries) => {
+ let mut toolkits: Vec<String> = entries
+ .iter()
+ .filter(|entry| entry.connected)
+ .map(|entry| entry.toolkit.clone())
+ .collect();
+ toolkits.sort();
+ toolkits.dedup();
+ tinymemory_api::events::publish(
+ tinymemory_api::events::MemoryEvent::ComposioIntegrationsChanged {
+ toolkits: toolkits.clone(),
+ },
+ );
+ tracing::debug!(
+ active_toolkits = ?toolkits,
+ "[composio-cache] config changed eager warm complete; published integrations changed"
+ );
+ }
+ FetchConnectedIntegrationsStatus::Unavailable => {
+ tracing::debug!(
+ "[composio-cache] config changed eager warm skipped: backend unavailable"
+ );
+ }
+ }
+ });
+ }
+}
diff --git a/crates/openhuman-core/src/integrations/composio/bus/registration.rs b/crates/openhuman-core/src/integrations/composio/bus/registration.rs
new file mode 100644
index 0000000000..df9596dd59
--- /dev/null
+++ b/crates/openhuman-core/src/integrations/composio/bus/registration.rs
@@ -0,0 +1,66 @@
+//! Startup registration of the three long-lived Composio bus subscribers.
+
+use std::sync::{Arc, OnceLock};
+
+use tinybus::SubscriptionHandle;
+
+use crate::core::bus::BUS;
+
+use super::config_changed_subscriber::ComposioConfigChangedSubscriber;
+use super::connection_created_subscriber::ComposioConnectionCreatedSubscriber;
+use super::trigger_subscriber::ComposioTriggerSubscriber;
+
+static COMPOSIO_TRIGGER_HANDLE: OnceLock<SubscriptionHandle> = OnceLock::new();
+static COMPOSIO_CONNECTION_HANDLE: OnceLock<SubscriptionHandle> = OnceLock::new();
+static COMPOSIO_CONFIG_HANDLE: OnceLock<SubscriptionHandle> = OnceLock::new();
+
+/// Register both long-lived composio subscribers on the global event
+/// bus, and initialise the default provider registry. Idempotent.
+pub fn register_composio_trigger_subscriber() {
+ // No host-side provider registry any more. It existed so this process
+ // could answer `get_provider`; the driver answers that question now, and
+ // the module initialises its own registry in its own process
+ // (tinymemory#105) — which a `cdylib`'s separate statics require anyway.
+
+ if COMPOSIO_TRIGGER_HANDLE.get().is_none() {
+ match BUS.subscribe(Arc::new(ComposioTriggerSubscriber::new())) {
+ Some(handle) => {
+ let _ = COMPOSIO_TRIGGER_HANDLE.set(handle);
+ log::debug!("[event_bus] composio trigger subscriber registered");
+ }
+ None => {
+ log::warn!(
+ "[event_bus] failed to register composio trigger subscriber — bus not initialized"
+ );
+ }
+ }
+ }
+
+ if COMPOSIO_CONNECTION_HANDLE.get().is_none() {
+ match BUS.subscribe(Arc::new(ComposioConnectionCreatedSubscriber::new())) {
+ Some(handle) => {
+ let _ = COMPOSIO_CONNECTION_HANDLE.set(handle);
+ log::debug!("[event_bus] composio connection_created subscriber registered");
+ }
+ None => {
+ log::warn!(
+ "[event_bus] failed to register composio connection_created subscriber — bus not initialized"
+ );
+ }
+ }
+ }
+
+ if COMPOSIO_CONFIG_HANDLE.get().is_none() {
+ match BUS.subscribe(Arc::new(ComposioConfigChangedSubscriber::new())) {
+ Some(handle) => {
+ let _ = COMPOSIO_CONFIG_HANDLE.set(handle);
+ log::debug!("[event_bus] composio config_changed subscriber registered");
+ }
+ None => {
+ log::warn!(
+ "[event_bus] failed to register composio config_changed subscriber — bus not initialized"
+ );
+ }
+ }
+ }
+}
diff --git a/crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber.rs b/crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber.rs
new file mode 100644
index 0000000000..7e44ae9022
--- /dev/null
+++ b/crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber.rs
@@ -0,0 +1,294 @@
+//! Logs and (when enabled) triages `ComposioTriggerReceived` events.
+
+use async_trait::async_trait;
+use tinybus::EventHandler;
+use tinymemory_api::host::COMPOSIO_MODE_DIRECT;
+
+use crate::agent::triage::{
+ apply_decision, remote_trigger_origin, run_triage, TriageOutcome, TriggerEnvelope,
+};
+use crate::agent::turn_origin::with_origin;
+use crate::config::rpc as config_rpc;
+use crate::core::events::DomainEvent;
+use crate::integrations::composio::trigger_history;
+
+/// Env var that **disables** the triage pipeline. The pipeline is
+/// enabled by default; set to `1`/`true`/`yes` to opt out (e.g. for
+/// debugging or in environments where LLM calls on every Composio
+/// webhook are undesirable).
+pub(super) const TRIAGE_DISABLED_ENV: &str = "OPENHUMAN_TRIGGER_TRIAGE_DISABLED";
+
+/// Logs and (when enabled) routes `ComposioTriggerReceived` events
+/// through the reusable `agent::triage` pipeline.
+pub struct ComposioTriggerSubscriber;
+
+impl ComposioTriggerSubscriber {
+ pub fn new() -> Self {
+ Self
+ }
+}
+
+impl Default for ComposioTriggerSubscriber {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+#[async_trait]
+impl EventHandler<DomainEvent> for ComposioTriggerSubscriber {
+ fn name(&self) -> &str {
+ "composio::trigger"
+ }
+
+ fn domains(&self) -> Option<&[&str]> {
+ Some(&["composio"])
+ }
+
+ async fn handle(&self, event: &DomainEvent) {
+ let DomainEvent::ComposioTriggerReceived {
+ toolkit,
+ trigger,
+ metadata_id,
+ metadata_uuid,
+ payload,
+ } = event
+ else {
+ return;
+ };
+
+ tracing::debug!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ id = %metadata_id,
+ uuid = %metadata_uuid,
+ payload_bytes = payload.to_string().len(),
+ "[composio:bus] trigger received"
+ );
+
+ // [composio-direct] Direct-mode trigger gate.
+ //
+ // Inbound `composio:trigger` events ride the backend socket
+ // (`wss://api.tinyhumans.ai`) which only fans out events from
+ // the tinyhumans Composio tenant. When the user has switched
+ // to direct mode, that tenant is no longer their active source
+ // of truth — connections live on `backend.composio.dev` under
+ // their own API key, and any backend-tenant triggers that keep
+ // firing are ghosts from the prior mode. Drop them here so the
+ // user doesn't see triage runs or history entries originating
+ // from a tenant they've moved away from. Real-time triggers
+ // for direct-mode users are tracked as a follow-up — see the
+ // `composio.direct_mode_triggers_gap` capability and
+ // `periodic.rs` docstring.
+ //
+ // Fail-open on config load error: if config is unreadable, we
+ // let the event through rather than silently dropping it. The
+ // existing env-var / config triage flags below remain the
+ // backend-mode gates.
+ if let Ok(config) = config_rpc::load_config_with_timeout().await {
+ if config.composio.mode == COMPOSIO_MODE_DIRECT {
+ tracing::info!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ "[composio:trigger] dropped — direct mode active (backend-tenant event ignored)"
+ );
+ return;
+ }
+ }
+
+ if let Some(store) = trigger_history::global() {
+ let toolkit_owned = toolkit.clone();
+ let trigger_owned = trigger.clone();
+ let metadata_id_owned = metadata_id.clone();
+ let metadata_uuid_owned = metadata_uuid.clone();
+ let payload_owned = payload.clone();
+
+ match tokio::task::spawn_blocking(move || {
+ store.record(
+ &toolkit_owned,
+ &trigger_owned,
+ &metadata_id_owned,
+ &metadata_uuid_owned,
+ &payload_owned,
+ )
+ })
+ .await
+ {
+ Ok(Ok(_)) => {}
+ Ok(Err(error)) => {
+ tracing::warn!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ error = %error,
+ "[composio][history] failed to archive trigger"
+ );
+ }
+ Err(error) => {
+ tracing::warn!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ error = %error,
+ "[composio][history] failed to join archive task"
+ );
+ }
+ }
+ } else {
+ tracing::debug!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ "[composio][history] archive store not initialized"
+ );
+ }
+
+ if triage_disabled() {
+ tracing::debug!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ "[composio][triage] skipped: {TRIAGE_DISABLED_ENV} is set"
+ );
+ return;
+ }
+
+ // Config-level triage gates — checked after env var so the env var
+ // remains a global emergency kill-switch that works even when the
+ // config file is corrupt. Fail-open on load error: if we can't read
+ // the config we let triage run rather than silently drop events.
+ match config_rpc::load_config_with_timeout().await {
+ Ok(config) => {
+ if config.composio.triage_disabled {
+ tracing::debug!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ "[composio][triage] skipped: composio.triage_disabled=true in config"
+ );
+ return;
+ }
+ let toolkit_lower = toolkit.to_ascii_lowercase();
+ if config
+ .composio
+ .triage_disabled_toolkits
+ .iter()
+ .any(|t| t.to_ascii_lowercase() == toolkit_lower)
+ {
+ tracing::debug!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ "[composio][triage] skipped: toolkit in composio.triage_disabled_toolkits"
+ );
+ return;
+ }
+ }
+ Err(e) => {
+ tracing::warn!(
+ toolkit = %toolkit,
+ trigger = %trigger,
+ error = %e,
+ "[composio][triage] config load failed — falling through to triage (fail-open)"
+ );
+ }
+ }
+
+ // Build the envelope outside the spawned task so any panic in
+ // `from_composio` surfaces on the bus dispatch thread (where
+ // the broadcast subscriber loop can log it) rather than being
+ // swallowed inside a detached task.
+ let envelope = TriggerEnvelope::from_composio(
+ toolkit,
+ trigger,
+ metadata_id,
+ metadata_uuid,
+ payload.clone(),
+ );
+ tracing::debug!(
+ label = %envelope.display_label,
+ external_id = %envelope.external_id,
+ "[composio][triage] dispatching to agent::triage::run_triage"
+ );
+
+ // Spawn so the bus dispatch loop stays non-blocking — the
+ // triage turn is an LLM round-trip that may take seconds.
+ tokio::spawn(async move {
+ match run_triage(&envelope).await {
+ Ok(TriageOutcome::Decision(run)) => {
+ // Remote payload: a Composio trigger body is
+ // attacker-influenceable, so the dispatch parks rather than
+ // running on a trust root (#5634). Scoped here, inside the
+ // spawned task, because `AGENT_TURN_ORIGIN` is a task-local
+ // and does not cross `tokio::spawn`.
+ let origin = remote_trigger_origin(&envelope);
+ if let Err(e) = with_origin(origin, apply_decision(run, &envelope)).await {
+ tracing::error!(
+ label = %envelope.display_label,
+ error = %e,
+ "[composio][triage] apply_decision failed"
+ );
+ }
+ }
+ Ok(TriageOutcome::Deferred {
+ defer_until_ms,
+ reason,
+ }) => {
+ // Tiered fallback exhausted both arms; the caller
+ // surface (composio bus) has no scheduler of its
+ // own — log and drop. The next composio fire will
+ // re-enter the chain.
+ tracing::warn!(
+ label = %envelope.display_label,
+ defer_until_ms = defer_until_ms,
+ reason = %reason,
+ "[composio][triage] run_triage deferred"
+ );
+ }
+ Ok(TriageOutcome::Terminal { reason }) => {
+ tracing::warn!(
+ label = %envelope.display_label,
+ reason = %reason,
+ "[composio][triage] run_triage reached terminal state"
+ );
+ }
+ Err(e) => {
+ // Route through the central observability classifier
+ // so user-config / budget-exhausted / provider-state
+ // rollups from `reliable.rs` (e.g. `The model
+ // \`<id>\` may not be available on your provider …`)
+ // get demoted to info-level breadcrumbs instead of
+ // surfacing as raw Sentry errors. Previously this
+ // call used `tracing::error!` directly and bypassed
+ // the classifier — 10.7k events / 14d on self-hosted
+ // Sentry TAURI-RUST-1V, dominated by
+ // ProviderConfigRejection-class rollups whose inner
+ // attempts the provider layer already demoted.
+ let detail = format!(
+ "[composio][triage] run_triage failed (label={}): {e:#}",
+ envelope.display_label
+ );
+ // The classifier named here is the host's own. The
+ // engine crate exposes a `report_error_or_expected` of its
+ // own, but that is a global slot for *extracted* code to
+ // report through — installed by whichever process embeds
+ // the engine, which since #5560 is the loaded TinyMemory
+ // module and no longer this one (`memory/host_impls.rs`,
+ // the host's installer, is deleted; `modules/memory_host.rs`
+ // is the bus-served twin). This subscriber is host code, so
+ // the detour buys nothing and only costs an engine
+ // dependency the seam is trying to shed.
+ crate::core::observability::report_error_or_expected(
+ detail.as_str(),
+ "composio",
+ "trigger_triage",
+ &[("label", envelope.display_label.as_str())],
+ );
+ }
+ }
+ });
+ }
+}
+
+/// Returns `true` when `OPENHUMAN_TRIGGER_TRIAGE_DISABLED` is set to a
+/// truthy value. The pipeline is **on by default**; this env var is the
+/// opt-out escape hatch.
+pub(super) fn triage_disabled() -> bool {
+ matches!(
+ std::env::var(TRIAGE_DISABLED_ENV).ok().as_deref(),
+ Some("1") | Some("true") | Some("TRUE") | Some("yes") | Some("YES")
+ )
+}