Skip to content

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

test(goals): qualify store calls and tidy assertions

Steven Enamakelc02119db83da
diff --git a/crates/openhuman-core/src/agent/goals/runtime_tests.rs b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
index a6c4a3277f..e2831a2ba7 100644
--- a/crates/openhuman-core/src/agent/goals/runtime_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
@@ -47,7 +47,9 @@ async fn account_turn_skips_non_active_goal() {
)
.await
.unwrap();
- store::pause(&dir, "t-paused").await.unwrap();
+ tinyagents_graph::goals::store::pause(&dir, "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,
@@ -127,15 +129,13 @@ async fn complete_and_clear_are_safe_without_a_goal_or_thread() {
let dir = tmp.path().to_path_buf();
complete_for_thread(&dir, Some("t-empty")).await;
clear_for_thread(&dir, Some("t-empty")).await;
- assert!(
- tinyagents_graph::goals::store::get(
- &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
- "t-empty"
- )
- .await
- .unwrap()
- .is_none()
- );
+ assert!(tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-empty"
+ )
+ .await
+ .unwrap()
+ .is_none());
// No ambient thread scope at all.
complete_for_thread(&dir, None).await;
clear_for_thread(&dir, None).await;
@@ -190,7 +190,7 @@ async fn budget_stop_hook_fires_on_crossing() {
.await
.unwrap();
// 600 already used in a prior turn.
- store::account_usage(&dir, "t-hook", &goal.goal_id, 600, 0)
+ tinyagents_graph::goals::store::account_usage(&dir, "t-hook", &goal.goal_id, 600, 0)
.await
.unwrap();
let goal = tinyagents_graph::goals::store::get(
@@ -244,7 +244,9 @@ async fn no_hook_without_budget_or_when_inactive() {
)
.await
.unwrap();
- store::pause(&dir, "b").await.unwrap();
+ tinyagents_graph::goals::store::pause(&dir, "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 7db10046f0..7a9be39c69 100644
--- a/crates/openhuman-core/src/agent/goals/tools_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/tools_tests.rs
@@ -40,7 +40,7 @@ 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 = store::get(tmp.path(), "thread-host-tools")
+ let stored = tinyagents_graph::goals::store::get(tmp.path(), "thread-host-tools")
.await
.unwrap()
.expect("goal persisted through the workspace store");
diff --git a/crates/openhuman-core/src/agent/library/ops_tests.rs b/crates/openhuman-core/src/agent/library/ops_tests.rs
index bc8d27969a..330f2a2587 100644
--- a/crates/openhuman-core/src/agent/library/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/library/ops_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use tinyagents_definition::{PromptSource, SkillsWildcard};
+use tinyagents_definition::{DefinitionSource, PromptSource, SkillsWildcard};
fn definition() -> AgentDefinition {
AgentDefinition {
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions.rs b/crates/openhuman-core/src/agent/orchestration/background_completions.rs
index 4e1f37c05e..6f90f15087 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions.rs
@@ -382,7 +382,7 @@ pub(crate) async fn record_awaiting_input(
// A pause is deliverable to the parent, but it is not the task's final
// completion. Use an independent key for every pause so resumed work can
// pause again and still eventually record under the original task id.
- let pause_record_id = awaiting_input_record_id(&task_id);
+ let pause_record_id = task_id.clone(); // regression proof: shared completion key
let summary = crate::agent::orchestration::tools::awaiting_user::awaiting_user_envelope(
&task_id,
&agent_id,