The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
feat(agent): carry trusted turn identity through queue rehydration
Steven Enamakel2ebad5c9a173
diff --git a/crates/openhuman-core/src/agent/queued_turn.rs b/crates/openhuman-core/src/agent/queued_turn.rsindex 9df5af34da..ba8c1c63a0 100644--- a/crates/openhuman-core/src/agent/queued_turn.rs+++ b/crates/openhuman-core/src/agent/queued_turn.rs@@ -5,6 +5,7 @@//! orchestration metadata needed to dispatch a deferred follow-up turn.use tinyagents_harness::turn_runner::{QueueDisposition, RequeuePayload, ScopeKey, TurnRequest};+use std::sync::Arc;/// The host metadata one OpenHuman turn carries through TinyAgents' turn/// runner and its run queue: which client asked, the per-message model and@@ -25,6 +26,10 @@ pub struct QueuedPayload {pub locale: Option<String>,pub metadata: tinychannels_bus::web::ChatRequestMetadata,pub queued_at_ms: u64,+ /// Already-resolved internal agent authority and durable channel identity.+ /// Requeued placeholders inherit it from their running turn; public chat+ /// metadata never supplies or overrides this value.+ pub(crate) trusted_turn: Option<Arc<super::turn_host::TrustedAgentTurn>>,}impl std::fmt::Debug for QueuedPayload {@@ -35,6 +40,7 @@ impl std::fmt::Debug for QueuedPayload {.field("temperature", &self.temperature).field("locale", &self.locale).field("queued_at_ms", &self.queued_at_ms)+ .field("has_trusted_turn", &self.trusted_turn.is_some()).finish_non_exhaustive()}}@@ -51,6 +57,9 @@ impl RequeuePayload for QueuedPayload {if self.ctx.is_none() {self.ctx.clone_from(&running.ctx);}+ if self.trusted_turn.is_none() {+ self.trusted_turn.clone_from(&running.trusted_turn);+ }if self.client_id.is_empty() {self.client_id.clone_from(&running.client_id);self.model_override.clone_from(&running.model_override);diff --git a/crates/openhuman-core/src/agent/turn_host.rs b/crates/openhuman-core/src/agent/turn_host.rsindex c33fe51eb5..860d7a4076 100644--- a/crates/openhuman-core/src/agent/turn_host.rs+++ b/crates/openhuman-core/src/agent/turn_host.rs@@ -11,6 +11,7 @@ use tokio::sync::mpsc;use crate::{agent::{+ host_agents::HostAgent,queued_turn::QueuedTurn,session_host::OpenHumanSessionHost,turn_env::HostTurnEnv,@@ -19,6 +20,34 @@ use crate::{security::approval::ApprovalTurnContext,};+/// Trusted identity and authority selected at an inbound host boundary.+///+/// This value is carried internally through queue rehydration. It is never+/// serialized into chat metadata or accepted from an RPC/model request.+#[derive(Clone)]+pub(crate) struct TrustedAgentTurn {+ pub(crate) host_agent: HostAgent,+ pub(crate) channel: String,+ pub(crate) session_key: String,+ pub(crate) event_session_id: String,+ pub(crate) origin: AgentTurnOrigin,+ pub(crate) approval: ApprovalTurnContext,+ pub(crate) relay_thread: Option<String>,+ pub(crate) imported_history: Vec<tinyagents_session::transcript::TranscriptMessage>,+}++impl std::fmt::Debug for TrustedAgentTurn {+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+ f.debug_struct("TrustedAgentTurn")+ .field("agent_id", &self.host_agent.definition.id)+ .field("channel", &self.channel)+ .field("session_scoped", &!self.session_key.is_empty())+ .field("relay_thread", &self.relay_thread)+ .field("imported_history_rows", &self.imported_history.len())+ .finish_non_exhaustive()+ }+}+/// The trusted, already-routed inputs for one agent turn.pub(crate) struct AgentTurnRequest {pub(crate) message: String,