Skip to content

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

Merge remote-tracking branch 'pr7963/main' into backend-to-tinyhumans

Steven Enamakel249db2e9bff8
diff --cc crates/openhuman-core/src/agent/artifacts/mod.rs
index e9d1886fc9,a694f06549..d282216bf4
--- a/crates/openhuman-core/src/agent/artifacts/mod.rs
+++ b/crates/openhuman-core/src/agent/artifacts/mod.rs
@@@ -3,10 -3,11 +3,12 @@@ pub mod migrate
pub mod ops;
pub mod preview;
pub mod production;
+pub mod publisher_slot;
pub mod schemas;
+ mod storage_schema;
pub mod store;
mod store_documents;
+ pub use storage_schema::storage_schema;
pub mod tiny_store;
pub mod types;
pub mod version_documents;
diff --cc crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
index 55e0446b0b,ee4aed20df..d59525fdff
--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
@@@ -417,11 -419,12 +419,11 @@@ pub(crate) struct HarnessHostPolicy
#[cfg(test)]
pub(crate) use super::operation_context::tool_context_with_approval;
-pub use super::operation_context::OpenHumanRunExt;
+pub use super::operation_context::{approval_for_tool, OpenHumanRunExt};
pub(crate) use super::operation_context::{
- dispatch_ctx_for_tool, memory_identity_for_tool, memory_in_prompt_for_tool,
- parent_agent_id_for_tool, sandbox_mode_for_tool, task_recency_window_for_tool,
- turn_origin_for_tool, HostOperationContext,
- approval_for_tool, command_environment_for_tool, dispatch_ctx_for_tool,
- memory_identity_for_tool, memory_in_prompt_for_tool, parent_agent_id_for_tool,
- sandbox_mode_for_tool, task_recency_window_for_tool, turn_origin_for_tool,
- HostOperationContext,
++ command_environment_for_tool, dispatch_ctx_for_tool, memory_identity_for_tool,
++ memory_in_prompt_for_tool, parent_agent_id_for_tool, sandbox_mode_for_tool,
++ task_recency_window_for_tool, turn_origin_for_tool, HostOperationContext,
};
impl Default for OpenHumanRunContext {
diff --cc crates/openhuman-core/src/memory/mod.rs
index 97cec408cd,c85d5269ab..8603b6a0d9
--- a/crates/openhuman-core/src/memory/mod.rs
+++ b/crates/openhuman-core/src/memory/mod.rs
@@@ -28,10 -28,8 +28,9 @@@ pub mod confine
pub(crate) mod convert;
pub mod deletion;
pub mod engine;
+pub mod engine_registry;
pub mod error;
pub mod explore;
- pub(crate) mod files;
pub mod guard;
pub mod import;
pub mod layout_migration;
diff --cc crates/openhuman-embed/src/host_internals.rs
index 170b042611,dd6fdbcd6e..3270d8912d
--- a/crates/openhuman-embed/src/host_internals.rs
+++ b/crates/openhuman-embed/src/host_internals.rs
@@@ -435,6 -282,6 +428,11 @@@ pub mod mcp
}
pub mod platform {
++ /// tinyhumans (managed inference): the signed-out gate.
++ pub mod llm_gate {
++ pub use openhuman_core::platform::llm_gate::is_signed_out;
++ }
++
pub mod connectivity {
pub mod rpc {
pub use openhuman_core::platform::connectivity::rpc::{
diff --cc crates/openhuman-tinyhumans/src/inference/managed_model.rs
index 839f25ea63,0000000000..a51443a0df
mode 100644,000000..100644
--- a/crates/openhuman-tinyhumans/src/inference/managed_model.rs
+++ b/crates/openhuman-tinyhumans/src/inference/managed_model.rs
@@@ -1,389 -1,0 +1,389 @@@
+//! The managed TinyHumans inference model as a host [`ChatModel`] (issue #4727,
+//! Motion B), owned by this crate and registered with the core's chat-model
+//! registry ([`super::register`]).
+//!
+//! The managed backend can't be a plain crate `OpenAiModel` preset: it uses a
+//! **dynamic** session JWT (fetched per call), emits the `thread_id` extension so
+//! the backend groups InferenceLog entries + aligns KV-cache keys, and relies on
+//! the `openhuman.usage/billing` response envelope for charged-USD / cached-token
+//! accounting. This `ChatModel` bridges all three onto the crate wire client:
+//!
+//! * **Dynamic JWT**: `invoke`/`stream` resolve the current bearer and build a
+//! fresh crate `OpenAiModel` (Bearer) per call ([`managed_session`](super::managed_session)).
+//! * **`thread_id`**: injected into `ModelRequest.provider_options` so the crate
+//! flattens it into the request body as the top-level `thread_id` field.
+//! * **Billing envelope**: [`managed_usage`](super::managed_usage) re-projects the
+//! `openhuman.{billing,usage}` envelope into the shape the cost bridge reads.
+
+use std::path::PathBuf;
+use std::time::Duration;
+
+use tinyinference_llm::message::Message;
+use tinyinference_llm::model::{ChatModel, Modalities, ModelProfile, ModelRequest, ProviderError};
+use tinyinference_llm::providers::openai::OpenAiModel;
+use tinyinference_llm::providers::ProviderRequestOptions;
+use tinyinference_llm::Error as TiError;
+
+use openhuman_embed::__host::security::credentials::{AuthService, APP_SESSION_PROVIDER};
+
+use super::managed_session::managed_bearer;
+use crate::backend::url::effective_api_url;
+use crate::client::endpoint::is_managed_endpoint_for_api_key;
+
+/// Provider label the wire client stamps on its errors.
+pub const PROVIDER_LABEL: &str = "OpenHuman";
+
+/// Where the managed model reads its credentials from.
+#[derive(Debug, Clone, Default)]
+pub struct ManagedOptions {
+ /// Directory holding the credential store (`auth-profiles.json`, API key).
+ /// `None` resolves the process default (`~/.openhuman`).
+ pub openhuman_dir: Option<PathBuf>,
+ /// Whether the credential store is encrypted at rest.
+ pub secrets_encrypt: bool,
+ /// An auth-profile name to use instead of the default app session.
+ pub auth_profile_override: Option<String>,
+}
+
+/// connection settings (for JWT + base-URL resolution) and the default model id
+/// sent when a request doesn't override it.
+pub struct OpenHumanBackendModel {
+ options: ManagedOptions,
+ api_url: Option<String>,
+ pub(super) default_model: String,
+ native_tool_calling: bool,
+ pub(super) profile: ModelProfile,
+ /// Normalized OpenHuman conversation thread. This is deliberately owned by
+ /// the managed backend model: BYOK and third-party models must never see
+ /// this backend-only extension.
+ pub(super) thread_id: Option<String>,
+}
+
+impl OpenHumanBackendModel {
+ pub fn new(
+ api_url: Option<&str>,
+ options: &ManagedOptions,
+ default_model: impl Into<String>,
+ ) -> Self {
+ Self {
+ options: options.clone(),
+ api_url: api_url
+ .map(str::trim)
+ .filter(|url| !url.is_empty())
+ .map(ToOwned::to_owned),
+ default_model: resolve_model(&default_model.into()),
+ native_tool_calling: true,
+ profile: ModelProfile {
+ provider: Some("managed".to_string()),
+ modalities: Modalities {
+ image_in: true,
+ ..Modalities::default()
+ },
+ tool_calling: true,
+ parallel_tool_calls: true,
+ streaming: true,
+ streaming_tool_chunks: true,
+ ..ModelProfile::default()
+ },
+ thread_id: None,
+ }
+ }
+
+ /// Attach the explicit run thread used by OpenHuman's managed inference
+ /// endpoint. Blank values mean no backend thread rather than an empty wire
+ /// field.
+ pub fn with_thread_id(mut self, thread_id: Option<impl AsRef<str>>) -> Self {
+ self.thread_id = thread_id.and_then(|thread_id| {
+ let thread_id = thread_id.as_ref().trim();
+ (!thread_id.is_empty()).then(|| thread_id.to_owned())
+ });
+ self
+ }
+
+ /// Force prompt-guided tool calling for toolsets that exceed the managed
+ /// backend's native grammar ceiling.
+ pub fn with_native_tool_calling(mut self, enabled: bool) -> Self {
+ self.native_tool_calling = enabled;
+ self.profile.tool_calling = enabled;
+ self.profile.parallel_tool_calls = enabled;
+ self.profile.streaming_tool_chunks = enabled;
+ self
+ }
+
+ pub(super) fn state_dir(&self) -> PathBuf {
+ self.options.openhuman_dir.clone().unwrap_or_else(|| {
+ directories::UserDirs::new()
+ .map(|dirs| dirs.home_dir().join(".openhuman"))
+ .unwrap_or_else(|| PathBuf::from(".openhuman"))
+ })
+ }
+
+ pub(super) fn resolve_bearer(&self) -> anyhow::Result<String> {
+ use openhuman_embed::__host::security::credentials::session_support::classify_session_token;
+
+ // A stored API key (library runtime) is the bearer outright: the
+ // OpenAI-compatible managed endpoint accepts it as `Bearer <key>`,
+ // and there is no session — so no `exp` and no signed-out state — to
+ // consult.
+ if let Some(key) = openhuman_embed::__host::security::credentials::api_key::get_api_key_in(
+ &self.state_dir(),
+ self.options.secrets_encrypt,
+ )? {
+ // Refuse to send the key over a plaintext channel it could leak
+ // from. Scoped to this managed-key path only — `base_url()`
+ // comes from the backend transport, which a library host can point
+ // at anything (a BYOK/local endpoint legitimately runs over
+ // plain HTTP on loopback), so this cannot tighten
+ // `normalize_api_base_url` itself without breaking those.
+ let endpoint = self.base_url()?;
+ if !is_managed_endpoint_for_api_key(&endpoint) {
+ anyhow::bail!(
+ "refusing to send the TinyHumans API key to an unmanaged or insecure \
+ endpoint: {endpoint} — use the managed backend or loopback for local testing"
+ );
+ }
+ log::debug!(
+ "[providers][openhuman-backend] authenticating managed inference with api-key"
+ );
+ return Ok(key);
+ }
- if openhuman_embed::__host::cron::scheduler_gate::is_signed_out() {
++ if openhuman_embed::__host::platform::llm_gate::is_signed_out() {
+ anyhow::bail!(
+ "SESSION_EXPIRED: backend session not active — sign in to resume LLM work"
+ );
+ }
+ let auth = AuthService::new(&self.state_dir(), self.options.secrets_encrypt);
+ let profile = auth.get_profile(
+ APP_SESSION_PROVIDER,
+ self.options.auth_profile_override.as_deref(),
+ )?;
+
+ // #5503: precheck the recorded JWT `exp` BEFORE building a request, the
+ // same way `require_live_session_token` guards the backend REST callers.
+ // Managed inference used to fire a doomed request on an expired-but-
+ // stored token and let the 401 come back — but an expired session can
+ // also surface upstream as a misleading "model unavailable", which is a
+ // core symptom of #5503 (all tiers "die" over a long session). Failing
+ // fast as `session_expired` routes the user to re-auth instead.
+ managed_bearer(classify_session_token(profile.as_ref(), chrono::Utc::now()))
+ }
+
+ /// The managed OpenAI-compatible endpoint, from the configured `api_url`
+ /// override or this crate's backend URL defaults.
+ pub(super) fn base_url(&self) -> anyhow::Result<String> {
+ let base = effective_api_url(&self.api_url);
+ Ok(format!("{}/openai/v1", base.trim_end_matches('/')))
+ }
+
+ /// Resolve the current JWT + base URL and build a fresh crate `OpenAiModel`
+ /// (Bearer). Rebuilt per call because the session JWT rotates, but every
+ /// build shares one pooled HTTP client ([`managed_inference_http_client`]),
+ /// so consecutive calls reuse a warm TLS connection to the backend.
+ pub(super) fn build_wire_model(&self) -> tinyinference_llm::Result<OpenAiModel> {
+ let token = self
+ .resolve_bearer()
+ .map_err(|e| TiError::Model(e.to_string()))?;
+ let base_url = self.base_url().map_err(|e| TiError::Model(e.to_string()))?;
+ // The hosted API is chat-completions only (no `/v1/responses`); auth is a
+ // plain bearer JWT. The tier/model rides `request.model`, which the backend
+ // resolves — the baked default only applies when a request omits it.
+ Ok(
+ OpenAiModel::compatible_provider(PROVIDER_LABEL, token, base_url, &self.default_model)
+ .with_native_tool_calling(self.native_tool_calling)
+ .with_request_options(ProviderRequestOptions {
+ http: Some(managed_inference_http_client()),
+ ..ProviderRequestOptions::default()
+ }),
+ )
+ }
+
+ /// Probe whether the managed backend account actually has a working
+ /// inference provider configured, cheaply and without inflating usage
+ /// (issue B45 — flows provider-connectivity author gate).
+ ///
+ /// [`build_wire_model`](Self::build_wire_model) only resolves the session
+ /// JWT and builds the request client — it says nothing about whether the
+ /// account has a provider API key configured server-side. That only
+ /// surfaces on a real completion attempt, as an HTTP 400
+ /// `{"success":false,"error":"API key not configured for provider","errorCode":"BAD_REQUEST"}`.
+ /// Previously the first time a flows author found this out was mid-run,
+ /// deep inside a tinyflows `agent` node. This probe moves that discovery
+ /// to author time by issuing one minimal completion (`"ping"`,
+ /// `max_tokens: 1`) and classifying the result.
+ ///
+ /// Fails OPEN on everything except a definitive client-configuration
+ /// error: a 5-second timeout, a transport failure, a 5xx, or any other
+ /// non-matching provider error all return `Ok(())` so a flaky backend or
+ /// slow network never blocks authoring. Only a backend-confirmed "no
+ /// provider configured for this account" response returns `Err` —
+ /// carrying the backend's own error string so the author sees exactly
+ /// what run time would have shown them.
+ pub async fn probe_readiness(&self) -> Result<(), String> {
+ log::debug!(
+ "[flows][inference-probe] entering probe_readiness model={}",
+ self.default_model
+ );
+
+ let model = match self.build_wire_model() {
+ Ok(model) => model,
+ Err(e) => {
+ // The flows readiness gate's Layer 1 (sign-in / session
+ // checks) is responsible for catching a genuinely
+ // absent/expired session before this ever runs — a
+ // construction failure reaching here is a race, not a
+ // provider-configuration problem, so fail open rather than
+ // duplicate or contradict that gate's message.
+ log::debug!(
+ "[flows][inference-probe] wire model construction failed, failing open: {e}"
+ );
+ return Ok(());
+ }
+ };
+
+ let request = ModelRequest::new(vec![Message::user("ping")]).with_max_tokens(1);
+
+ let outcome =
+ match tokio::time::timeout(Duration::from_secs(5), model.invoke(&(), request)).await {
+ Ok(result) => result,
+ Err(_) => {
+ log::debug!(
+ "[flows][inference-probe] model={} timed out after 5s, failing open",
+ self.default_model
+ );
+ return Ok(());
+ }
+ };
+
+ match outcome {
+ Ok(_) => {
+ log::debug!(
+ "[flows][inference-probe] model={} probe completion succeeded — provider ready",
+ self.default_model
+ );
+ Ok(())
+ }
+ Err(TiError::Provider(err)) => {
+ if is_provider_not_configured_error(&err) {
+ log::warn!(
+ "[flows][inference-probe] model={} backend reports no provider configured: {}",
+ self.default_model,
+ err.message
+ );
+ Err(err.message.clone())
+ } else if err.status.is_some_and(|status| status >= 500) {
+ log::debug!(
+ "[flows][inference-probe] model={} backend {:?}, failing open: {}",
+ self.default_model,
+ err.status,
+ err.message
+ );
+ Ok(())
+ } else {
+ // Any other structured provider failure (401, 429, a
+ // malformed request, …) is not the definitive "provider
+ // not configured" signal this probe exists to catch —
+ // fail open rather than risk a false-positive
+ // author-time block.
+ log::debug!(
+ "[flows][inference-probe] model={} non-definitive provider error {:?}, \
+ failing open: {}",
+ self.default_model,
+ err.status,
+ err.message
+ );
+ Ok(())
+ }
+ }
+ Err(e) => {
+ log::debug!(
+ "[flows][inference-probe] model={} transport/model error, failing open: {e}",
+ self.default_model
+ );
+ Ok(())
+ }
+ }
+ }
+}
+
+/// Whether `err` is the definitive "no inference provider configured for this
+/// account" signal the managed backend returns as an HTTP 400 with body
+/// `{"success":false,"error":"API key not configured for provider","errorCode":"BAD_REQUEST"}`.
+///
+/// Deliberately narrow: matches ONLY a 400 whose message contains the specific
+/// `"api key not configured for provider"` phrasing, or (as a `BAD_REQUEST`-
+/// coded tolerance for message wording drift) the narrower `"not configured
+/// for provider"` substring — never a bare `"not configured"`, which an
+/// unrelated 400 (a malformed request naming some other unconfigured field,
+/// a validation error, …) could also contain. Every other 4xx/5xx/transport
+/// failure fails open (see [`OpenHumanBackendModel::probe_readiness`]'s doc).
+fn is_provider_not_configured_error(err: &ProviderError) -> bool {
+ if err.status != Some(400) {
+ return false;
+ }
+ let message = err.message.to_ascii_lowercase();
+ let code_is_bad_request = err
+ .code
+ .as_deref()
+ .is_some_and(|c| c.eq_ignore_ascii_case("BAD_REQUEST"));
+ message.contains("api key not configured for provider")
+ || (code_is_bad_request && message.contains("not configured for provider"))
+}
+
+fn resolve_model(model: &str) -> String {
+ let trimmed = model.trim();
+ if trimmed.is_empty() {
+ log::debug!(
+ "[providers][openhuman-backend] empty model passed to OpenHuman backend; \
+ substituting default `{}` (TAURI-RUST-RS)",
+ openhuman_embed::__host::config::MODEL_MANAGED_DEFAULT
+ );
+ openhuman_embed::__host::config::MODEL_MANAGED_DEFAULT.to_string()
+ } else {
+ trimmed.to_string()
+ }
+}
+
+/// Connect timeout for the shared managed-inference client; matches the
+/// adapter's own default.
+const MANAGED_INFERENCE_CONNECT_TIMEOUT: Duration = Duration::from_secs(30);
+
+/// How long an idle pooled connection is kept. Below the AWS ALB's default 60s
+/// idle timeout in front of the backend, so the pool never hands out a
+/// connection the load balancer has already closed.
+const MANAGED_INFERENCE_POOL_IDLE_TIMEOUT: Duration = Duration::from_secs(50);
+
+/// The one HTTP client every managed-inference call in the process shares.
+///
+/// `OpenAiModel` otherwise builds its own `reqwest::Client` per instance, and
+/// [`OpenHumanBackendModel::build_wire_model`] builds an instance per model
+/// call, so each call paid a fresh TCP + TLS handshake to the backend (about
+/// 150-300 ms measured to `api.tinyhumans.ai`) before its first token. A
+/// `reqwest::Client` is a cheap handle over a shared connection pool, so
+/// cloning it keeps connections warm across calls, turns and threads.
+fn managed_inference_http_client() -> reqwest::Client {
+ static CLIENT: std::sync::OnceLock<reqwest::Client> = std::sync::OnceLock::new();
+ CLIENT
+ .get_or_init(|| {
+ tracing::debug!(
+ idle_timeout_secs = MANAGED_INFERENCE_POOL_IDLE_TIMEOUT.as_secs(),
+ "[inference][managed] building shared pooled HTTP client"
+ );
+ reqwest::Client::builder()
+ .connect_timeout(MANAGED_INFERENCE_CONNECT_TIMEOUT)
+ .pool_idle_timeout(MANAGED_INFERENCE_POOL_IDLE_TIMEOUT)
+ .tcp_keepalive(Duration::from_secs(30))
+ .build()
+ .unwrap_or_else(|error| {
+ tracing::warn!(
+ error = %error,
+ "[inference][managed] pooled client build failed; using reqwest defaults"
+ );
+ reqwest::Client::new()
+ })
+ })
+ .clone()
+}
+
+#[cfg(test)]
+#[path = "managed_model_tests.rs"]
+mod tests;
diff --cc crates/openhuman-tinyhumans/src/inference/managed_session.rs
index f11ba3f947,0000000000..b563440c72
mode 100644,000000..100644
--- a/crates/openhuman-tinyhumans/src/inference/managed_session.rs
+++ b/crates/openhuman-tinyhumans/src/inference/managed_session.rs
@@@ -1,99 -1,0 +1,99 @@@
+//! Session handling for managed inference: the bearer a stored session token
+//! yields, and the `SessionExpired` publications that follow an expired or
+//! rejected session.
+
+use tinyinference_llm::model::ProviderError;
+use tinyinference_llm::Error as TiError;
+
+/// The bearer a classified app-session token yields for managed inference.
+///
+/// Separate from `OpenHumanBackendModel::resolve_bearer` so the decision is
+/// testable without an on-disk auth profile.
+///
+/// `exp`-less tokens carry no recorded expiry, so `classify_session_token`
+/// reports them `Live`; the offline local session is one of those, and it
+/// authenticates no TinyHumans account. Sending it anyway earned a backend
+/// `401 "Invalid token"`, which published `SessionExpired` and told a user who
+/// was signed in locally that their session had expired (#6932). Refusing here
+/// mirrors the arm `resolve_backend_credential` already applies to every
+/// backend REST caller, and keeps the local credential intact.
+pub(super) fn managed_bearer(
+ check: openhuman_embed::__host::security::credentials::session_support::SessionTokenCheck,
+) -> anyhow::Result<String> {
+ use openhuman_embed::__host::security::credentials::session_support::{
+ is_local_session_token, SessionTokenCheck, LOCAL_SESSION_MANAGED_INFERENCE_UNAVAILABLE,
+ };
+
+ match check {
+ SessionTokenCheck::Live(token) if is_local_session_token(&token) => {
+ log::debug!(
+ "[providers][openhuman-backend] refusing managed inference for the offline local session"
+ );
+ anyhow::bail!(LOCAL_SESSION_MANAGED_INFERENCE_UNAVAILABLE)
+ }
+ SessionTokenCheck::Live(token) => Ok(token),
+ SessionTokenCheck::Expired => {
+ maybe_publish_local_session_expiry();
+ anyhow::bail!(
+ "SESSION_EXPIRED: backend session token expired locally — re-authentication required"
+ )
+ }
+ SessionTokenCheck::Absent => {
+ anyhow::bail!("No backend session: store a JWT via auth (app-session)")
+ }
+ }
+}
+
+/// Publish a `SessionExpired` event when the local `exp` precheck in
+/// `OpenHumanBackendModel::resolve_bearer` rejects an expired
+/// managed session token before a request is ever sent — mirroring
+/// `require_live_session_token`'s
+/// pre-flight publish so the credentials subscriber clears state and the UI
+/// re-auths exactly as it would on a real backend 401. Deduped via the
+/// scheduler gate so N parallel managed turns in one tick don't emit N events.
+fn maybe_publish_local_session_expiry() {
- if openhuman_embed::__host::cron::scheduler_gate::is_signed_out() {
++ if openhuman_embed::__host::platform::llm_gate::is_signed_out() {
+ return;
+ }
+ log::warn!(
+ "[providers][openhuman-backend] managed session token expired locally — \
+ publishing SessionExpired before any inference request"
+ );
+ openhuman_embed::__host::core::bus::BUS.publish(
+ openhuman_embed::__host::core::events::DomainEvent::SessionExpired {
+ source: "openhuman_backend_model.resolve_bearer".to_string(),
+ reason: "backend session token expired locally — re-authentication required"
+ .to_string(),
+ },
+ );
+}
+
+/// Publish a `SessionExpired` event when the backend rejects a crate-native
+/// model call with `401`/`403` Unauthorized — mirroring the check in
+/// the core `CrateBackedProvider::invoke` which the
+/// crate-native path bypasses.
+pub(super) fn maybe_publish_session_expired(err: &TiError, operation: &str) {
+ if let TiError::Provider(pe) = err {
+ maybe_publish_provider_session_expired(pe, operation);
+ }
+}
+
+pub(super) fn maybe_publish_provider_session_expired(pe: &ProviderError, operation: &str) {
+ if pe.provider.as_str() == "OpenHuman" && matches!(pe.status, Some(401 | 403)) {
+ let reason = tinyinference_core::sanitize::sanitize_api_error(&pe.message);
+ openhuman_embed::__host::core::bus::BUS.publish(
+ openhuman_embed::__host::core::events::DomainEvent::SessionExpired {
+ source: format!(
+ "openhuman_backend_model.{}({})",
+ operation,
+ pe.status.unwrap_or(0)
+ ),
+ reason,
+ },
+ );
+ }
+}
+
+#[cfg(test)]
+#[path = "managed_session_tests.rs"]
+mod tests;
diff --cc docs/gitbooks/en/developing/embed/api-index.json
index 37cbebfd52,9d01c1a4f0..136d1658ae
--- a/docs/gitbooks/en/developing/embed/api-index.json
+++ b/docs/gitbooks/en/developing/embed/api-index.json
@@@ -179,49 -190,55 +183,49 @@@
"name": "access",
"signature": "pub fn access(mut self, access: Access) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 351
- "line": 387
++ "line": 370
},
{
"name": "action_dir",
"signature": "pub fn action_dir(mut self, dir: impl Into<PathBuf>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 308
- "line": 344
++ "line": 327
},
{
"name": "agent_defaults",
"signature": "pub fn agent_defaults(mut self, defaults: super::AgentDefaults) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 155
- "line": 160
++ "line": 157
},
{
"name": "api_key",
"signature": "pub fn api_key(mut self, key: impl Into<ApiKey>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 328
- "line": 364
++ "line": 347
},
{
"name": "autonomy",
"signature": "pub fn autonomy(mut self, value: openhuman_core::config::schema::AutonomyConfig) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 190
- "line": 195
- },
- {
- "name": "backend_transport",
- "signature": "pub fn backend_transport(mut self, transport: Arc<dyn BackendTransport>) -> Self",
- "source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 234
++ "line": 192
},
{
"name": "backend_url",
"signature": "pub fn backend_url(mut self, url: impl Into<String>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 338
- "line": 374
++ "line": 357
},
{
"name": "config",
"signature": "pub fn config(mut self, config: Config) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 468
- "line": 504
++ "line": 487
},
{
"name": "config_source",
"signature": "pub fn config_source(mut self, source: ConfigSource) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 316
- "line": 352
++ "line": 335
},
{
"name": "controller_extension",
@@@ -233,61 -250,67 +237,67 @@@
"name": "cron",
"signature": "pub fn cron(mut self, value: openhuman_core::config::schema::CronConfig) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 215
- "line": 220
++ "line": 217
},
{
"name": "cron_delivery",
"signature": "pub fn cron_delivery( mut self, delivery: Arc<dyn openhuman_core::cron::host_delivery::CronDelivery>, ) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 259
- "line": 278
++ "line": 261
+ },
+ {
+ "name": "cron_job_handler",
+ "signature": "pub fn cron_job_handler( mut self, kind: crate::cron::JobKind, handler: Arc<dyn crate::cron::JobKindHandler>, ) -> Self",
+ "source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 292
++ "line": 275
},
{
"name": "defer_services",
"signature": "pub fn defer_services(mut self) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 386
- "line": 422
++ "line": 405
},
{
"name": "definition_base",
"signature": "pub fn definition_base(mut self, definition: crate::AgentDefinitionSpec) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 174
- "line": 179
++ "line": 176
},
{
"name": "domains",
"signature": "pub fn domains(mut self, domains: DomainSet) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 398
- "line": 434
++ "line": 417
},
{
"name": "host_kind",
"signature": "pub fn host_kind(mut self, host_kind: HostKind) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 415
- "line": 451
++ "line": 434
},
{
"name": "learning",
"signature": "pub fn learning(mut self, value: super::LearningSettings) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 210
- "line": 215
++ "line": 212
},
{
"name": "listen",
"signature": "pub fn listen(self, host: impl Into<String>, port: u16) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 437
- "line": 473
++ "line": 456
},
{
"name": "listen_host",
"signature": "pub fn listen_host(mut self, host: impl Into<String>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 442
- "line": 478
++ "line": 461
},
{
"name": "listen_port",
"signature": "pub fn listen_port(mut self, port: u16) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 448
- "line": 484
++ "line": 467
},
{
"name": "live_policy",
@@@ -299,25 -322,25 +309,25 @@@
"name": "max_agents",
"signature": "pub fn max_agents(mut self, limit: usize) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 271
- "line": 307
++ "line": 290
},
{
"name": "mcp_baseline",
"signature": "pub fn mcp_baseline(mut self, servers: impl IntoIterator<Item = crate::McpServer>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 185
- "line": 190
++ "line": 187
},
{
"name": "memory_engine",
"signature": "pub fn memory_engine(mut self, engine: Arc<dyn tinymemory_api::MemoryEngine>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 229
- "line": 248
++ "line": 231
},
{
"name": "model_defaults",
"signature": "pub fn model_defaults(mut self, model: super::ModelDefaults) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 164
- "line": 169
++ "line": 166
},
{
"name": "modules",
@@@ -335,25 -358,25 +345,25 @@@
"name": "privacy",
"signature": "pub fn privacy(mut self, value: openhuman_core::config::schema::PrivacyConfig) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 200
- "line": 205
++ "line": 202
},
{
"name": "provider",
"signature": "pub fn provider(mut self, provider: Provider) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 344
- "line": 380
++ "line": 363
},
{
"name": "sandbox",
"signature": "pub fn sandbox(mut self, mode: crate::SandboxModeSpec) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 169
- "line": 174
++ "line": 171
},
{
"name": "secrets",
"signature": "pub fn secrets(mut self, value: openhuman_core::config::schema::SecretsConfig) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 205
- "line": 210
++ "line": 207
},
{
"name": "server_launcher",
@@@ -365,25 -388,25 +375,25 @@@
"name": "services",
"signature": "pub fn services(mut self, services: ServiceSet) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 370
- "line": 406
++ "line": 389
},
{
"name": "session",
"signature": "pub fn session(mut self, session: Session) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 458
- "line": 494
++ "line": 477
},
{
"name": "session_store",
"signature": "pub fn session_store(mut self, provider: Arc<dyn SessionStoreProvider>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 244
- "line": 263
++ "line": 246
},
{
"name": "skills",
"signature": "pub fn skills(mut self, policy: super::SkillsPolicy) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 179
- "line": 184
++ "line": 181
},
{
"name": "storage",
@@@ -395,13 -418,13 +405,13 @@@
"name": "token",
"signature": "pub fn token(mut self, token: TokenSource) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 425
- "line": 461
++ "line": 444
},
{
"name": "tool_groups",
"signature": "pub fn tool_groups(mut self, tool_groups: ToolGroups) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 407
- "line": 443
++ "line": 426
},
{
"name": "tool_hook",
@@@ -419,19 -442,19 +429,19 @@@
"name": "tool_rules",
"signature": "pub fn tool_rules(mut self, value: tinytools::ToolRules) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 195
- "line": 200
++ "line": 197
},
{
"name": "workspace",
"signature": "pub fn workspace(mut self, workspace: Workspace) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 281
- "line": 317
++ "line": 300
},
{
"name": "workspace_dir",
"signature": "pub fn workspace_dir(mut self, dir: impl Into<PathBuf>) -> Self",
"source": "crates/openhuman-embed/src/runtime/builder.rs",
- "line": 295
- "line": 331
++ "line": 314
}
],
"capabilities": {
diff --cc docs/gitbooks/en/developing/embed/builder-setters.md
index 34b83985aa,594e3fcc3d..b0e1b9e0f8
--- a/docs/gitbooks/en/developing/embed/builder-setters.md
+++ b/docs/gitbooks/en/developing/embed/builder-setters.md
@@@ -4,46 -4,48 +4,47 @@@
Public consuming methods that return `Self`, extracted from the RuntimeBuilder implementations. Static host and weight presets, inspection methods and build/run methods are excluded.
- - [`access`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L351): `pub fn access(mut self, access: Access) -> Self`
- - [`action_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L308): `pub fn action_dir(mut self, dir: impl Into<PathBuf>) -> Self`
- - [`agent_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L155): `pub fn agent_defaults(mut self, defaults: super::AgentDefaults) -> Self`
- - [`api_key`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L328): `pub fn api_key(mut self, key: impl Into<ApiKey>) -> Self`
- - [`autonomy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L190): `pub fn autonomy(mut self, value: openhuman_core::config::schema::AutonomyConfig) -> Self`
- - [`backend_url`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L338): `pub fn backend_url(mut self, url: impl Into<String>) -> Self`
- - [`config`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L468): `pub fn config(mut self, config: Config) -> Self`
- - [`config_source`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L316): `pub fn config_source(mut self, source: ConfigSource) -> Self`
-- [`access`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L387): `pub fn access(mut self, access: Access) -> Self`
-- [`action_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L344): `pub fn action_dir(mut self, dir: impl Into<PathBuf>) -> Self`
-- [`agent_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L160): `pub fn agent_defaults(mut self, defaults: super::AgentDefaults) -> Self`
-- [`api_key`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L364): `pub fn api_key(mut self, key: impl Into<ApiKey>) -> Self`
-- [`autonomy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L195): `pub fn autonomy(mut self, value: openhuman_core::config::schema::AutonomyConfig) -> Self`
-- [`backend_transport`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L234): `pub fn backend_transport(mut self, transport: Arc<dyn BackendTransport>) -> Self`
-- [`backend_url`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L374): `pub fn backend_url(mut self, url: impl Into<String>) -> Self`
-- [`config`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L504): `pub fn config(mut self, config: Config) -> Self`
-- [`config_source`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L352): `pub fn config_source(mut self, source: ConfigSource) -> Self`
++- [`access`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L370): `pub fn access(mut self, access: Access) -> Self`
++- [`action_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L327): `pub fn action_dir(mut self, dir: impl Into<PathBuf>) -> Self`
++- [`agent_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L157): `pub fn agent_defaults(mut self, defaults: super::AgentDefaults) -> Self`
++- [`api_key`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L347): `pub fn api_key(mut self, key: impl Into<ApiKey>) -> Self`
++- [`autonomy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L192): `pub fn autonomy(mut self, value: openhuman_core::config::schema::AutonomyConfig) -> Self`
++- [`backend_url`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L357): `pub fn backend_url(mut self, url: impl Into<String>) -> Self`
++- [`config`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L487): `pub fn config(mut self, config: Config) -> Self`
++- [`config_source`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L335): `pub fn config_source(mut self, source: ConfigSource) -> Self`
- [`controller_extension`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L415): `pub fn controller_extension(mut self, extension: ControllerExtension) -> Self`
- - [`cron`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L215): `pub fn cron(mut self, value: openhuman_core::config::schema::CronConfig) -> Self`
- - [`cron_delivery`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L259): `pub fn cron_delivery( mut self, delivery: Arc<dyn openhuman_core::cron::host_delivery::CronDelivery>, ) -> Self`
- - [`defer_services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L386): `pub fn defer_services(mut self) -> Self`
- - [`definition_base`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L174): `pub fn definition_base(mut self, definition: crate::AgentDefinitionSpec) -> Self`
- - [`domains`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L398): `pub fn domains(mut self, domains: DomainSet) -> Self`
- - [`host_kind`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L415): `pub fn host_kind(mut self, host_kind: HostKind) -> Self`
- - [`learning`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L210): `pub fn learning(mut self, value: super::LearningSettings) -> Self`
- - [`listen`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L437): `pub fn listen(self, host: impl Into<String>, port: u16) -> Self`
- - [`listen_host`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L442): `pub fn listen_host(mut self, host: impl Into<String>) -> Self`
- - [`listen_port`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L448): `pub fn listen_port(mut self, port: u16) -> Self`
-- [`cron`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L220): `pub fn cron(mut self, value: openhuman_core::config::schema::CronConfig) -> Self`
-- [`cron_delivery`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L278): `pub fn cron_delivery( mut self, delivery: Arc<dyn openhuman_core::cron::host_delivery::CronDelivery>, ) -> Self`
-- [`cron_job_handler`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L292): `pub fn cron_job_handler( mut self, kind: crate::cron::JobKind, handler: Arc<dyn crate::cron::JobKindHandler>, ) -> Self`
-- [`defer_services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L422): `pub fn defer_services(mut self) -> Self`
-- [`definition_base`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L179): `pub fn definition_base(mut self, definition: crate::AgentDefinitionSpec) -> Self`
-- [`domains`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L434): `pub fn domains(mut self, domains: DomainSet) -> Self`
-- [`host_kind`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L451): `pub fn host_kind(mut self, host_kind: HostKind) -> Self`
-- [`learning`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L215): `pub fn learning(mut self, value: super::LearningSettings) -> Self`
-- [`listen`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L473): `pub fn listen(self, host: impl Into<String>, port: u16) -> Self`
-- [`listen_host`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L478): `pub fn listen_host(mut self, host: impl Into<String>) -> Self`
-- [`listen_port`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L484): `pub fn listen_port(mut self, port: u16) -> Self`
++- [`cron`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L217): `pub fn cron(mut self, value: openhuman_core::config::schema::CronConfig) -> Self`
++- [`cron_delivery`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L261): `pub fn cron_delivery( mut self, delivery: Arc<dyn openhuman_core::cron::host_delivery::CronDelivery>, ) -> Self`
++- [`cron_job_handler`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L275): `pub fn cron_job_handler( mut self, kind: crate::cron::JobKind, handler: Arc<dyn crate::cron::JobKindHandler>, ) -> Self`
++- [`defer_services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L405): `pub fn defer_services(mut self) -> Self`
++- [`definition_base`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L176): `pub fn definition_base(mut self, definition: crate::AgentDefinitionSpec) -> Self`
++- [`domains`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L417): `pub fn domains(mut self, domains: DomainSet) -> Self`
++- [`host_kind`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L434): `pub fn host_kind(mut self, host_kind: HostKind) -> Self`
++- [`learning`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L212): `pub fn learning(mut self, value: super::LearningSettings) -> Self`
++- [`listen`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L456): `pub fn listen(self, host: impl Into<String>, port: u16) -> Self`
++- [`listen_host`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L461): `pub fn listen_host(mut self, host: impl Into<String>) -> Self`
++- [`listen_port`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L467): `pub fn listen_port(mut self, port: u16) -> Self`
- [`live_policy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L464): `pub fn live_policy(mut self, policy: Arc<SecurityPolicy>) -> Self`
- - [`max_agents`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L271): `pub fn max_agents(mut self, limit: usize) -> Self`
- - [`mcp_baseline`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L185): `pub fn mcp_baseline(mut self, servers: impl IntoIterator<Item = crate::McpServer>) -> Self`
- - [`memory_engine`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L229): `pub fn memory_engine(mut self, engine: Arc<dyn tinymemory_api::MemoryEngine>) -> Self`
- - [`model_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L164): `pub fn model_defaults(mut self, model: super::ModelDefaults) -> Self`
-- [`max_agents`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L307): `pub fn max_agents(mut self, limit: usize) -> Self`
-- [`mcp_baseline`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L190): `pub fn mcp_baseline(mut self, servers: impl IntoIterator<Item = crate::McpServer>) -> Self`
-- [`memory_engine`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L248): `pub fn memory_engine(mut self, engine: Arc<dyn tinymemory_api::MemoryEngine>) -> Self`
-- [`model_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L169): `pub fn model_defaults(mut self, model: super::ModelDefaults) -> Self`
++- [`max_agents`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L290): `pub fn max_agents(mut self, limit: usize) -> Self`
++- [`mcp_baseline`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L187): `pub fn mcp_baseline(mut self, servers: impl IntoIterator<Item = crate::McpServer>) -> Self`
++- [`memory_engine`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L231): `pub fn memory_engine(mut self, engine: Arc<dyn tinymemory_api::MemoryEngine>) -> Self`
++- [`model_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L166): `pub fn model_defaults(mut self, model: super::ModelDefaults) -> Self`
- [`modules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/selection.rs#L155): `pub fn modules(mut self, modules: impl IntoIterator<Item = RuntimeModule>) -> Self`
- [`post_turn_hook`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L430): `pub fn post_turn_hook(mut self, hook: Arc<dyn PostTurnHook>) -> Self`
- - [`privacy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L200): `pub fn privacy(mut self, value: openhuman_core::config::schema::PrivacyConfig) -> Self`
- - [`provider`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L344): `pub fn provider(mut self, provider: Provider) -> Self`
- - [`sandbox`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L169): `pub fn sandbox(mut self, mode: crate::SandboxModeSpec) -> Self`
- - [`secrets`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L205): `pub fn secrets(mut self, value: openhuman_core::config::schema::SecretsConfig) -> Self`
-- [`privacy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L205): `pub fn privacy(mut self, value: openhuman_core::config::schema::PrivacyConfig) -> Self`
-- [`provider`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L380): `pub fn provider(mut self, provider: Provider) -> Self`
-- [`sandbox`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L174): `pub fn sandbox(mut self, mode: crate::SandboxModeSpec) -> Self`
-- [`secrets`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L210): `pub fn secrets(mut self, value: openhuman_core::config::schema::SecretsConfig) -> Self`
++- [`privacy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L202): `pub fn privacy(mut self, value: openhuman_core::config::schema::PrivacyConfig) -> Self`
++- [`provider`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L363): `pub fn provider(mut self, provider: Provider) -> Self`
++- [`sandbox`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L171): `pub fn sandbox(mut self, mode: crate::SandboxModeSpec) -> Self`
++- [`secrets`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L207): `pub fn secrets(mut self, value: openhuman_core::config::schema::SecretsConfig) -> Self`
- [`server_launcher`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L444): `pub fn server_launcher(mut self, launcher: ServerLauncher) -> Self`
- - [`services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L370): `pub fn services(mut self, services: ServiceSet) -> Self`
- - [`session`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L458): `pub fn session(mut self, session: Session) -> Self`
- - [`session_store`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L244): `pub fn session_store(mut self, provider: Arc<dyn SessionStoreProvider>) -> Self`
- - [`skills`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L179): `pub fn skills(mut self, policy: super::SkillsPolicy) -> Self`
-- [`services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L406): `pub fn services(mut self, services: ServiceSet) -> Self`
-- [`session`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L494): `pub fn session(mut self, session: Session) -> Self`
-- [`session_store`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L263): `pub fn session_store(mut self, provider: Arc<dyn SessionStoreProvider>) -> Self`
-- [`skills`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L184): `pub fn skills(mut self, policy: super::SkillsPolicy) -> Self`
++- [`services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L389): `pub fn services(mut self, services: ServiceSet) -> Self`
++- [`session`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L477): `pub fn session(mut self, session: Session) -> Self`
++- [`session_store`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L246): `pub fn session_store(mut self, provider: Arc<dyn SessionStoreProvider>) -> Self`
++- [`skills`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L181): `pub fn skills(mut self, policy: super::SkillsPolicy) -> Self`
- [`storage`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L457): `pub fn storage(mut self, source: impl Into<StorageSource>) -> Self`
- - [`token`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L425): `pub fn token(mut self, token: TokenSource) -> Self`
- - [`tool_groups`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L407): `pub fn tool_groups(mut self, tool_groups: ToolGroups) -> Self`
-- [`token`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L461): `pub fn token(mut self, token: TokenSource) -> Self`
-- [`tool_groups`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L443): `pub fn tool_groups(mut self, tool_groups: ToolGroups) -> Self`
++- [`token`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L444): `pub fn token(mut self, token: TokenSource) -> Self`
++- [`tool_groups`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L426): `pub fn tool_groups(mut self, tool_groups: ToolGroups) -> Self`
- [`tool_hook`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L437): `pub fn tool_hook(mut self, hook: Arc<dyn ToolHook>) -> Self`
- [`tool_ranker`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L422): `pub fn tool_ranker(mut self, ranker: Arc<dyn ToolRanker>) -> Self`
- - [`tool_rules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L195): `pub fn tool_rules(mut self, value: tinytools::ToolRules) -> Self`
- - [`workspace`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L281): `pub fn workspace(mut self, workspace: Workspace) -> Self`
- - [`workspace_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L295): `pub fn workspace_dir(mut self, dir: impl Into<PathBuf>) -> Self`
-- [`tool_rules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L200): `pub fn tool_rules(mut self, value: tinytools::ToolRules) -> Self`
-- [`workspace`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L317): `pub fn workspace(mut self, workspace: Workspace) -> Self`
-- [`workspace_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L331): `pub fn workspace_dir(mut self, dir: impl Into<PathBuf>) -> Self`
++- [`tool_rules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L197): `pub fn tool_rules(mut self, value: tinytools::ToolRules) -> Self`
++- [`workspace`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L300): `pub fn workspace(mut self, workspace: Workspace) -> Self`
++- [`workspace_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L314): `pub fn workspace_dir(mut self, dir: impl Into<PathBuf>) -> Self`
diff --cc llms-full.txt
index 75a1370f00,77f4e8da67..063f2e6605
--- a/llms-full.txt
+++ b/llms-full.txt
@@@ -2823,49 -2823,51 +2823,50 @@@ This matrix comes from the default-feat
Public consuming methods that return `Self`, extracted from the RuntimeBuilder implementations. Static host and weight presets, inspection methods and build/run methods are excluded.
- - [`access`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L351): `pub fn access(mut self, access: Access) -> Self`
- - [`action_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L308): `pub fn action_dir(mut self, dir: impl Into<PathBuf>) -> Self`
- - [`agent_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L155): `pub fn agent_defaults(mut self, defaults: super::AgentDefaults) -> Self`
- - [`api_key`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L328): `pub fn api_key(mut self, key: impl Into<ApiKey>) -> Self`
- - [`autonomy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L190): `pub fn autonomy(mut self, value: openhuman_core::config::schema::AutonomyConfig) -> Self`
- - [`backend_url`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L338): `pub fn backend_url(mut self, url: impl Into<String>) -> Self`
- - [`config`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L468): `pub fn config(mut self, config: Config) -> Self`
- - [`config_source`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L316): `pub fn config_source(mut self, source: ConfigSource) -> Self`
-- [`access`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L387): `pub fn access(mut self, access: Access) -> Self`
-- [`action_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L344): `pub fn action_dir(mut self, dir: impl Into<PathBuf>) -> Self`
-- [`agent_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L160): `pub fn agent_defaults(mut self, defaults: super::AgentDefaults) -> Self`
-- [`api_key`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L364): `pub fn api_key(mut self, key: impl Into<ApiKey>) -> Self`
-- [`autonomy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L195): `pub fn autonomy(mut self, value: openhuman_core::config::schema::AutonomyConfig) -> Self`
-- [`backend_transport`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L234): `pub fn backend_transport(mut self, transport: Arc<dyn BackendTransport>) -> Self`
-- [`backend_url`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L374): `pub fn backend_url(mut self, url: impl Into<String>) -> Self`
-- [`config`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L504): `pub fn config(mut self, config: Config) -> Self`
-- [`config_source`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L352): `pub fn config_source(mut self, source: ConfigSource) -> Self`
++- [`access`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L370): `pub fn access(mut self, access: Access) -> Self`
++- [`action_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L327): `pub fn action_dir(mut self, dir: impl Into<PathBuf>) -> Self`
++- [`agent_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L157): `pub fn agent_defaults(mut self, defaults: super::AgentDefaults) -> Self`
++- [`api_key`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L347): `pub fn api_key(mut self, key: impl Into<ApiKey>) -> Self`
++- [`autonomy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L192): `pub fn autonomy(mut self, value: openhuman_core::config::schema::AutonomyConfig) -> Self`
++- [`backend_url`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L357): `pub fn backend_url(mut self, url: impl Into<String>) -> Self`
++- [`config`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L487): `pub fn config(mut self, config: Config) -> Self`
++- [`config_source`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L335): `pub fn config_source(mut self, source: ConfigSource) -> Self`
- [`controller_extension`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L415): `pub fn controller_extension(mut self, extension: ControllerExtension) -> Self`
- - [`cron`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L215): `pub fn cron(mut self, value: openhuman_core::config::schema::CronConfig) -> Self`
- - [`cron_delivery`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L259): `pub fn cron_delivery( mut self, delivery: Arc<dyn openhuman_core::cron::host_delivery::CronDelivery>, ) -> Self`
- - [`defer_services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L386): `pub fn defer_services(mut self) -> Self`
- - [`definition_base`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L174): `pub fn definition_base(mut self, definition: crate::AgentDefinitionSpec) -> Self`
- - [`domains`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L398): `pub fn domains(mut self, domains: DomainSet) -> Self`
- - [`host_kind`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L415): `pub fn host_kind(mut self, host_kind: HostKind) -> Self`
- - [`learning`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L210): `pub fn learning(mut self, value: super::LearningSettings) -> Self`
- - [`listen`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L437): `pub fn listen(self, host: impl Into<String>, port: u16) -> Self`
- - [`listen_host`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L442): `pub fn listen_host(mut self, host: impl Into<String>) -> Self`
- - [`listen_port`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L448): `pub fn listen_port(mut self, port: u16) -> Self`
-- [`cron`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L220): `pub fn cron(mut self, value: openhuman_core::config::schema::CronConfig) -> Self`
-- [`cron_delivery`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L278): `pub fn cron_delivery( mut self, delivery: Arc<dyn openhuman_core::cron::host_delivery::CronDelivery>, ) -> Self`
-- [`cron_job_handler`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L292): `pub fn cron_job_handler( mut self, kind: crate::cron::JobKind, handler: Arc<dyn crate::cron::JobKindHandler>, ) -> Self`
-- [`defer_services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L422): `pub fn defer_services(mut self) -> Self`
-- [`definition_base`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L179): `pub fn definition_base(mut self, definition: crate::AgentDefinitionSpec) -> Self`
-- [`domains`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L434): `pub fn domains(mut self, domains: DomainSet) -> Self`
-- [`host_kind`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L451): `pub fn host_kind(mut self, host_kind: HostKind) -> Self`
-- [`learning`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L215): `pub fn learning(mut self, value: super::LearningSettings) -> Self`
-- [`listen`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L473): `pub fn listen(self, host: impl Into<String>, port: u16) -> Self`
-- [`listen_host`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L478): `pub fn listen_host(mut self, host: impl Into<String>) -> Self`
-- [`listen_port`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L484): `pub fn listen_port(mut self, port: u16) -> Self`
++- [`cron`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L217): `pub fn cron(mut self, value: openhuman_core::config::schema::CronConfig) -> Self`
++- [`cron_delivery`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L261): `pub fn cron_delivery( mut self, delivery: Arc<dyn openhuman_core::cron::host_delivery::CronDelivery>, ) -> Self`
++- [`cron_job_handler`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L275): `pub fn cron_job_handler( mut self, kind: crate::cron::JobKind, handler: Arc<dyn crate::cron::JobKindHandler>, ) -> Self`
++- [`defer_services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L405): `pub fn defer_services(mut self) -> Self`
++- [`definition_base`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L176): `pub fn definition_base(mut self, definition: crate::AgentDefinitionSpec) -> Self`
++- [`domains`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L417): `pub fn domains(mut self, domains: DomainSet) -> Self`
++- [`host_kind`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L434): `pub fn host_kind(mut self, host_kind: HostKind) -> Self`
++- [`learning`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L212): `pub fn learning(mut self, value: super::LearningSettings) -> Self`
++- [`listen`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L456): `pub fn listen(self, host: impl Into<String>, port: u16) -> Self`
++- [`listen_host`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L461): `pub fn listen_host(mut self, host: impl Into<String>) -> Self`
++- [`listen_port`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L467): `pub fn listen_port(mut self, port: u16) -> Self`
- [`live_policy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L464): `pub fn live_policy(mut self, policy: Arc<SecurityPolicy>) -> Self`
- - [`max_agents`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L271): `pub fn max_agents(mut self, limit: usize) -> Self`
- - [`mcp_baseline`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L185): `pub fn mcp_baseline(mut self, servers: impl IntoIterator<Item = crate::McpServer>) -> Self`
- - [`memory_engine`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L229): `pub fn memory_engine(mut self, engine: Arc<dyn tinymemory_api::MemoryEngine>) -> Self`
- - [`model_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L164): `pub fn model_defaults(mut self, model: super::ModelDefaults) -> Self`
-- [`max_agents`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L307): `pub fn max_agents(mut self, limit: usize) -> Self`
-- [`mcp_baseline`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L190): `pub fn mcp_baseline(mut self, servers: impl IntoIterator<Item = crate::McpServer>) -> Self`
-- [`memory_engine`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L248): `pub fn memory_engine(mut self, engine: Arc<dyn tinymemory_api::MemoryEngine>) -> Self`
-- [`model_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L169): `pub fn model_defaults(mut self, model: super::ModelDefaults) -> Self`
++- [`max_agents`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L290): `pub fn max_agents(mut self, limit: usize) -> Self`
++- [`mcp_baseline`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L187): `pub fn mcp_baseline(mut self, servers: impl IntoIterator<Item = crate::McpServer>) -> Self`
++- [`memory_engine`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L231): `pub fn memory_engine(mut self, engine: Arc<dyn tinymemory_api::MemoryEngine>) -> Self`
++- [`model_defaults`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L166): `pub fn model_defaults(mut self, model: super::ModelDefaults) -> Self`
- [`modules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/selection.rs#L155): `pub fn modules(mut self, modules: impl IntoIterator<Item = RuntimeModule>) -> Self`
- [`post_turn_hook`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L430): `pub fn post_turn_hook(mut self, hook: Arc<dyn PostTurnHook>) -> Self`
- - [`privacy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L200): `pub fn privacy(mut self, value: openhuman_core::config::schema::PrivacyConfig) -> Self`
- - [`provider`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L344): `pub fn provider(mut self, provider: Provider) -> Self`
- - [`sandbox`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L169): `pub fn sandbox(mut self, mode: crate::SandboxModeSpec) -> Self`
- - [`secrets`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L205): `pub fn secrets(mut self, value: openhuman_core::config::schema::SecretsConfig) -> Self`
-- [`privacy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L205): `pub fn privacy(mut self, value: openhuman_core::config::schema::PrivacyConfig) -> Self`
-- [`provider`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L380): `pub fn provider(mut self, provider: Provider) -> Self`
-- [`sandbox`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L174): `pub fn sandbox(mut self, mode: crate::SandboxModeSpec) -> Self`
-- [`secrets`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L210): `pub fn secrets(mut self, value: openhuman_core::config::schema::SecretsConfig) -> Self`
++- [`privacy`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L202): `pub fn privacy(mut self, value: openhuman_core::config::schema::PrivacyConfig) -> Self`
++- [`provider`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L363): `pub fn provider(mut self, provider: Provider) -> Self`
++- [`sandbox`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L171): `pub fn sandbox(mut self, mode: crate::SandboxModeSpec) -> Self`
++- [`secrets`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L207): `pub fn secrets(mut self, value: openhuman_core::config::schema::SecretsConfig) -> Self`
- [`server_launcher`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L444): `pub fn server_launcher(mut self, launcher: ServerLauncher) -> Self`
- - [`services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L370): `pub fn services(mut self, services: ServiceSet) -> Self`
- - [`session`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L458): `pub fn session(mut self, session: Session) -> Self`
- - [`session_store`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L244): `pub fn session_store(mut self, provider: Arc<dyn SessionStoreProvider>) -> Self`
- - [`skills`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L179): `pub fn skills(mut self, policy: super::SkillsPolicy) -> Self`
-- [`services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L406): `pub fn services(mut self, services: ServiceSet) -> Self`
-- [`session`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L494): `pub fn session(mut self, session: Session) -> Self`
-- [`session_store`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L263): `pub fn session_store(mut self, provider: Arc<dyn SessionStoreProvider>) -> Self`
-- [`skills`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L184): `pub fn skills(mut self, policy: super::SkillsPolicy) -> Self`
++- [`services`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L389): `pub fn services(mut self, services: ServiceSet) -> Self`
++- [`session`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L477): `pub fn session(mut self, session: Session) -> Self`
++- [`session_store`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L246): `pub fn session_store(mut self, provider: Arc<dyn SessionStoreProvider>) -> Self`
++- [`skills`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L181): `pub fn skills(mut self, policy: super::SkillsPolicy) -> Self`
- [`storage`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L457): `pub fn storage(mut self, source: impl Into<StorageSource>) -> Self`
- - [`token`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L425): `pub fn token(mut self, token: TokenSource) -> Self`
- - [`tool_groups`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L407): `pub fn tool_groups(mut self, tool_groups: ToolGroups) -> Self`
-- [`token`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L461): `pub fn token(mut self, token: TokenSource) -> Self`
-- [`tool_groups`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L443): `pub fn tool_groups(mut self, tool_groups: ToolGroups) -> Self`
++- [`token`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L444): `pub fn token(mut self, token: TokenSource) -> Self`
++- [`tool_groups`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L426): `pub fn tool_groups(mut self, tool_groups: ToolGroups) -> Self`
- [`tool_hook`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L437): `pub fn tool_hook(mut self, hook: Arc<dyn ToolHook>) -> Self`
- [`tool_ranker`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/seams.rs#L422): `pub fn tool_ranker(mut self, ranker: Arc<dyn ToolRanker>) -> Self`
- - [`tool_rules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L195): `pub fn tool_rules(mut self, value: tinytools::ToolRules) -> Self`
- - [`workspace`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L281): `pub fn workspace(mut self, workspace: Workspace) -> Self`
- - [`workspace_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L295): `pub fn workspace_dir(mut self, dir: impl Into<PathBuf>) -> Self`
-- [`tool_rules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L200): `pub fn tool_rules(mut self, value: tinytools::ToolRules) -> Self`
-- [`workspace`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L317): `pub fn workspace(mut self, workspace: Workspace) -> Self`
-- [`workspace_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L331): `pub fn workspace_dir(mut self, dir: impl Into<PathBuf>) -> Self`
++- [`tool_rules`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L197): `pub fn tool_rules(mut self, value: tinytools::ToolRules) -> Self`
++- [`workspace`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L300): `pub fn workspace(mut self, workspace: Workspace) -> Self`
++- [`workspace_dir`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-embed/src/runtime/builder.rs#L314): `pub fn workspace_dir(mut self, dir: impl Into<PathBuf>) -> Self`
<!-- Source: docs/gitbooks/en/developing/embed/api-index.md -->
# API index
diff --cc package.json
index 5c85d54302,48fa8745d1..1e1695249e
--- a/package.json
+++ b/package.json
@@@ -58,7 -58,7 +58,7 @@@
"rust:clippy": "cargo clippy -p openhuman -p openhuman-cli -p openhuman-tinyhumans -- -D warnings && pnpm --filter openhuman-app rust:clippy",
"rust:module-boundaries": "node scripts/ci/check-module-boundaries.mjs",
"rust:module-boundaries:complete": "node scripts/ci/check-module-boundaries.mjs --require-complete",
- "rust:layout": "node scripts/ci/check-openhuman-rust-layout.mjs && node scripts/ci/check-crate-chain.mjs && node scripts/ci/check-core-hosted-free.mjs && node scripts/ci/check-storage-bypass.mjs && node scripts/ci/check-storage-owner.mjs",
- "rust:layout": "node scripts/ci/check-openhuman-rust-layout.mjs && node scripts/ci/check-crate-chain.mjs && node scripts/ci/check-storage-bypass.mjs && node scripts/ci/check-storage-owner.mjs && node scripts/ci/check-storage-schema.mjs",
++ "rust:layout": "node scripts/ci/check-openhuman-rust-layout.mjs && node scripts/ci/check-crate-chain.mjs && node scripts/ci/check-core-hosted-free.mjs && node scripts/ci/check-storage-bypass.mjs && node scripts/ci/check-storage-owner.mjs && node scripts/ci/check-storage-schema.mjs",
"ci:module-source": "node scripts/ci/check-ci-module-source.mjs",
"rust:process-statics": "node scripts/ci/check-process-statics.mjs",
"rust:ignored-tests": "node scripts/ci/check-ignored-tests.mjs",
diff --cc scripts/ci/saas-ambient-baseline.json
index 3a1313f273,b2ae546ef6..9f15f1ccf0
--- a/scripts/ci/saas-ambient-baseline.json
+++ b/scripts/ci/saas-ambient-baseline.json
@@@ -205,42 -212,42 +205,42 @@@
{
"rule": "env-mutation",
"path": "crates/openhuman-core/src/config/schema/proxy.rs",
-- "line": 346,
++ "line": 347,
"text": "std::env::set_var(key, &value);",
"occurrence": 1
},
{
"rule": "env-mutation",
"path": "crates/openhuman-core/src/config/schema/proxy.rs",
-- "line": 347,
++ "line": 348,
"text": "std::env::set_var(lowercase_key, value);",
"occurrence": 1
},
{
"rule": "env-mutation",
"path": "crates/openhuman-core/src/config/schema/proxy.rs",
-- "line": 349,
++ "line": 350,
"text": "std::env::remove_var(key);",
"occurrence": 1
},
{
"rule": "env-mutation",
"path": "crates/openhuman-core/src/config/schema/proxy.rs",
-- "line": 350,
++ "line": 351,
"text": "std::env::remove_var(lowercase_key);",
"occurrence": 1
},
{
"rule": "env-mutation",
"path": "crates/openhuman-core/src/config/schema/proxy.rs",
-- "line": 355,
++ "line": 356,
"text": "std::env::remove_var(key);",
"occurrence": 2
},
{
"rule": "env-mutation",
"path": "crates/openhuman-core/src/config/schema/proxy.rs",
-- "line": 356,
++ "line": 357,
"text": "std::env::remove_var(key.to_ascii_lowercase());",
"occurrence": 1
},
@@@ -520,7 -513,14 +506,7 @@@
{
"rule": "ambient-config",
"path": "crates/openhuman-core/src/inference/provider/ops/models/catalog_listing.rs",
- "line": 51,
- "line": 39,
++ "line": 84,
"text": "let config = crate::config::Config::load_or_init()",
"occurrence": 1
},
@@@ -968,7 -1024,7 +1003,7 @@@
{
"rule": "ambient-context",
"path": "crates/openhuman-core/src/tools/ops.rs",
- "line": 537,
- "line": 558,
++ "line": 541,
"text": "let domains = crate::core::runtime::context::CoreContext::current().map(|c| c.domains());",
"occurrence": 1
},
diff --cc scripts/ci/storage-bypass-baseline.json
index 3c181b5044,05d7fd2cca..bd6febeeff
--- a/scripts/ci/storage-bypass-baseline.json
+++ b/scripts/ci/storage-bypass-baseline.json
@@@ -216,13 -188,13 +188,6 @@@
"text": "tokio::fs::write(&file_path, audio_bytes)",
"occurrence": 1
},
-- {
-- "rule": "json-write",
- "path": "crates/openhuman-core/src/memory/files.rs",
- "line": 61,
- "text": "let mut options = std::fs::OpenOptions::new();",
- "path": "crates/openhuman-core/src/integrations/file_storage/tools/download.rs",
- "line": 89,
- "text": "if let Err(e) = tokio::fs::write(&path, &body).await {",
-- "occurrence": 1
-- },
{
"rule": "json-write",
"path": "crates/openhuman-core/src/memory/layout_migration/claim.rs",