Skip to content

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

test(e2e-web-ports): add test for core without binding evidence

Steven Enamakel57540b94ed9b
diff --git a/scripts/__tests__/e2e-web-ports.test.mjs b/scripts/__tests__/e2e-web-ports.test.mjs
index 7593a7c084..bec862184d 100644
--- a/scripts/__tests__/e2e-web-ports.test.mjs
+++ b/scripts/__tests__/e2e-web-ports.test.mjs
@@ -103,7 +103,7 @@ function stubCore(tree, boundPort) {
writeExecutable(
bin,
`#!/usr/bin/env bash
-echo "[core] OpenHuman core is ready \u2014 listening on http://127.0.0.1:${boundPort} (version test)"
+${boundPort == null ? "" : `echo "[core] OpenHuman core is ready \u2014 listening on http://127.0.0.1:${boundPort} (version test)"`}
sleep 30
`,
);
@@ -506,6 +506,24 @@ test("a core on the requested port runs the specs", async () => {
}
});
+test("a core without binding evidence fails the session", async () => {
+ const tree = makeTree();
+ try {
+ const base = await freeBase();
+ markBundle(tree, { mockPort: base, corePort: base + 1 });
+ stubCore(tree, null);
+
+ const res = run(tree, "e2e-web-session.sh", { E2E_PORT_BASE: String(base) });
+
+ assert.equal(res.status, 1, res.output);
+ assert.match(res.output, /could not read the core's bound address/);
+ assert.match(res.output, /Refusing to continue without binding evidence/);
+ assert.doesNotMatch(res.output, /Core RPC authentication failed/);
+ } finally {
+ tree.cleanup();
+ }
+});
+
test("the recorded build ports come from the pre-dotenv selection", async () => {
// `.env` configures normal development and must not change what the bundle
// was built for, so the ports recorded next to it are the ones resolved