Skip to content

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

test(import): cover malformed legacy json rejection

Steven Enamakela8bc6aac8103
diff --git a/crates/openhuman-core/src/storage/import/session_db_tests.rs b/crates/openhuman-core/src/storage/import/session_db_tests.rs
index e43bc11d48..faf7b5c049 100644
--- a/crates/openhuman-core/src/storage/import/session_db_tests.rs
+++ b/crates/openhuman-core/src/storage/import/session_db_tests.rs
@@ -128,3 +128,12 @@ fn rejects_a_database_without_classic_session_tables() {
.to_string()
.contains("none of the classic session database tables"));
}
+
+#[test]
+fn rejects_malformed_legacy_json_instead_of_silently_dropping_session_state() {
+ for decode in [Decode::JsonOrEmpty, Decode::OptionalJson, Decode::JsonArray] {
+ let error = decode_value(Value::String("{".to_owned()), decode)
+ .expect_err("malformed persisted JSON must not be treated as empty state");
+ assert!(error.to_string().contains("legacy JSON"));
+ }
+}
diff --git a/vendor/tinyagents b/vendor/tinyagents
index 0c42a7464e..c43dd28a72 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit 0c42a7464e62ef7159e02435abb77c88f7468129
+Subproject commit c43dd28a72e28aae858adf32d5ad4917bf0c5f77