Skip to content

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

refactor(web_chat): add event_context helper for web event context

Steven Enamakel112b168eb87e
diff --git a/crates/openhuman-core/src/web_chat/channel_event.rs b/crates/openhuman-core/src/web_chat/channel_event.rs
index d348144a11..113730f10a 100644
--- a/crates/openhuman-core/src/web_chat/channel_event.rs
+++ b/crates/openhuman-core/src/web_chat/channel_event.rs
@@ -8,6 +8,19 @@ pub use bus_web::{
SubagentUsagePayload, TurnTimingPayload, TurnUsagePayload, WebChannelEvent,
};
+pub(crate) fn event_context(
+ client_id: impl Into<String>,
+ thread_id: impl Into<String>,
+ request_id: impl Into<String>,
+) -> bus_web::WebEventContext {
+ bus_web::WebEventContext {
+ client_id: client_id.into(),
+ thread_id: thread_id.into(),
+ request_id: request_id.into(),
+ ..Default::default()
+ }
+}
+
/// A typed wire event plus tenant stamps used only for in-process routing.
///
/// `event` remains the TinyChannels-owned wire contract. The routing fields
diff --git a/crates/openhuman-core/src/web_chat/surface.rs b/crates/openhuman-core/src/web_chat/surface.rs
index e500a25f81..8097224adc 100644
--- a/crates/openhuman-core/src/web_chat/surface.rs
+++ b/crates/openhuman-core/src/web_chat/surface.rs
@@ -12,7 +12,6 @@ use tinychannels_bus::module_web_output::{
use tinychannels_bus::web as bus_web;
use super::event_bus_channel::publish_web_channel_event_in;
-use super::WebChannelEvent;
use crate::config::Config;
use crate::core::runtime::DispatchCtx;