Skip to content

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

test(attachments): reorder document block and split fallback assertions

Steven Enamakelfcdcf4401b53
diff --git a/crates/openhuman-core/src/attachments/provider_history_tests.rs b/crates/openhuman-core/src/attachments/provider_history_tests.rs
index 1be0abd6cd..77cae871c9 100644
--- a/crates/openhuman-core/src/attachments/provider_history_tests.rs
+++ b/crates/openhuman-core/src/attachments/provider_history_tests.rs
@@ -41,16 +41,16 @@ async fn missing_historical_media_does_not_block_latest_valid_media() {
})
})
.collect::<Vec<_>>();
+ old_content.push(ContentBlock::Document(MediaRef::Url {
+ url: "ftp://docs.example.test/old.pdf?signature=document-private".into(),
+ media_type: Some("application/pdf".into()),
+ }));
old_content.extend((0..8).map(|index| {
ContentBlock::Image(ImageRef {
url: format!("deleted-prior-upload-{index}.png"),
mime_type: Some("image/png".into()),
})
}));
- old_content.push(ContentBlock::Document(MediaRef::Url {
- url: "ftp://docs.example.test/old.pdf?signature=document-private".into(),
- media_type: Some("application/pdf".into()),
- }));
let old_user = Message::User(tinyinference_llm::message::UserMessage {
content: old_content,
});
diff --git a/crates/openhuman-core/src/attachments/provider_routing_tests.rs b/crates/openhuman-core/src/attachments/provider_routing_tests.rs
index cd76d0beac..683419e9f7 100644
--- a/crates/openhuman-core/src/attachments/provider_routing_tests.rs
+++ b/crates/openhuman-core/src/attachments/provider_routing_tests.rs
@@ -351,9 +351,9 @@ async fn pdf_metadata_fallback_is_cacheable_without_the_documents_feature() {
let calls = transport.requests.lock().unwrap();
assert_eq!(calls.len(), 2);
- assert!(calls.iter().all(|(_, call)| call.messages[0]
- .text()
- .contains("[FILE-ATTACHED: name=\"brief.pdf\"")));
+ let fallback = calls[0].1.messages[0].text();
+ assert!(fallback.contains("[FILE-ATTACHED:"), "{fallback}");
+ assert!(fallback.contains("name=\"brief.pdf\""), "{fallback}");
assert!(path
.parent()
.unwrap()