Skip to content

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

test(agent): set finish_reason on ChatResponse test fixtures

M3gA-Mind23af4a1e6393
diff --git a/crates/openhuman-core/src/agent/agent_tests.rs b/crates/openhuman-core/src/agent/agent_tests.rs
index e08add4efe..e4e53912bd 100644
--- a/crates/openhuman-core/src/agent/agent_tests.rs
+++ b/crates/openhuman-core/src/agent/agent_tests.rs
@@ -85,6 +85,7 @@ impl ChatModel<()> for ScriptedProvider {
tool_calls: vec![],
usage: None,
reasoning_content: None,
+ finish_reason: None,
}
} else {
guard.remove(0)
@@ -269,6 +270,7 @@ fn tool_response(calls: Vec<NativeToolCall>) -> ChatResponse {
tool_calls: calls,
usage: None,
reasoning_content: None,
+ finish_reason: None,
}
}
@@ -279,6 +281,7 @@ fn text_response(text: &str) -> ChatResponse {
tool_calls: vec![],
usage: None,
reasoning_content: None,
+ finish_reason: None,
}
}
@@ -291,6 +294,7 @@ fn xml_tool_response(name: &str, args: &str) -> ChatResponse {
tool_calls: vec![],
usage: None,
reasoning_content: None,
+ finish_reason: None,
}
}
diff --git a/crates/openhuman-core/src/agent/agent_turn_loop_tests.rs b/crates/openhuman-core/src/agent/agent_turn_loop_tests.rs
index 7c5ab5d067..ab3ca0bd37 100644
--- a/crates/openhuman-core/src/agent/agent_turn_loop_tests.rs
+++ b/crates/openhuman-core/src/agent/agent_turn_loop_tests.rs
@@ -339,6 +339,7 @@ async fn turn_errors_on_empty_or_null_text_response() {
tool_calls: vec![],
usage: None,
reasoning_content: None,
+ finish_reason: None,
};
let provider = Arc::new(ScriptedProvider::new(vec![empty(), empty()]));
let script = Arc::clone(&provider);
@@ -378,6 +379,7 @@ async fn turn_preserves_text_alongside_tool_calls() {
}],
usage: None,
reasoning_content: None,
+ finish_reason: None,
},
text_response("Here are the results"),
]));
@@ -468,6 +470,7 @@ async fn e2e_native_loop_executes_text_fallback_tool_calls_and_persists_history(
tool_calls: vec![],
usage: None,
reasoning_content: None,
+ finish_reason: None,
},
text_response("Completed via tool"),
]));