Skip to content

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

fix(threads): handle staged attachment binding errors

Steven Enamakelec98216b25ac
diff --git a/crates/openhuman-core/src/threads/attachments.rs b/crates/openhuman-core/src/threads/attachments.rs
index 6f61e2f7d7..28d463cbbf 100644
--- a/crates/openhuman-core/src/threads/attachments.rs
+++ b/crates/openhuman-core/src/threads/attachments.rs
@@ -561,7 +561,13 @@ async fn discard_staged_entries(
part: entry.part.clone(),
canceled: true,
};
- publish_staged_claim(&claim_path, &cancellation).await?;
+ match publish_staged_claim(&claim_path, &cancellation).await {
+ Ok(_) => {}
+ Err(error) if error == "staged attachment is already bound to another message" => {
+ continue;
+ }
+ Err(error) => return Err(error),
+ }
let scope = crate::agent::attachments::AttachmentAccessScope {
external_channel: false,
workspace: Some(workspace.clone()),