Skip to content

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

refactor(threads): make channel projection binding async

Steven Enamakel3fe776ebae6e
diff --git a/crates/openhuman-core/src/threads/channel_projection.rs b/crates/openhuman-core/src/threads/channel_projection.rs
index 5cb3bc8c62..1056bc5858 100644
--- a/crates/openhuman-core/src/threads/channel_projection.rs
+++ b/crates/openhuman-core/src/threads/channel_projection.rs
@@ -118,7 +118,7 @@ pub(crate) fn bind_message(
provider_message_id: &str,
openhuman_thread_id: &str,
) -> Result<(), String> {
- let result = (|| -> Result<()> {
+ let result = async {
if openhuman_thread_id.is_empty() {
return Err(anyhow!("OpenHuman thread ID must be non-empty"));
}
@@ -126,7 +126,8 @@ pub(crate) fn bind_message(
let key = binding_key(tenant_key, channel, conversation, provider_message_id)?;
let repo = repo_for(ctx, &tenant)?;
bind_in(&repo, key, openhuman_thread_id)
- })();
+ }
+ .await;
result.map_err(|error| format!("{LOG_PREFIX} bind: {error:#}"))
}