Skip to content

Commit 9582039

Browse files
committed
test(soul): pin that a seat runs no page tool, whatever its session id
A seat's session id is prefixed seat:, and the memory tools are never among a seat's tools: a read_memory_page call from a seat is skipped as not available. The test opens a seat with the id of a user who holds a page and checks the call is skipped and no page text reaches the model. Signed-off-by: jddunn <[email protected]>
1 parent e061ddb commit 9582039

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/api/__tests__/souledAgent.scoped-memory.gmi.e2e.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,22 +1681,25 @@ describe("a souled agent on runtime: 'gmi', beyond its own sessions", () => {
16811681
}
16821682
});
16831683

1684-
it("a seat session's page tool reads the operator's pages, never those of the user its session id names", async () => {
1684+
it("a seat whose session id is a user's id never reads that user's pages: a seat runs no page tool", async () => {
16851685
writePage('concepts/ops', OPS);
16861686
const { a, s } = await openedWith({ runtime: 'gmi' }, [...readsPage({ list: true }, 'c1'), ...readsPage({ id: 'concepts/notes' }, 'c2')]);
16871687
try {
16881688
await writeOwnPage(a, userKey('bob'), OWL_PAGE);
16891689
const seat = sessionSeat(a as never, { sessionId: 'bob' });
1690+
// The seat's own session id is prefixed, so it is never the user's.
1691+
expect(seat.seatId).toBe('seat:bob');
16901692

16911693
await seat.generate('What can I read?');
16921694
const listed = toolAnswerIn(lastCall(s));
1693-
expect(listed).toContain('concepts/ops');
1695+
expect(listed).toContain('not available in this seat');
16941696
expect(listed).not.toContain('concepts/notes');
16951697

16961698
await seat.generate('Open the notes.');
16971699
const answer = toolAnswerIn(lastCall(s));
1698-
expect(answer).toContain('No memory page found with id');
1700+
expect(answer).toContain('not available in this seat');
16991701
expect(answer).not.toContain(OWL_PAGE);
1702+
expect(lines('memory.page_read_refused')).toEqual([]);
17001703
} finally {
17011704
await a.close();
17021705
}

0 commit comments

Comments
 (0)