Skip to content

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

refactor(relay): build outbound event via ChannelOutbound variant

Steven Enamakel210eaacad3f7
diff --git a/crates/openhuman-core/src/channels/providers/relay/channel.rs b/crates/openhuman-core/src/channels/providers/relay/channel.rs
index 8aadcbae8a..1bb66699c9 100644
--- a/crates/openhuman-core/src/channels/providers/relay/channel.rs
+++ b/crates/openhuman-core/src/channels/providers/relay/channel.rs
@@ -61,11 +61,12 @@ impl RelayChannel {
/// takes them from the publishing context's tenant, so `/events` hands the
/// reply only to the caller's own stream.
pub fn outbound_event(&self, message: &SendMessage) -> WebChannelEvent {
- WebChannelEvent {
- event: CHANNEL_OUTBOUND_EVENT.to_string(),
- client_id: self.client_id.clone(),
- thread_id: self.thread_id.clone(),
- request_id: self.request_id.clone(),
+ WebChannelEvent::ChannelOutbound {
+ context: crate::web_chat::channel_event::event_context(
+ self.client_id.clone(),
+ self.thread_id.clone(),
+ self.request_id.clone(),
+ ),
full_response: Some(message.content.clone()),
structured: Some(json!({
"kind": CHANNEL_OUTBOUND_EVENT,
@@ -75,7 +76,6 @@ impl RelayChannel {
"reply_to_message_id": self.reply_to,
"idempotency_key": message.idempotency_key,
})),
- ..Default::default()
}
}
}