Skip to content

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

refactor(threads): drop unused turn state mirror observation

Steven Enamakel9ed13ec67492
diff --git a/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs b/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
index 0e82d86dde..7c20a8e46d 100644
--- a/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
+++ b/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
@@ -123,7 +123,7 @@ impl ObserveProgress for TurnStateMirror {
// Persist the plain-language failure so the explanation
// survives a thread switch / cold boot (#4459). Clear it on
// a (re-)success so a retried row doesn't keep stale copy.
- entry.failure = failure.as_ref().map(PersistedToolFailure::from);
+ entry.failure = failure.as_ref().map(persisted_tool_failure);
// Persist the (capped) result text so the rehydrated
// timeline can show what the tool returned, matching the
// live `tool_result` socket payload.
@@ -321,7 +321,7 @@ impl ObserveProgress for TurnStateMirror {
} else {
ToolTimelineStatus::Error
};
- let persisted_failure = failure.as_ref().map(PersistedToolFailure::from);
+ let persisted_failure = failure.as_ref().map(persisted_tool_failure);
if let Some(call) = activity
.tool_calls
.iter_mut()
diff --git a/crates/openhuman-core/src/threads/turn_state/rpc_types.rs b/crates/openhuman-core/src/threads/turn_state/rpc_types.rs
index b04e75db3f..49565eb3a1 100644
--- a/crates/openhuman-core/src/threads/turn_state/rpc_types.rs
+++ b/crates/openhuman-core/src/threads/turn_state/rpc_types.rs
@@ -56,8 +56,12 @@ pub struct ClearTurnStateResponse {
pub cleared: bool,
}
-impl From<&tinytools::status::ClassifiedFailure> for PersistedToolFailure {
- fn from(f: &tinytools::status::ClassifiedFailure) -> Self {
+/// Project a classified tool failure onto its persisted wire shape.
+///
+/// A free function rather than a `From` impl: both types are foreign to this
+/// crate (`tinytools` and `tinyagents_session`).
+pub(crate) fn persisted_tool_failure(f: &tinytools::status::ClassifiedFailure) -> PersistedToolFailure {
+ {
// Serialize the enums to their wire variant name so the persisted
// `class`/`category` strings match exactly what the live socket emits
// (`ClassifiedFailure` serializes each as its bare variant name).
@@ -67,7 +71,7 @@ impl From<&tinytools::status::ClassifiedFailure> for PersistedToolFailure {
.and_then(|j| j.as_str().map(str::to_string))
.unwrap_or_default()
}
- Self {
+ PersistedToolFailure {
class: variant_name(&f.class),
category: variant_name(&f.category),
recoverable: f.recoverable,