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:
@@ -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,
|
||||
);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user