fix(tests): add missing in_reply_to fields, correct session status type

- host-core.test.ts: add in_reply_to: null to routeAgentMessage calls
  (required after #2267 added the field to RoutableAgentMessage)
- agent-route.test.ts: use 'closed' instead of 'archived' (not a valid
  Session status)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-05-08 15:29:36 +03:00
parent 9629d1cc4a
commit 81cb13ec46
2 changed files with 8 additions and 8 deletions

View File

@@ -275,7 +275,7 @@ describe('routeAgentMessage return-path', () => {
expect(s2Rows).toHaveLength(0);
});
it('stale origin fallback: archived origin session falls through to newest active', async () => {
it('stale origin fallback: closed origin session falls through to newest active', async () => {
// A.S1 sends to B, establishing source_session_id = S1.id on B's inbound.
await routeAgentMessage(
{ id: 'msg-fwd', platform_id: B, content: JSON.stringify({ text: 'hello' }), in_reply_to: null },
@@ -284,10 +284,10 @@ describe('routeAgentMessage return-path', () => {
const bRows = readInbound(B, SB.id);
const inboundId = bRows[0].id;
// Archive S1 — simulates session cleanup or channel disconnect.
updateSession(S1.id, { status: 'archived' });
// Close S1 — simulates session cleanup or channel disconnect.
updateSession(S1.id, { status: 'closed' });
// B replies. origin points to S1 (archived), should fall through to S2.
// B replies. origin points to S1 (closed), should fall through to S2.
await routeAgentMessage(
{ id: 'msg-reply-stale', platform_id: A, content: JSON.stringify({ text: 'reply' }), in_reply_to: inboundId },
SB,