Skip to content

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

test(storage-bypass): cover tokio file writer in embed crate

Steven Enamakelb3f5d0e43574
diff --git a/scripts/__tests__/storage-bypass.test.mjs b/scripts/__tests__/storage-bypass.test.mjs
index 012459981d..54c4b6f035 100644
--- a/scripts/__tests__/storage-bypass.test.mjs
+++ b/scripts/__tests__/storage-bypass.test.mjs
@@ -142,6 +142,19 @@ test("a new database open fails the check", () => {
);
});
+test("an embed Tokio file writer cannot bypass the host storage scan", () => {
+ const { status, out } = run(
+ {
+ "crates/openhuman-embed/src/preferences.rs":
+ "async fn save() { tokio::fs::write(path, bytes).await; }\n",
+ },
+ [],
+ );
+ assert.equal(status, 1);
+ assert.match(out, /New storage-bypass sites/);
+ assert.match(out, /json-write: crates\/openhuman-embed\/src\/preferences\.rs:1/);
+});
+
test("the storage module, tests and allowlisted fallbacks are not flagged", () => {
const { status } = run(
{