row 206 (#1704): thread-shares trail test threads the reply into A's default session, not the thread id (first-run red, mos-1272)

This commit is contained in:
jason.woltje committed 2026-10-22 14:19:00 -05:00
1 parent 1a228f395f
commit 9538e0fc86
1 file changed
+3 -1
+3 -1
View File
@@ -291,7 +291,9 @@ test('the owner\'s trail and replies show a user\'s message only while that user
'INSERT INTO messages(id,at,business,from_role,from_run,to_role,class,in_reply_to,decision,corrects,body) VALUES(?,?,?,?,?,?,?,?,?,?,?)',
reply, new Date().toISOString(), 'demo', 'assistant', 'assistant-run', 'user', 'INFO', sent, null, null, 'hello alice',
);
store.run('INSERT INTO message_threads(message,thread,session) VALUES(?,?,?)', reply, A, A);
// A new thread's default session has its own id (only a migrated thread's reuses the thread's).
const { session } = store.get('SELECT session FROM session_defaults WHERE thread=? ORDER BY seq DESC LIMIT 1', A);
store.run('INSERT INTO message_threads(message,thread,session) VALUES(?,?,?)', reply, A, session);
for (const who of ['human', 'reader']) {
assert.deepEqual(call(who, 'trail', { subject: sent }), [], who);
assert.equal(code(who, 'replies', { id: sent }), 'message-not-found', who);