Skip to content

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

feat(channels): add startup callback for channel runtime

Steven Enamakel80a53c334d94
diff --git a/crates/openhuman-core/src/channels/runtime/startup/callback.rs b/crates/openhuman-core/src/channels/runtime/startup/callback.rs
index 8fcacb1043..48e46b5530 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/callback.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/callback.rs
@@ -1,14 +1,12 @@
-//! Identity-scoped implementation of TinyChannels' 14 host callbacks.
+//! Identity-scoped implementation of TinyChannels' host callbacks (durable state goes through the storage bus).
-use super::delivery_store::ChannelDeliveryStore;
use crate::channels::context::ChannelRuntimeContext;
use crate::channels::runtime::dispatch::RuntimeChannelMessage;
use crate::config::Config;
use std::sync::{Arc, OnceLock, Weak};
use tinybus::{Error, Result};
use tinychannels_bus::{
- ChannelBackendRequest, ChannelBackendResult, DeliveryQueueEntry, DeliveryTerminalResult,
- HostEventPublication, HostTranscriptionRequest, HostTranscriptionResult,
+ ChannelBackendRequest, ChannelBackendResult, HostEventPublication, HostTranscriptionRequest, HostTranscriptionResult,
};
use tokio::sync::mpsc;
@@ -26,7 +24,6 @@ pub(super) struct ChannelHostCallbacks {
cancellation: tokio_util::sync::CancellationToken,
context: Arc<OnceLock<Weak<ChannelRuntimeContext>>>,
dispatch: mpsc::Sender<RuntimeChannelMessage>,
- delivery: ChannelDeliveryStore,
}
impl ChannelHostCallbacks {
@@ -35,7 +32,6 @@ impl ChannelHostCallbacks {
context: Arc<OnceLock<Weak<ChannelRuntimeContext>>>,
dispatch: mpsc::Sender<RuntimeChannelMessage>,
) -> Self {
- let delivery = ChannelDeliveryStore::for_workspace(&config.workspace_dir);
Self {
config,
core_context: crate::core::runtime::CoreContext::current(),
@@ -45,7 +41,6 @@ impl ChannelHostCallbacks {
cancellation: crate::channels::runtime::session::channel_session(),
context,
dispatch,
- delivery,
}
}
@@ -127,65 +122,6 @@ impl ChannelHostCallbacks {
.map_err(|_| Error::failed("channel identity persistence failed"))
}
- async fn save_pending_delivery(&self, entry: DeliveryQueueEntry) -> Result<()> {
- Self::validate_callback_size(&entry)?;
- self.delivery
- .save_pending(entry)
- .await
- .map_err(|_| Error::failed("delivery persistence failed"))
- }
-
- async fn load_pending_delivery(&self, id: String) -> Result<Option<DeliveryQueueEntry>> {
- self.delivery
- .load_pending(id)
- .await
- .map_err(|_| Error::failed("delivery lookup failed"))
- }
-
- async fn load_pending_deliveries(&self) -> Result<Vec<DeliveryQueueEntry>> {
- self.delivery
- .load_pending_all()
- .await
- .map_err(|_| Error::failed("delivery lookup failed"))
- }
-
- async fn remove_pending_delivery(&self, id: String) -> Result<()> {
- self.delivery
- .remove_pending(id)
- .await
- .map_err(|_| Error::failed("delivery removal failed"))
- }
-
- async fn save_failed_delivery(&self, entry: DeliveryQueueEntry) -> Result<()> {
- Self::validate_callback_size(&entry)?;
- self.delivery
- .save_failed(entry)
- .await
- .map_err(|_| Error::failed("failed delivery persistence failed"))
- }
-
- async fn load_failed_delivery(&self, id: String) -> Result<Option<DeliveryQueueEntry>> {
- self.delivery
- .load_failed(id)
- .await
- .map_err(|_| Error::failed("failed delivery lookup failed"))
- }
-
- async fn save_delivery_result(&self, result: DeliveryTerminalResult) -> Result<()> {
- Self::validate_callback_size(&result)?;
- self.delivery
- .save_result(result)
- .await
- .map_err(|_| Error::failed("delivery result persistence failed"))
- }
-
- async fn load_delivery_result(&self, id: String) -> Result<Option<DeliveryTerminalResult>> {
- self.delivery
- .load_result(id)
- .await
- .map_err(|_| Error::failed("delivery result lookup failed"))
- }
-
async fn transcribe(
&self,
request: HostTranscriptionRequest,