Skip to content

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

refactor(runtime): remove draft update support

Steven Enamakelc49da3031114
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 4889635cb8..4febf5edb4 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
@@ -436,59 +436,6 @@ impl Channel for ModuleChannel {
self.interaction.supports_reactions
}
- fn supports_draft_updates(&self) -> bool {
- self.interaction.supports_draft_updates
- }
-
- async fn send_draft(&self, message: &SendMessage) -> anyhow::Result<Option<String>> {
- match self
- .object
- .call_confidential::<ChannelInteractionResult>(
- tinychannels_bus::methods::CHANNEL_INTERACTION,
- tinychannels_bus::ChannelInteractionRequest {
- channel: self.name.clone(),
- interaction: ChannelInteraction::SendDraft {
- message: message.clone(),
- },
- },
- )
- .await
- .map_err(anyhow::Error::new)?
- {
- ChannelInteractionResult::Draft(id) => Ok(id),
- _ => anyhow::bail!("channel returned an invalid draft result"),
- }
- }
-
- async fn update_draft(
- &self,
- recipient: &str,
- message_id: &str,
- text: &str,
- ) -> anyhow::Result<()> {
- self.interact(ChannelInteraction::UpdateDraft {
- recipient: recipient.into(),
- message_id: message_id.into(),
- text: text.into(),
- })
- .await
- }
-
- async fn finalize_draft(
- &self,
- recipient: &str,
- message_id: &str,
- text: &str,
- thread_ts: Option<&str>,
- ) -> anyhow::Result<()> {
- self.interact(ChannelInteraction::FinalizeDraft {
- recipient: recipient.into(),
- message_id: message_id.into(),
- text: text.into(),
- thread_ts: thread_ts.map(str::to_owned),
- })
- .await
- }
}
impl ModuleChannel {
diff --git a/crates/openhuman-core/src/channels/runtime/test_support.rs b/crates/openhuman-core/src/channels/runtime/test_support.rs
index 41e458468a..14c9d4d2c5 100644
--- a/crates/openhuman-core/src/channels/runtime/test_support.rs
+++ b/crates/openhuman-core/src/channels/runtime/test_support.rs
@@ -31,7 +31,6 @@ pub struct DispatchHarnessOptions {
pub content: String,
pub thread_ts: Option<String>,
pub inbound_envelope: Option<tinychannels_bus::ChannelInboundEnvelope>,
- pub streaming: bool,
pub supports_reactions: bool,
pub response_text: Option<String>,
pub handler_error: Option<String>,
@@ -101,7 +100,6 @@ impl Default for DispatchHarnessOptions {
content: "hello".to_string(),
thread_ts: None,
inbound_envelope: None,
- streaming: false,
supports_reactions: false,
response_text: Some("dispatch ok".to_string()),
handler_error: None,
@@ -143,7 +141,6 @@ struct HarnessState {
struct HarnessChannel {
name: String,
- streaming: bool,
supports_reactions: bool,
state: Arc<HarnessState>,
}
@@ -182,45 +179,7 @@ impl Channel for HarnessChannel {
self.supports_reactions
}
- fn supports_draft_updates(&self) -> bool {
- self.streaming
- }
-
- async fn send_draft(&self, message: &SendMessage) -> Result<Option<String>> {
- self.state.sends.lock().await.push(ObservedSend {
- kind: "draft",
- recipient: message.recipient.clone(),
- content: message.content.clone(),
- thread_ts: message.thread_ts.clone(),
- });
- Ok(Some("draft-1".to_string()))
- }
- async fn update_draft(&self, recipient: &str, message_id: &str, text: &str) -> Result<()> {
- self.state.sends.lock().await.push(ObservedSend {
- kind: "update_draft",
- recipient: format!("{recipient}:{message_id}"),
- content: text.to_string(),
- thread_ts: None,
- });
- Ok(())
- }
-
- async fn finalize_draft(
- &self,
- recipient: &str,
- message_id: &str,
- text: &str,
- thread_ts: Option<&str>,
- ) -> Result<()> {
- self.state.sends.lock().await.push(ObservedSend {
- kind: "finalize_draft",
- recipient: format!("{recipient}:{message_id}"),
- content: text.to_string(),
- thread_ts: thread_ts.map(str::to_string),
- });
- Ok(())
- }
}
struct HarnessModel;
@@ -366,7 +325,6 @@ pub async fn run_dispatch_harness(options: DispatchHarnessOptions) -> DispatchHa
let state = Arc::new(HarnessState::default());
let channel_impl = Arc::new(HarnessChannel {
name: options.channel_name.clone(),
- streaming: options.streaming,
supports_reactions: options.supports_reactions,
state: Arc::clone(&state),
});