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(embed): retry workspace cleanup on drop to avoid race with background writers\n\nThe harness drop handler now takes ownership of the ephemeral workspace's temp path and retries directory removal up to 20 times with 50ms pauses. This prevents the documented "removed with its harness" guarantee from being broken when background memory or session writers recreate subdirectories after the harness returns from a turn.\n\nAuto-committed-on: dragonfly\n
Steven Enamakelcacc85360ad5
diff --git a/src/embed/harness/mod.rs b/src/embed/harness/mod.rsindex 01b05a1977..6bc8d53b4b 100644--- a/src/embed/harness/mod.rs+++ b/src/embed/harness/mod.rs@@ -185,6 +185,22 @@ impl Harness {impl Drop for Harness {fn drop(&mut self) {HARNESS_LIVE.store(false, std::sync::atomic::Ordering::Release);+ // For an ephemeral workspace, take ownership of the temp path and+ // remove it with a short retry. The core's memory/session writers keep+ // running a moment after the harness returns from a turn and can+ // recreate workspace subdirectories while `TempDir`'s own drop-time+ // removal is racing them, leaving an empty directory behind and+ // breaking the documented "removed with its harness" guarantee. A+ // bounded retry lets those writes settle before we give up.+ if let Some(temp) = self._workspace._temp.take() {+ let root = temp.into_path();+ for _ in 0..20 {+ if std::fs::remove_dir_all(&root).is_ok() {+ break;+ }+ std::thread::sleep(std::time::Duration::from_millis(50));+ }+ }log::debug!("[embed][harness] released");}}