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
refactor(todo): use session store directly for todo persistence
Steven Enamakel18e174309b25
diff --git a/crates/openhuman-core/src/agent/tools/todo.rs b/crates/openhuman-core/src/agent/tools/todo.rsindex 1678b556da..e23bd13573 100644--- a/crates/openhuman-core/src/agent/tools/todo.rs+++ b/crates/openhuman-core/src/agent/tools/todo.rs@@ -18,11 +18,11 @@//! dropped by the rekey.use crate::agent::harness::fork_context::ParentExecutionContext;-use crate::agent::todos::ops::{self, TodoScope};+use crate::agent::tools::todo::TodoScope;use async_trait::async_trait;use std::path::PathBuf;use std::sync::Arc;-use tinyagents_graph::todos as graph_todos;+use tinyagents_graph::todos::{self as graph_todos, store as todos_store};use tinyagents_harness::context::RunContext;use tinyagents_harness::tool::{ToolDispatch, ToolExecutionContext};use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolRunContext};@@ -32,6 +32,25 @@ pub struct TodoTool {workspace_dir: PathBuf,}+#[derive(Debug, Clone, PartialEq, Eq)]+pub enum TodoScope {+ Session { id: String },+ Scratch,+}++impl TodoScope {+ pub fn session_id(&self) -> Option<&str> {+ match self {+ Self::Session { id } => Some(id),+ Self::Scratch => None,+ }+ }++ fn key(&self) -> &str {+ self.session_id().unwrap_or("_scratch_")+ }+}+pub(crate) struct TodoToolDispatch {tool: Arc<dyn Tool>,}@@ -105,7 +124,9 @@ impl ToolDispatch<(), crate::agent::tinyagents::host::OpenHumanRunContext> for Timpl TodoTool {pub fn new(workspace_dir: PathBuf) -> Self {Self {- inner: graph_todos::TodoTool::new(ops::store(&workspace_dir)),+ inner: graph_todos::TodoTool::new(+ crate::agent::session_store::stores_or_ephemeral(&workspace_dir).kv,+ ),workspace_dir,}}@@ -184,7 +205,8 @@ impl TodoTool {/// swallowed — a failed migration just means the tool starts from an/// empty list, same as any other first `todo` call.async fn migrate_legacy_list_if_absent(&self, scope: &TodoScope, legacy_key: &str) {- let current = match ops::list(&self.workspace_dir, scope).await {+ let store = crate::agent::session_store::stores_or_ephemeral(&self.workspace_dir).kv;+ let current = match todos_store::list(&store, scope.key()).await {Ok(snapshot) => snapshot,Err(e) => {tracing::debug!(error = %e, "[tool][todo] legacy-migration: current list read failed");@@ -194,10 +216,7 @@ impl TodoTool {if !current.items.is_empty() {return;}- let legacy_scope = TodoScope::Session {- id: legacy_key.to_string(),- };- match ops::list(&self.workspace_dir, &legacy_scope).await {+ match todos_store::list(&store, legacy_key).await {Ok(legacy) if !legacy.items.is_empty() => {tracing::info!(legacy_key,@@ -205,7 +224,7 @@ impl TodoTool {items = legacy.items.len(),"[tool][todo] migrating legacy session-keyed list to thread-keyed list");- if let Err(e) = ops::replace(&self.workspace_dir, scope, legacy.items).await {+ if let Err(e) = todos_store::replace(&store, scope.key(), legacy.items).await {tracing::debug!(error = %e, "[tool][todo] legacy-migration: write failed");}}diff --git a/scripts/ci/check-openhuman-rust-layout.mjs b/scripts/ci/check-openhuman-rust-layout.mjsindex 3fa8be758b..b38f603aa6 100644--- a/scripts/ci/check-openhuman-rust-layout.mjs+++ b/scripts/ci/check-openhuman-rust-layout.mjs@@ -27,7 +27,7 @@ const LEGACY_LIMIT_ENTRIES = [// under the general 750 limit, so it needs no exception at all.// The session-todo integration added transcript metadata construction to// this already-exempt composition seam. Keep its allowance exact.- ["crates/openhuman-core/src/agent/session_host/runtime_session.rs", 1046],+ ["crates/openhuman-core/src/agent/session_host/runtime_session.rs", 1044],// Session-host factory still assembles the product's deliberately coupled// provider, security, memory, tool and prompt policy. Generic session// state moved to tinyagents-runtime; this remaining composition is split indiff --git a/vendor/tinyagents b/vendor/tinyagentsindex d919a543a4..7e659ebb53 160000--- a/vendor/tinyagents+++ b/vendor/tinyagents@@ -1 +1 @@-Subproject commit d919a543a43e2bd08c3f0f7dcbcdfb58fd425a2a+Subproject commit 7e659ebb53fa5469fbcf17b24ccb6d2d4f8835c9