Skip to content

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

test(web_chat): improve fixture setup for no reasoning

Steven Enamakel0ae5098b47ee
diff --git a/crates/openhuman-core/src/web_chat/suggestions_tests.rs b/crates/openhuman-core/src/web_chat/suggestions_tests.rs
index a7b4c5d900..acec4ca521 100644
--- a/crates/openhuman-core/src/web_chat/suggestions_tests.rs
+++ b/crates/openhuman-core/src/web_chat/suggestions_tests.rs
@@ -116,10 +116,15 @@ fn install_suggestions_model_fixture() {
context_window: Arc::new(|_| None),
default_pricing: Arc::new(|| None),
without_reasoning: Arc::new(|mut request| {
- request.metadata.insert(
- "fixture.no_reasoning".to_string(),
- serde_json::Value::Bool(true),
- );
+ if !request.metadata.is_object() {
+ request.metadata = serde_json::Value::Object(serde_json::Map::new());
+ }
+ if let Some(metadata) = request.metadata.as_object_mut() {
+ metadata.insert(
+ "fixture.no_reasoning".to_string(),
+ serde_json::Value::Bool(true),
+ );
+ }
request
}),
}),