Skip to content

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

test(e2e): add text block checking utilities

Steven Enamakelc39bad2a091e
diff --git a/tests/native_channel_session_restart_e2e.rs b/tests/native_channel_session_restart_e2e.rs
index 49e4f1a0d3..f10904d86e 100644
--- a/tests/native_channel_session_restart_e2e.rs
+++ b/tests/native_channel_session_restart_e2e.rs
@@ -840,6 +840,7 @@ fn content_block_types(value: &Value) -> Vec<String> {
fn content_has_text_block(value: &Value, expected: &str) -> bool {
match value {
+ Value::String(text) => text.contains(expected),
Value::Array(items) => items
.iter()
.any(|item| content_has_text_block(item, expected)),
@@ -859,6 +860,7 @@ fn content_has_text_block(value: &Value, expected: &str) -> bool {
fn collect_text_blocks(value: &Value) -> Vec<&str> {
match value {
+ Value::String(text) => vec![text],
Value::Array(items) => items.iter().flat_map(collect_text_blocks).collect(),
Value::Object(fields) => {
let mut text = Vec::new();