Skip to content

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

test(tools): update per-call tool tests for new context type

Steven Enamakeld632d4f88bf2
diff --git a/crates/openhuman-core/src/tools/per_call_tests.rs b/crates/openhuman-core/src/tools/per_call_tests.rs
index 01baa02dd3..06cc9afdf4 100644
--- a/crates/openhuman-core/src/tools/per_call_tests.rs
+++ b/crates/openhuman-core/src/tools/per_call_tests.rs
@@ -1,7 +1,10 @@
use super::*;
+use async_trait::async_trait;
use crate::agent::tinyagents::host::run_context::tool_context_with_approval;
use crate::security::approval::ApprovalTurnContext;
use serde_json::json;
+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};
+use serde_json::Value;
/// Reports the chat it was built for, so a test can see which call built it.
struct Probe {
@@ -47,7 +50,7 @@ fn chat(thread: &str) -> ApprovalChatContext {
}
}
-fn tool() -> PerCallTool<Probe> {
+fn tool() -> PerCallTool<Probe, PerCallContext> {
PerCallTool::new(super::context, |context| Probe {
built_for: context.chat,
})
@@ -115,7 +118,7 @@ fn static_metadata_comes_from_the_prototype() {
#[tokio::test]
async fn each_call_is_built_around_its_runs_dispatch_context() {
- use crate::core::runtime::{CoreContext, DispatchCtx, DomainSet};
+ use crate::core::runtime::{CoreContext, DomainSet};
use std::sync::{Arc, Mutex};
let seen: Arc<Mutex<Vec<Option<Arc<CoreContext>>>>> = Arc::default();