Skip to content

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

refactor(agent): narrow deleted marker visibility and update docs

Steven Enamakelbe2b4eac4476
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions.rs b/crates/openhuman-core/src/agent/orchestration/background_completions.rs
index 7e0c30012d..8db949454b 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions.rs
@@ -26,7 +26,7 @@ use std::collections::{HashMap, HashSet, VecDeque};
mod parent_lifecycle;
mod store_adapter;
mod thread_index;
-pub(super) use parent_lifecycle::is_marked_deleted;
+use parent_lifecycle::is_marked_deleted;
pub(crate) use parent_lifecycle::{
clear_all, discard_for_thread, discard_pending_for_thread, finish_stop_for_thread,
mark_stopped_task_if_thread_stopped, resume_stopped_thread,
@@ -52,8 +52,8 @@ use tinyagents_orchestration::subagent::{
record_detached_completion, DetachedCompletionTarget, DetachedSubagentStatus,
};
use tinyagents_tasks::{
- CompletionRecord, CompletionResult, CompletionRouter, CompletionState, CompletionStatus,
- CompletionStore, NotifyMode, TombstoneOutcome,
+ CompletionRecord, CompletionResult, CompletionRouter, CompletionState, CompletionStore,
+ NotifyMode, TombstoneOutcome,
};
use super::completion_notice::BackgroundCompletionFormatter;
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions/parent_lifecycle.rs b/crates/openhuman-core/src/agent/orchestration/background_completions/parent_lifecycle.rs
index 6a0fb586bf..d7f195653e 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions/parent_lifecycle.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions/parent_lifecycle.rs
@@ -46,11 +46,9 @@ pub(crate) fn discard_for_thread(
removed
}
-/// Task id of the durable "this thread was deleted" marker. The router's
-/// cancelled-parent marker cannot tell a delete from a Stop (a Stop is lifted
-/// when the user returns), so a delete also leaves this one, which nothing
-/// lifts. It is stored `Pending` (with no parent, so nothing ever claims it):
-/// compaction only drops settled records, and a deletion must outlive them.
+/// Task id used by the legacy durable "this thread was deleted" marker.
+/// Current deletions use the router's `ParentDeleted` lifecycle state; this
+/// marker remains readable for rows written by older host versions.
fn deleted_marker_id(thread_id: &str) -> String {
format!("\u{1}host-thread-deleted:{thread_id}")
}