From 81cb13ec469fc2df7bc483277e67af5b8977d61c Mon Sep 17 00:00:00 2001 From: gavrielc Date: Fri, 8 May 2026 15:29:36 +0300 Subject: [PATCH] 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) --- src/host-core.test.ts | 8 ++++---- src/modules/agent-to-agent/agent-route.test.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/host-core.test.ts b/src/host-core.test.ts index 51bd724..1225b76 100644 --- a/src/host-core.test.ts +++ b/src/host-core.test.ts @@ -885,7 +885,7 @@ describe('agent-to-agent routing', () => { const { session: paSlackSession } = resolveSession('ag-pa', 'mg-slack', null, 'shared'); await routeAgentMessage( - { id: 'out-a2a-1', platform_id: 'ag-researcher', content: JSON.stringify({ text: 'research this' }) }, + { id: 'out-a2a-1', platform_id: 'ag-researcher', content: JSON.stringify({ text: 'research this' }), in_reply_to: null }, paSlackSession, ); @@ -928,7 +928,7 @@ describe('agent-to-agent routing', () => { // PA sends from Slack await routeAgentMessage( - { id: 'out-fwd', platform_id: 'ag-researcher', content: JSON.stringify({ text: 'research' }) }, + { id: 'out-fwd', platform_id: 'ag-researcher', content: JSON.stringify({ text: 'research' }), in_reply_to: null }, paSlackSession, ); @@ -937,7 +937,7 @@ describe('agent-to-agent routing', () => { const researcherSession = getSessionsByAgentGroup('ag-researcher')[0]; await routeAgentMessage( - { id: 'out-reply', platform_id: 'ag-pa', content: JSON.stringify({ text: 'found it' }) }, + { id: 'out-reply', platform_id: 'ag-pa', content: JSON.stringify({ text: 'found it' }), in_reply_to: null }, researcherSession, ); @@ -961,7 +961,7 @@ describe('agent-to-agent routing', () => { const { session: paSession } = resolveSession('ag-pa', 'mg-slack', null, 'shared'); await routeAgentMessage( - { id: 'out-1', platform_id: 'ag-researcher', content: JSON.stringify({ text: 'go' }) }, + { id: 'out-1', platform_id: 'ag-researcher', content: JSON.stringify({ text: 'go' }), in_reply_to: null }, paSession, ); diff --git a/src/modules/agent-to-agent/agent-route.test.ts b/src/modules/agent-to-agent/agent-route.test.ts index 41ae380..fca0d4b 100644 --- a/src/modules/agent-to-agent/agent-route.test.ts +++ b/src/modules/agent-to-agent/agent-route.test.ts @@ -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,