Skip to content

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

fix(channels): handle typed sends and project v2 interaction info

Steven Enamakel8b4116cfe330
diff --git a/crates/openhuman-core/src/channels/bus/delivery.rs b/crates/openhuman-core/src/channels/bus/delivery.rs
index 4df01bde8f..611d789c6b 100644
--- a/crates/openhuman-core/src/channels/bus/delivery.rs
+++ b/crates/openhuman-core/src/channels/bus/delivery.rs
@@ -106,6 +106,13 @@ impl ManagedTransport {
.send_channel_typing(&channel, &self.credential)
.await
}
+ // Typed sends and canonical output events are delivered by the
+ // module's own adapters; the hosted relay transport has no route
+ // for them yet.
+ ProgressiveTransportRequest::OutputEvent { .. }
+ | ProgressiveTransportRequest::SendTyped { .. } => {
+ return ProgressiveTransportResult::Unavailable;
+ }
};
match result {
Ok(value) => ProgressiveTransportResult::Success(value),
@@ -133,7 +140,7 @@ impl ManagedTransport {
return Err(tinybus::Error::failed("callback capability unavailable"));
};
Ok(ChannelBackendResult::ProgressiveTransport(
- self.execute(*request).await,
+ Box::new(self.execute(*request).await),
))
}
}
diff --git a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
index c8061aa6a6..030a6093b0 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
@@ -39,6 +39,20 @@ struct ModuleChannel {
relay_fronted: bool,
}
+/// Project the module's configured-instance descriptor onto the pre-v2
+/// facts the host's `Channel` adapter still reads.
+fn legacy_interaction(
+ info: &tinychannels_bus::ChannelInteractionInfoV2,
+) -> tinychannels_bus::ChannelInteractionInfo {
+ let caps = &info.capabilities;
+ tinychannels_bus::ChannelInteractionInfo {
+ capabilities: tinychannels_bus::LegacyChannelCapabilities::from(caps),
+ proactive_target: caps.account.proactive_target.clone(),
+ supports_reactions: caps.reactions,
+ supports_draft_updates: caps.progressive_edits,
+ }
+}
+
impl ModuleChannelRuntime {
pub(super) async fn prepare(
dispatch_ctx: &crate::core::runtime::DispatchCtx,
@@ -121,7 +135,7 @@ impl ModuleChannelRuntime {
let channel = ModuleChannel {
name: info.name.clone(),
object: lease.object().clone(),
- interaction: info.interaction.clone(),
+ interaction: legacy_interaction(&info.interaction),
relay: relay.clone(),
relay_fronted: relay_fronts(&info.name),
};