Skip to content

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

fix(session-host): handle native attachment lease marking after commit

Steven Enamakel65af833cc5f3
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs
index e23e8ee59f..75db86e5ff 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit.rs
@@ -151,7 +151,7 @@ pub(super) async fn finalize_committed_turn(
.thread_id
.as_deref()
.unwrap_or_default();
- if let Err(error) = crate::threads::attachments::commit_native_channel_parts(
+ match crate::threads::attachments::commit_native_channel_parts(
&dispatch,
thread_id,
&committed,
@@ -159,7 +159,14 @@ pub(super) async fn finalize_committed_turn(
)
.await
{
- tracing::warn!("[session-runtime] native attachment claim failed after commit: {error}");
+ Ok(()) => {
+ if let Some(lease) = receipt.options.context.native_staged_lease.as_ref() {
+ lease.mark_committed();
+ }
+ }
+ Err(error) => {
+ tracing::warn!("[session-runtime] native attachment claim failed after commit: {error}");
+ }
}
}
}