Skip to content

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

test(e2e): add base64 check for native file content

Steven Enamakel06495bf95880
diff --git a/tests/native_channel_session_restart_e2e.rs b/tests/native_channel_session_restart_e2e.rs
index d824f93be1..a9fa5d118e 100644
--- a/tests/native_channel_session_restart_e2e.rs
+++ b/tests/native_channel_session_restart_e2e.rs
@@ -604,6 +604,12 @@ fn assert_model_received_file_content(request: &Value) {
{
let encoded = serde_json::to_string(document).expect("serialize typed document");
assert!(encoded.contains("text/plain"), "typed file MIME: {encoded}");
+ let base64 = base64::engine::general_purpose::STANDARD.encode(NATIVE_FILE_BYTES);
+ assert!(
+ encoded.contains(&base64)
+ || encoded.contains(std::str::from_utf8(NATIVE_FILE_BYTES).unwrap()),
+ "typed document carries the downloaded file bytes: {encoded}"
+ );
} else {
assert!(
content_has_text_block(content, std::str::from_utf8(NATIVE_FILE_BYTES).unwrap()),