Skip to content

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

refactor(core): import session and budget types from source crates

Steven Enamakela0bd7a4c3d73
diff --git a/crates/openhuman-core/src/agent/goals/mod.rs b/crates/openhuman-core/src/agent/goals/mod.rs
index d3a36b4e6e..c3c69d8ba3 100644
--- a/crates/openhuman-core/src/agent/goals/mod.rs
+++ b/crates/openhuman-core/src/agent/goals/mod.rs
@@ -10,7 +10,7 @@ pub mod runtime;
pub mod store;
pub mod tools;
-pub use tinyagents_graph::goals::{ThreadGoal, ThreadGoalStatus};
+use tinyagents_graph::goals::{ThreadGoal, ThreadGoalStatus};
pub use tools::goal_tools;
/// Serialize a [`ThreadGoal`] for the `goal` field on `ThreadGoalUpdated` /
diff --git a/crates/openhuman-core/src/agent/goals/store.rs b/crates/openhuman-core/src/agent/goals/store.rs
index ffd2ac0fd0..5d5ced2cca 100644
--- a/crates/openhuman-core/src/agent/goals/store.rs
+++ b/crates/openhuman-core/src/agent/goals/store.rs
@@ -16,8 +16,8 @@
use std::path::Path;
use std::sync::Arc;
-use super::ThreadGoal;
use tinyagents_graph::goals::store as crate_store;
+use tinyagents_graph::goals::ThreadGoal;
use tinyagents_harness::store::Store;
use tinyagents_session::transcript::import::ops::open_session_stores;
diff --git a/crates/openhuman-core/src/agent/host_overrides.rs b/crates/openhuman-core/src/agent/host_overrides.rs
index 30c8d732b2..338e669aa3 100644
--- a/crates/openhuman-core/src/agent/host_overrides.rs
+++ b/crates/openhuman-core/src/agent/host_overrides.rs
@@ -26,7 +26,7 @@ pub struct HostOverrides {
/// Role-specific native models; absent roles use `model` or config routing.
pub role_models: BTreeMap<String, Arc<dyn ChatModel<()>>>,
/// The agent's durable session store, ahead of the runtime's store.
- pub session_store: Option<Arc<dyn crate::agent::session_store::SessionStoreProvider>>,
+ pub session_store: Option<Arc<dyn tinyagents_session::port::SessionStoreProvider>>,
}
impl std::fmt::Debug for HostOverrides {
diff --git a/crates/openhuman-core/src/agent/multimodal.rs b/crates/openhuman-core/src/agent/multimodal.rs
index 877911a5f2..7d711aa3c0 100644
--- a/crates/openhuman-core/src/agent/multimodal.rs
+++ b/crates/openhuman-core/src/agent/multimodal.rs
@@ -26,7 +26,7 @@ use tinyagents_harness::multimodal::{
AttachmentStash,
};
-pub use tinyagents_harness::multimodal::{FilePayload, MultimodalError};
+use tinyagents_harness::multimodal::{FilePayload, MultimodalError};
/// Hard upper bound on how long the `tinydocs` module may spend extracting a
/// PDF's text layer before the attempt is abandoned and the file degrades to a
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
index 3b48ac420a..e343a25b17 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
@@ -332,7 +332,7 @@ async fn committed_goal_accounting_uses_direct_and_completed_child_usage() {
);
assert_eq!(
goal.status,
- crate::agent::goals::ThreadGoalStatus::BudgetLimited,
+ tinyagents_graph::goals::ThreadGoalStatus::BudgetLimited,
"receipt-backed accounting advances continuation/budget state"
);
}
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index 5f3e73bc4d..0020b518e3 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -423,7 +423,10 @@ impl OpenHumanTurnPrelude {
.await;
match loaded {
Some(goal)
- if matches!(goal.status, crate::agent::goals::ThreadGoalStatus::Paused) =>
+ if matches!(
+ goal.status,
+ tinyagents_graph::goals::ThreadGoalStatus::Paused
+ ) =>
{
crate::agent::goals::runtime::resume_for_thread(
&self.workspace_dir,
diff --git a/crates/openhuman-core/src/agent/session_store/mod.rs b/crates/openhuman-core/src/agent/session_store/mod.rs
index 3926e45165..8891f068c9 100644
--- a/crates/openhuman-core/src/agent/session_store/mod.rs
+++ b/crates/openhuman-core/src/agent/session_store/mod.rs
@@ -17,7 +17,7 @@
use std::sync::{Arc, LazyLock, PoisonError, RwLock};
pub use agent_transcripts::{agent_transcript_root, AgentTranscriptFiles};
-pub use tinyagents_session::port::{AgentStores, SessionStoreProvider};
+use tinyagents_session::port::{AgentStores, SessionStoreProvider};
mod agent_transcripts;
diff --git a/crates/openhuman-core/src/agent/tinyagents/budget.rs b/crates/openhuman-core/src/agent/tinyagents/budget.rs
index 8f4b2ff886..8af7df4f3f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/budget.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/budget.rs
@@ -1,6 +1,6 @@
//! Host budget policy, scoped once at admission and carried explicitly to children.
use std::sync::Arc;
-pub use tinyinference_llm::model::budget::{
+use tinyinference_llm::model::budget::{
Budget, BudgetExceeded, BudgetSnapshot, CallBudget, Spend, SpendLimits,
};
use tinyinference_llm::model::ChatModel;
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs
index d72e60b5c5..c502416e78 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs
@@ -385,7 +385,11 @@ fn attach_parent_keeps_the_snapshot_sink_when_the_run_has_none() {
#[test]
fn child_inherits_shared_model_budget_and_narrowed_depth_limit() {
- use crate::agent::tinyagents::budget::{Budget, CallBudget, ModelBudget, Spend, SpendLimits};
+ use {
+ crate::agent::tinyagents::budget::ModelBudget, tinyinference_llm::model::budget::Budget,
+ tinyinference_llm::model::budget::CallBudget, tinyinference_llm::model::budget::Spend,
+ tinyinference_llm::model::budget::SpendLimits,
+ };
let ledger = Budget::new(SpendLimits {
tokens: Some(100),
cost_micros: None,
diff --git a/crates/openhuman-embed/src/budget.rs b/crates/openhuman-embed/src/budget.rs
index 35559d9aaa..39cb7d3b82 100644
--- a/crates/openhuman-embed/src/budget.rs
+++ b/crates/openhuman-embed/src/budget.rs
@@ -18,6 +18,9 @@
//! Budgeted calls currently accept text only. Input bounds use serialized-byte
//! counts conservatively; multimodal requests fail before dispatch. Choose
//! bounds that include model framing and the maximum price on allowed routes.
-pub use openhuman_core::agent::tinyagents::budget::{
- Budget, BudgetExceeded, BudgetSnapshot, CallBudget, ModelBudget, Spend, SpendLimits,
+pub use {
+ openhuman_core::agent::tinyagents::budget::ModelBudget,
+ tinyinference_llm::model::budget::Budget, tinyinference_llm::model::budget::BudgetExceeded,
+ tinyinference_llm::model::budget::BudgetSnapshot, tinyinference_llm::model::budget::CallBudget,
+ tinyinference_llm::model::budget::Spend, tinyinference_llm::model::budget::SpendLimits,
};
diff --git a/crates/openhuman-embed/src/lib.rs b/crates/openhuman-embed/src/lib.rs
index 26f28a187e..b6e0b36ca0 100644
--- a/crates/openhuman-embed/src/lib.rs
+++ b/crates/openhuman-embed/src/lib.rs
@@ -215,7 +215,7 @@ pub mod seams {
/// with the in-memory provider and the conformance suites a host's provider
/// is held to.
pub mod session_store {
- pub use openhuman_core::agent::session_store::{AgentStores, SessionStoreProvider};
+ pub use tinyagents_session::port::{AgentStores, SessionStoreProvider};
pub use tinyagents_session::port::{
AppendStore, InMemorySessionStores, InMemoryTranscriptLocator, InMemoryTurnStates, Store,
TurnStates,
diff --git a/crates/openhuman-embed/src/profiles.rs b/crates/openhuman-embed/src/profiles.rs
index 0332e1704b..1e1e3b0533 100644
--- a/crates/openhuman-embed/src/profiles.rs
+++ b/crates/openhuman-embed/src/profiles.rs
@@ -53,10 +53,10 @@
use std::path::Path;
use std::sync::Arc;
-use openhuman_core::agent::session_store::SessionStoreProvider;
use openhuman_core::core::runtime::CoreRuntime;
use openhuman_core::profiles::credentials::UserCredentialKind;
use openhuman_core::profiles::ProfileHost;
+use tinyagents_session::port::SessionStoreProvider;
use crate::error::CoreError;
diff --git a/crates/openhuman-embed/src/runtime/build.rs b/crates/openhuman-embed/src/runtime/build.rs
index 384d525df7..f8ab8c4351 100644
--- a/crates/openhuman-embed/src/runtime/build.rs
+++ b/crates/openhuman-embed/src/runtime/build.rs
@@ -3,10 +3,10 @@
use std::path::Path;
use std::sync::Arc;
-use openhuman_core::agent::session_store::SessionStoreProvider;
use openhuman_core::config::Config;
use openhuman_core::core::runtime::CoreBuilder;
use openhuman_core::core::types::HostKind;
+use tinyagents_session::port::SessionStoreProvider;
use super::builder::{requests_background_services, ConfigSource};
use super::presets::{default_domains, default_services};
diff --git a/crates/openhuman-embed/src/runtime/builder.rs b/crates/openhuman-embed/src/runtime/builder.rs
index b68ce6fed3..4335fdd9e3 100644
--- a/crates/openhuman-embed/src/runtime/builder.rs
+++ b/crates/openhuman-embed/src/runtime/builder.rs
@@ -14,12 +14,12 @@
use std::path::PathBuf;
use std::sync::Arc;
-use openhuman_core::agent::session_store::SessionStoreProvider;
use openhuman_core::backend::BackendTransport;
use openhuman_core::config::Config;
use openhuman_core::core::runtime::{DomainSet, ServiceSet, TokenSource};
use openhuman_core::core::types::HostKind;
use openhuman_core::tools::toolpacks::ToolGroups;
+use tinyagents_session::port::SessionStoreProvider;
use super::seams::HostSeams;
use super::ApiKey;
diff --git a/crates/openhuman-embed/src/runtime/mod.rs b/crates/openhuman-embed/src/runtime/mod.rs
index a42496c062..253444024a 100644
--- a/crates/openhuman-embed/src/runtime/mod.rs
+++ b/crates/openhuman-embed/src/runtime/mod.rs
@@ -194,9 +194,8 @@ pub(crate) struct CoreGuard {
workspace: ResolvedWorkspace,
/// The provider this runtime installed, if any. It is removed only while
/// it still owns the process slot.
- session_store: Option<Arc<dyn openhuman_core::agent::session_store::SessionStoreProvider>>,
- previous_session_store:
- Option<Arc<dyn openhuman_core::agent::session_store::SessionStoreProvider>>,
+ session_store: Option<Arc<dyn tinyagents_session::port::SessionStoreProvider>>,
+ previous_session_store: Option<Arc<dyn tinyagents_session::port::SessionStoreProvider>>,
/// The resolver through which the core's cron and workflow drivers find
/// this runtime's agents; removed with the runtime.
host_agents: Arc<dyn openhuman_core::agent::host_agents::HostAgentResolver>,
@@ -582,10 +581,8 @@ impl Runtime {
pub(crate) fn new(
core: Core,
workspace: ResolvedWorkspace,
- session_store: Option<Arc<dyn openhuman_core::agent::session_store::SessionStoreProvider>>,
- previous_session_store: Option<
- Arc<dyn openhuman_core::agent::session_store::SessionStoreProvider>,
- >,
+ session_store: Option<Arc<dyn tinyagents_session::port::SessionStoreProvider>>,
+ previous_session_store: Option<Arc<dyn tinyagents_session::port::SessionStoreProvider>>,
seams: Option<seams::InstalledSeams>,
base_config: Config,
config_unavailable: Option<String>,
diff --git a/crates/openhuman-embed/src/runtime/run.rs b/crates/openhuman-embed/src/runtime/run.rs
index 2b58f85959..95fa1c1955 100644
--- a/crates/openhuman-embed/src/runtime/run.rs
+++ b/crates/openhuman-embed/src/runtime/run.rs
@@ -20,9 +20,9 @@
use std::sync::Arc;
-use openhuman_core::agent::session_store::SessionStoreProvider;
use openhuman_core::backend::BackendTransport;
use openhuman_core::core::server_launcher::HostBoot;
+use tinyagents_session::port::SessionStoreProvider;
use super::seams::{HostSeams, StorageSource};
use super::{RuntimeBuilder, RuntimeError};