The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(store): handle missing conversation in delete operation
Steven Enamakel497c3c267d9f
diff --git a/crates/openhuman-core/src/memory/conversations/store/store_ops.rs b/crates/openhuman-core/src/memory/conversations/store/store_ops.rsindex 469ed40232..c61e15b6e6 100644--- a/crates/openhuman-core/src/memory/conversations/store/store_ops.rs+++ b/crates/openhuman-core/src/memory/conversations/store/store_ops.rs@@ -281,6 +281,47 @@ impl ConversationStore {Ok(updated)}+ /// Truncate a thread's message log at `message_id`: drop that message and+ /// every message after it (append order == chronological order), keeping+ /// everything before it. Backs `threads.edit_message` / `threads.regenerate`+ /// (edit/regenerate rewrite the tail of a conversation, never the middle).+ ///+ /// Returns the number of messages removed, or `Ok(None)` if `message_id`+ /// is not present in the thread (a stale/unknown cut point — the caller+ /// should treat this as "nothing to truncate", not silently drop the+ /// whole log).+ ///+ /// Evicts the thread from the cross-thread search index the same way+ /// [`Self::delete_thread`] does: the index has no per-message removal, so+ /// the conservative move is to drop the whole thread's postings rather+ /// than search a stale truncated message back into a hit. The next+ /// cross-thread search that touches this thread re-primes it from the+ /// (now-truncated) file on disk.+ pub fn delete_messages_from(+ &self,+ thread_id: &str,+ message_id: &str,+ ) -> Result<Option<usize>, String> {+ let _lifecycle = self.locks.lifecycle.read();+ let thread_lock = self.locks.thread(thread_id);+ let _thread = thread_lock.lock();+ let path = self.thread_messages_path(thread_id);+ let messages = read_jsonl::<ConversationMessage>(&path)?;+ let Some(cut_at) = messages.iter().position(|m| m.id == message_id) else {+ return Ok(None);+ };+ let removed = messages.len() - cut_at;+ let kept = &messages[..cut_at];+ rewrite_jsonl(&path, kept)?;+ {+ let mut cache = CONVERSATION_INDEX_CACHE.lock();+ if let Some(idx) = cache.get_mut(&self.root_dir()) {+ idx.remove_thread(thread_id);+ }+ }+ Ok(Some(removed))+ }+/// Append a `Delete` entry and remove the thread's messages file. Returns/// `false` if the thread did not exist.pub fn delete_thread(&self, thread_id: &str, deleted_at: &str) -> Result<bool, String> {