fix(web-probe): validate stdio session lineage

This commit is contained in:
Codex
2026-07-10 13:12:58 +02:00
parent b45b339855
commit 8c585e3c2f
2 changed files with 27 additions and 1 deletions
@@ -69,3 +69,17 @@ test("realtime fanout retries a YAML-bounded transient health navigation", async
assert.equal(calls, 2);
assert.equal((result.attempts as unknown[]).length, 2);
});
test("realtime fanout validates stdio against the scoped AgentRun session lineage", () => {
const source = nodeWebObserveRunnerRealtimeSource();
const build = new Function(`${source}\nreturn realtimeExpectedStreamSessionId;`) as () => (
stream: string,
hwlabSessionId: string,
) => string;
const expectedStreamSessionId = build();
const hwlabSessionId = "ses_5ec4e141-6abc-466d-9afe-049f7c0ac105";
assert.equal(expectedStreamSessionId("stdio", hwlabSessionId), "ses_agentrun_5ec4e141_6abc_466d_9afe_049f7c0ac105");
assert.equal(expectedStreamSessionId("agentrun", hwlabSessionId), hwlabSessionId);
assert.equal(expectedStreamSessionId("hwlab", hwlabSessionId), hwlabSessionId);
});