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
docs(relay): clarify channel turn claim and event scoping
Steven Enamakel05077bbc544d
diff --git a/crates/openhuman-core/src/channels/providers/relay/README.md b/crates/openhuman-core/src/channels/providers/relay/README.mdindex 56f505679a..fe4cc4c609 100644--- a/crates/openhuman-core/src/channels/providers/relay/README.md+++ b/crates/openhuman-core/src/channels/providers/relay/README.md@@ -44,10 +44,10 @@ Replies are final messages only: the relay sink takes no streaming drafts or rea## How a message runs1. `params.rs` validates the message and derives its thread with `channels::bus::derive_inbound_thread_id`: `channel:<channel>/<sender>/<chat>`, the same id as the backend-relayed inbound path. A user cannot create such a thread through `threads_upsert`, which reserves `channel:`.-2. `store.rs` creates the thread in the workspace of the caller's config and appends the message (`user:<message_id>`). The process-wide channel persistence subscriber is told to skip this turn (`threads::store::claim_channel_turn`), so it is not mirrored under a second id.+2. `store.rs` creates the thread in the workspace of the caller's config and appends the message (`user:<message_id>`). In a single-user core the process-wide channel persistence subscriber is told to skip this turn (`threads::store::claim_channel_turn`), so it is not mirrored under a second id; in SaaS that subscriber is not registered and the claim is a no-op.3. `ops.rs` builds a one-message `ChannelRuntimeContext` from the caller's config and policy (`channels::runtime::build_channel_turn_parts` with `PromptToolDescs::Registered`, then `runtime_context`): the caller's tools, model and workspace, never the process's channel runtime. The pipeline's per-chat history is seeded from the thread's earlier rows. The turn runs in the background under the caller's scope (`spawn_scoped`).4. `process_channel_message` runs it like any channel message: slash commands, approval replies, then the orchestrator over `agent.run_turn` under the `ExternalChannel` origin.-5. `channel.rs`'s `RelayChannel` turns each send into a `channel_outbound` event. `publish_web_channel_event` stamps the publishing context, so only the caller's stream carries it.+5. `channel.rs`'s `RelayChannel` turns each send into a `channel_outbound` event. `publish_web_channel_event` stamps the publishing context's tenant (`profile`, `agent`), and `/events` filters on it, so only the caller's stream carries it.6. The texts sent are appended to the thread as one reply (`assistant:<message_id>`).## Filesdiff --git a/crates/openhuman-core/src/channels/providers/relay/ops.rs b/crates/openhuman-core/src/channels/providers/relay/ops.rsindex e0530bd4c0..1d6e72ec62 100644--- a/crates/openhuman-core/src/channels/providers/relay/ops.rs+++ b/crates/openhuman-core/src/channels/providers/relay/ops.rs@@ -44,7 +44,8 @@ pub async fn channel_relay_inbound(params: RelayInboundParams) -> Result<Outcome));}// The turn persists itself under this workspace; the process-wide- // subscriber would mirror it a second time under another id.+ // subscriber (single-user only; a no-op claim in SaaS) would mirror it a+ // second time under another id.crate::threads::store::claim_channel_turn(¶ms.channel, ¶ms.message_id);let request_id = uuid::Uuid::new_v4().to_string();diff --git a/crates/openhuman-core/src/threads/store/README.md b/crates/openhuman-core/src/threads/store/README.mdindex 82b3bd6ca4..0ba2cf6c28 100644--- a/crates/openhuman-core/src/threads/store/README.md+++ b/crates/openhuman-core/src/threads/store/README.md@@ -23,7 +23,9 @@ bus subscriber (see [`memory/`](../../memory/)).Telegram, ...) persist alongside the UI's own threads.A caller that persists a channel turn itself (the hosted-channel relay)calls `claim_channel_turn(channel, message_id)` first; the subscriber skips- claimed turns rather than mirroring them under a second thread id.+ claimed turns rather than mirroring them under a second thread id. In SaaS+ the subscriber is not registered and a claim is a no-op, so the untenanted+ `(channel, message_id)` key never spans profiles.## On-disk layout