Skip to content

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

test(core): adapt migration test seams

Steven Enamakelffd8c1009589
diff --git a/crates/openhuman-core/src/agent/harness/parse_wire_tests.rs b/crates/openhuman-core/src/agent/harness/parse_wire_tests.rs
index d2f40a87ed..1b077f0d78 100644
--- a/crates/openhuman-core/src/agent/harness/parse_wire_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/parse_wire_tests.rs
@@ -30,7 +30,7 @@ use crate::inference::provider::ToolCall;
#[cfg(test)]
use tinytools::Tool;
#[cfg(test)]
-use tinytools_agent::ParsedToolCall;
+use tinytools_agent::{CallSource, ParsedToolCall};
#[cfg(test)]
pub(crate) fn parse_structured_tool_calls(tool_calls: &[ToolCall]) -> Vec<ParsedToolCall> {
@@ -41,6 +41,7 @@ pub(crate) fn parse_structured_tool_calls(tool_calls: &[ToolCall]) -> Vec<Parsed
arguments: serde_json::from_str::<serde_json::Value>(&call.arguments)
.unwrap_or_else(|_| serde_json::Value::Object(serde_json::Map::new())),
id: Some(call.id.clone()),
+ source: CallSource::Native,
})
.collect()
}
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs
index f3c2d42f63..f7b3e94b2d 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs
@@ -7,13 +7,9 @@ fn visible_names(agent_id: &str) -> std::collections::HashSet<String> {
.get(agent_id)
.cloned()
.unwrap_or_else(|| panic!("built-in agent definition not found: {agent_id}"));
- let agent = crate::agent::OpenHumanSessionHost::from_config_with_definition(
- &config,
- &definition,
- None,
- None,
- )
- .unwrap_or_else(|e| panic!("{agent_id} session build: {e}"));
+ let agent =
+ crate::agent::OpenHumanSessionHost::from_config_with_definition(&config, &definition)
+ .unwrap_or_else(|e| panic!("{agent_id} session build: {e}"));
agent
.visible_tool_specs_arc()
.iter()
@@ -29,13 +25,9 @@ fn resetting_wildcard_visibility_keeps_collapsed_exposure() {
.get("tools_agent")
.cloned()
.expect("tools_agent built-in definition");
- let mut agent = crate::agent::OpenHumanSessionHost::from_config_with_definition(
- &config,
- &definition,
- None,
- None,
- )
- .expect("build tools agent");
+ let mut agent =
+ crate::agent::OpenHumanSessionHost::from_config_with_definition(&config, &definition)
+ .expect("build tools agent");
agent.set_visible_tool_names(std::collections::HashSet::new());
@@ -54,13 +46,9 @@ fn hiding_and_reseeding_wildcard_visibility_keeps_collapsed_exposure() {
.get("tools_agent")
.cloned()
.expect("tools_agent built-in definition");
- let mut agent = crate::agent::OpenHumanSessionHost::from_config_with_definition(
- &config,
- &definition,
- None,
- None,
- )
- .expect("build tools agent");
+ let mut agent =
+ crate::agent::OpenHumanSessionHost::from_config_with_definition(&config, &definition)
+ .expect("build tools agent");
agent.set_visible_tool_names(std::collections::HashSet::new());
agent.hide_tools(&[crate::memory::tools::MEMORY_TOOL_NAME]);
diff --git a/crates/openhuman-core/src/agent/session_host/driver.rs b/crates/openhuman-core/src/agent/session_host/driver.rs
index 2882b2462f..5b784c5f60 100644
--- a/crates/openhuman-core/src/agent/session_host/driver.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver.rs
@@ -519,6 +519,7 @@ mod tests {
"chat-concrete",
"chat-v1",
)),
+ pricing_model: None,
model_calls: 2,
tool_outcomes: vec![crate::agent::tinyagents::ToolCallOutcome {
call_id: "call-1".into(),
diff --git a/crates/openhuman-core/src/core/all_tests.rs b/crates/openhuman-core/src/core/all_tests.rs
index 5baa1508bb..7bdebfa682 100644
--- a/crates/openhuman-core/src/core/all_tests.rs
+++ b/crates/openhuman-core/src/core/all_tests.rs
@@ -734,10 +734,19 @@ async fn try_invoke_registered_rpc_returns_some_for_known_method() {
#[tokio::test]
async fn try_invoke_registered_rpc_routes_security_policy_info() {
- let out = try_invoke_registered_rpc("openhuman.security_policy_info", Map::new())
- .await
- .expect("security policy info should be registered")
- .expect("security policy info should succeed");
+ let workspace = tempfile::TempDir::new().expect("security policy workspace");
+ let mut config = crate::config::Config::default();
+ config.workspace_dir = workspace.path().to_path_buf();
+ config.action_dir = workspace.path().to_path_buf();
+ config.config_path = workspace.path().join("config.toml");
+ let ctx = CoreContext::for_test_with_config(DomainSet::full(), config);
+ let out = CoreContext::scope(
+ ctx,
+ try_invoke_registered_rpc("openhuman.security_policy_info", Map::new()),
+ )
+ .await
+ .expect("security policy info should be registered")
+ .expect("security policy info should succeed");
assert!(
out.get("result").is_some() || out.get("autonomy").is_some(),
@@ -817,7 +826,7 @@ fn full_registration_is_byte_identical() {
.iter()
.map(|c| c.rpc_method_name())
.collect();
- let raw_methods: Vec<String> = registry()
+ let raw_methods: Vec<String> = registry_view()
.iter()
.map(|g| g.controller.rpc_method_name())
.collect();
@@ -1894,7 +1903,7 @@ fn unbound_registration_is_byte_identical() {
.iter()
.map(|c| c.rpc_method_name())
.collect();
- let raw: Vec<String> = registry()
+ let raw: Vec<String> = registry_view()
.iter()
.map(|g| g.controller.rpc_method_name())
.collect();
diff --git a/crates/openhuman-core/src/web_chat/web_tests.rs b/crates/openhuman-core/src/web_chat/web_tests.rs
index bfaa7cacc8..e6aa964cde 100644
--- a/crates/openhuman-core/src/web_chat/web_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests.rs
@@ -1,8 +1,8 @@
use super::{
all_web_channel_controller_schemas, all_web_channel_registered_controllers, cancel_chat,
channel_web_cancel, channel_web_queue_clear, channel_web_queue_status,
- classify_inference_error, compose_system_prompt_suffix, drain_queued_turns_for_test,
- event_session_id_for, extract_provider_error_detail, generic_inference_error_user_message,
+ classify_inference_error, drain_queued_turns_for_test, event_session_id_for,
+ extract_provider_error_detail, generic_inference_error_user_message,
in_flight_entries_for_test, inference_budget_exceeded_user_message,
is_inference_budget_exceeded_error, json_output, key_for, locale_reply_directive,
normalize_model_override, optional_f64, optional_string, parallel_in_flight_entries_for_test,