Skip to content

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

test(tokenjuice): add test for request with custom model

Steven Enamakelf98134b80b87
diff --git a/crates/openhuman-core/src/inference/tokenjuice/savings_tests.rs b/crates/openhuman-core/src/inference/tokenjuice/savings_tests.rs
index e5cd1a8f0e..6280d22416 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/savings_tests.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/savings_tests.rs
@@ -19,8 +19,15 @@ fn no_request_when_not_smaller() {
#[test]
fn request_carries_attribution_and_token_counts() {
- let req = request(CompressorKind::SmartCrusher, 2000, 1000).unwrap();
- assert_eq!(req.model, attribution_model());
+ assert!(request(CompressorKind::SmartCrusher, 2000, 1000).is_none());
+ let req = request_for(
+ "test-model".to_string(),
+ CompressorKind::SmartCrusher,
+ 2000,
+ 1000,
+ )
+ .unwrap();
+ assert_eq!(req.model, "test-model");
assert_eq!(req.compressor, CompressorKind::SmartCrusher.as_str());
assert_eq!((req.original_tokens, req.compacted_tokens), (2000, 1000));
}