Skip to content

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

fix(test): update test struct literals for new required fields

Steven Enamakele847fb38b53a
diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection_tests.rs
index 3cf0c65c71..fccf3814ea 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/journal_projection_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/journal_projection_tests.rs
@@ -28,6 +28,7 @@ fn tool_completed(call: &str, name: &str, error: Option<&str>) -> AgentEvent {
duration_ms: Some(30),
output_bytes: Some(12),
error: error.map(str::to_string),
+ metadata: None,
}
}
diff --git a/crates/openhuman-core/src/agent/progress_tracing/langfuse_batch_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/langfuse_batch_tests.rs
index ac0707cc08..28746165ed 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/langfuse_batch_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/langfuse_batch_tests.rs
@@ -283,6 +283,7 @@ fn journal_observation_content_follows_capture_gate() {
duration_ms: Some(20),
output_bytes: Some(13),
error: None,
+ metadata: None,
},
),
];
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
index 001000c176..9e3f8eeb47 100644
--- a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
@@ -25,6 +25,7 @@ async fn bridge_forwards_tool_and_cost_progress() {
duration_ms: None,
output_bytes: None,
error: None,
+ metadata: None,
});
sink.emit(AgentEvent::UsageRecorded {
usage: Usage::new(100, 40),
@@ -183,6 +184,7 @@ async fn tool_completed_projects_output_arguments_and_elapsed() {
duration_ms: None,
output_bytes: None,
error: None,
+ metadata: None,
});
let mut seen = None;
diff --git a/crates/openhuman-core/src/agent/tinyagents/tools_canonical_tests.rs b/crates/openhuman-core/src/agent/tinyagents/tools_canonical_tests.rs
index c376483d44..1df95ded80 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tools_canonical_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tools_canonical_tests.rs
@@ -52,6 +52,7 @@ impl Tool for RecordingTool {
],
is_error: args["fail"].as_bool().unwrap_or(false),
markdown_formatted: Some("markdown content".to_string()),
+ ..ToolResult::default()
})
}
}
@@ -102,6 +103,7 @@ async fn canonical_adapter_preserves_spec_policy_context_and_result() {
],
is_error: args["fail"].as_bool().unwrap_or(false),
markdown_formatted: Some("markdown content".into()),
+ ..ToolResult::default()
})
}
}
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_schema_and_structured_output_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_schema_and_structured_output_tests.rs
index 9cfd68235c..03c23d0ef5 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_schema_and_structured_output_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_schema_and_structured_output_tests.rs
@@ -186,6 +186,7 @@ fn crate_model_response_preserves_flow_completion_contract() {
invalid: None,
}],
usage: Some(usage),
+ origin: None,
},
usage: Some(usage),
finish_reason: Some("tool_calls".to_string()),
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs
index 9d46433130..73e2f23807 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tool_results_and_credentials_tests.rs
@@ -39,6 +39,7 @@ fn native_tool_payload_collapses_mixed_blocks_to_text() {
],
is_error: false,
markdown_formatted: None,
+ ..ToolResult::default()
};
let payload = native_tool_payload(&result);
let text = payload["text"].as_str().expect("text field");
diff --git a/crates/openhuman-core/src/flows/tinyflows/checkpoint_compat_tests_tests.rs b/crates/openhuman-core/src/flows/tinyflows/checkpoint_compat_tests_tests.rs
index 1fa4fcb300..78cf435be6 100644
--- a/crates/openhuman-core/src/flows/tinyflows/checkpoint_compat_tests_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/checkpoint_compat_tests_tests.rs
@@ -37,21 +37,17 @@ async fn reads_a_database_written_by_the_previous_backend() {
use tinyagents_graph::Checkpointer as LegacyCheckpointer;
let old = tinyagents_graph::SqliteCheckpointer::<serde_json::Value>::open(&db).unwrap();
- let written = tinyagents_graph::Checkpoint {
- thread_id: "flow:f1:run-a".to_string(),
- checkpoint_id: "cp-1".to_string(),
- run_id: Some("run-1".to_string()),
- parent_checkpoint_id: None,
- namespace: Vec::new(),
- state: json!({ "counter": 7 }),
- next_nodes: vec![tinyagents_harness::ids::NodeId::new("next")],
- completed_tasks: vec![tinyagents_harness::ids::NodeId::new("done")],
- pending_writes: Vec::new(),
- interrupts: Vec::new(),
- pending_activations: None,
- barrier_arrivals: Vec::new(),
- metadata: json!({ "source": "loop", "step": 3 }),
- };
+ // Built through the constructor rather than a struct literal: the
+ // upstream record keeps growing bookkeeping fields (channel versions,
+ // barrier arrivals, ...) and this test only cares about the columns the
+ // ported reader must still decode.
+ let mut written = tinyagents_graph::Checkpoint::new(json!({ "counter": 7 }), Vec::new())
+ .with_thread_id("flow:f1:run-a")
+ .with_checkpoint_id("cp-1");
+ written.run_id = Some("run-1".to_string());
+ written.next_nodes = vec![tinyagents_harness::ids::NodeId::new("next")];
+ written.completed_tasks = vec![tinyagents_harness::ids::NodeId::new("done")];
+ written.metadata = json!({ "source": "loop", "step": 3 });
LegacyCheckpointer::put(&old, written).await.unwrap();
drop(old);
diff --git a/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs b/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs
index 22917da088..22d90c87fc 100644
--- a/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs
@@ -156,6 +156,7 @@ fn is_provider_not_configured_error_matches_exact_backend_shape() {
retryable: false,
retry_after_ms: None,
raw: None,
+ ..ProviderError::default()
};
assert!(is_provider_not_configured_error(&err));
}
@@ -174,6 +175,7 @@ fn is_provider_not_configured_error_rejects_other_400s() {
retryable: false,
retry_after_ms: None,
raw: None,
+ ..ProviderError::default()
};
assert!(!is_provider_not_configured_error(&err));
}
@@ -193,6 +195,7 @@ fn is_provider_not_configured_error_tolerates_not_configured_for_provider_wordin
retryable: false,
retry_after_ms: None,
raw: None,
+ ..ProviderError::default()
};
assert!(is_provider_not_configured_error(&err));
}
@@ -215,6 +218,7 @@ fn is_provider_not_configured_error_rejects_generic_not_configured_400() {
retryable: false,
retry_after_ms: None,
raw: None,
+ ..ProviderError::default()
};
assert!(!is_provider_not_configured_error(&err));
}
@@ -230,6 +234,7 @@ fn is_provider_not_configured_error_rejects_non_400_status() {
retryable: false,
retry_after_ms: None,
raw: None,
+ ..ProviderError::default()
};
assert!(!is_provider_not_configured_error(&err));
}
diff --git a/crates/openhuman-core/src/tools/impl/filesystem/git_operations_tests.rs b/crates/openhuman-core/src/tools/impl/filesystem/git_operations_tests.rs
index fdceec4138..8c30c8138e 100644
--- a/crates/openhuman-core/src/tools/impl/filesystem/git_operations_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/filesystem/git_operations_tests.rs
@@ -103,7 +103,7 @@ fn git_resolves_cwd_from_workspace_descriptor() {
let ws =
WorkspaceDescriptor::new(worktree_tmp.path().to_path_buf()).with_policy_id("test-worktree");
let ctx: RunContext = RunContext::new(RunConfig::new("test-run"), ()).with_workspace(ws);
- let tool_ctx = ToolExecutionContext::from_run_context(&ctx);
+ let tool_ctx = ToolExecutionContext::from_run_context(&ctx, tinyagents_harness::ids::CallId::new("test-call"));
assert_eq!(
tool.effective_action_dir_for_context(Some(&tool_ctx)),
worktree_tmp.path().to_path_buf(),
diff --git a/crates/openhuman-core/src/tools/impl/filesystem/mod_tests.rs b/crates/openhuman-core/src/tools/impl/filesystem/mod_tests.rs
index 77822e16be..14f872419c 100644
--- a/crates/openhuman-core/src/tools/impl/filesystem/mod_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/filesystem/mod_tests.rs
@@ -17,7 +17,7 @@ use tinytools::WorkspaceDescriptor;
fn tool_context_with_workspace(root: &Path) -> ToolExecutionContext {
let ws = WorkspaceDescriptor::new(root.to_path_buf()).with_policy_id("test-descriptor");
let ctx: RunContext = RunContext::new(RunConfig::new("test-run"), ()).with_workspace(ws);
- ToolExecutionContext::from_run_context(&ctx)
+ ToolExecutionContext::from_run_context(&ctx, tinyagents_harness::ids::CallId::new("test-call"))
}
/// A policy whose `workspace_dir`/`action_dir` are the OpenHuman home — i.e. a
diff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests.rs
index 5cc4544c5c..1b8f0e80d5 100644
--- a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests.rs
@@ -46,7 +46,7 @@ fn tool_context_with_workspace(
use tinytools::WorkspaceDescriptor;
let ws = WorkspaceDescriptor::new(root.to_path_buf()).with_policy_id("test-worktree");
let ctx: RunContext = RunContext::new(RunConfig::new("test-run"), ()).with_workspace(ws);
- ToolExecutionContext::from_run_context(&ctx)
+ ToolExecutionContext::from_run_context(&ctx, tinyagents_harness::ids::CallId::new("test-call"))
}
fn test_security_with_env_cmd() -> Arc<SecurityPolicy> {