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(threads): handle missing turn state gracefully
Steven Enamakel83c6a00d18eb
diff --git a/crates/openhuman-core/src/threads/turn_state/store.rs b/crates/openhuman-core/src/threads/turn_state/store.rsindex 05e4d772dc..5fa2bce13e 100644--- a/crates/openhuman-core/src/threads/turn_state/store.rs+++ b/crates/openhuman-core/src/threads/turn_state/store.rs@@ -146,6 +146,27 @@ impl TurnStateStore {Ok(removed)}+ /// Delete one turn's snapshot by `request_id`, leaving every other turn on+ /// the thread untouched. Returns `true` if a file was removed.+ ///+ /// Backs edit/regenerate (`threads.edit_message` / `threads.regenerate`):+ /// truncating the message log after a cut point orphans the turn+ /// snapshots for every dropped request — `delete(thread_id)` would also+ /// discard the turns kept *before* the cut, which a client's "Agentic+ /// task insights" trail for an earlier answer still needs.+ pub fn delete_turn(&self, thread_id: &str, request_id: &str) -> Result<bool, String> {+ let _guard = TURN_STATE_LOCK.lock();+ self.migrate_thread_locked(thread_id);+ let path = self.turn_path(thread_id, request_id);+ if !path.exists() {+ return Ok(false);+ }+ fs::remove_file(&path)+ .map_err(|e| format!("remove turn-state {}: {e}", path.display()))?;+ debug!("{LOG_PREFIX} deleted snapshot thread={thread_id} request={request_id}");+ Ok(true)+ }+/// List the latest turn for every thread. Used by the UI on cold boot to/// surface interrupted turns from a previous process (one entry per thread,/// preserving the pre-ring-store contract).