Skip to content

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

test(goals): pass workspace kv store to goal store helpers

Steven Enamakele974a9f33810
diff --git a/crates/openhuman-core/src/agent/goals/runtime_tests.rs b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
index e2831a2ba7..0e47fe9390 100644
--- a/crates/openhuman-core/src/agent/goals/runtime_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
@@ -47,9 +47,12 @@ async fn account_turn_skips_non_active_goal() {
)
.await
.unwrap();
- tinyagents_graph::goals::store::pause(&dir, "t-paused")
- .await
- .unwrap();
+ tinyagents_graph::goals::store::pause(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-paused",
+ )
+ .await
+ .unwrap();
account_turn_against_goal(&dir, Some("t-paused"), 500, 500, 1).await;
let g = tinyagents_graph::goals::store::get(
&crate::agent::session_store::stores_or_ephemeral(&dir).kv,
@@ -190,9 +193,15 @@ async fn budget_stop_hook_fires_on_crossing() {
.await
.unwrap();
// 600 already used in a prior turn.
- tinyagents_graph::goals::store::account_usage(&dir, "t-hook", &goal.goal_id, 600, 0)
- .await
- .unwrap();
+ tinyagents_graph::goals::store::account_usage(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-hook",
+ &goal.goal_id,
+ 600,
+ 0,
+ )
+ .await
+ .unwrap();
let goal = tinyagents_graph::goals::store::get(
&crate::agent::session_store::stores_or_ephemeral(&dir).kv,
"t-hook",
@@ -244,9 +253,12 @@ async fn no_hook_without_budget_or_when_inactive() {
)
.await
.unwrap();
- tinyagents_graph::goals::store::pause(&dir, "b")
- .await
- .unwrap();
+ tinyagents_graph::goals::store::pause(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "b",
+ )
+ .await
+ .unwrap();
let paused = tinyagents_graph::goals::store::get(
&crate::agent::session_store::stores_or_ephemeral(&dir).kv,
"b",
diff --git a/crates/openhuman-core/src/agent/goals/tools_tests.rs b/crates/openhuman-core/src/agent/goals/tools_tests.rs
index 7a9be39c69..a2714878b4 100644
--- a/crates/openhuman-core/src/agent/goals/tools_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/tools_tests.rs
@@ -40,9 +40,12 @@ async fn set_persists_to_the_workspace_store_and_answers_goal_and_text() {
assert_eq!(payload["goal"]["tokenBudget"], 5000);
assert!(payload["text"].as_str().unwrap().starts_with("Goal set."));
- let stored = tinyagents_graph::goals::store::get(tmp.path(), "thread-host-tools")
- .await
- .unwrap()
- .expect("goal persisted through the workspace store");
+ let stored = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(tmp.path()).kv,
+ "thread-host-tools",
+ )
+ .await
+ .unwrap()
+ .expect("goal persisted through the workspace store");
assert_eq!(stored.objective, "land the PR");
}
diff --git a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
index d96b076445..0b7e9c8a92 100644
--- a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
@@ -199,7 +199,7 @@ async fn flows_build_hides_the_live_run_tool_from_the_builder_belt() {
"duplicate_flow",
] {
assert!(
- visible.contains(keep),
+ visible.iter().any(|spec| spec.name == keep),
"authoring tool `{keep}` must remain visible after restriction; visible = {visible:?}"
);
}
@@ -289,7 +289,7 @@ async fn flows_build_copilot_toolset_unhides_the_live_run_tools() {
"duplicate_flow",
] {
assert!(
- visible.contains(keep),
+ visible.iter().any(|spec| spec.name == keep),
"authoring tool `{keep}` must remain visible on the copilot path; visible = \
{visible:?}"
);