@@ -2,6 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
22import type { InboxPlanningOutput } from "@atlas/core" ;
33import {
44 getDefaultGoogleCalendarConnectionStore ,
5+ getDefaultFollowUpRuntimeStore ,
56 getDefaultInboxProcessingStore ,
67 listPlannerRunsForTests ,
78 listScheduleBlocksForTests ,
@@ -108,6 +109,7 @@ function buildRequest(body: unknown, secret = "test-webhook-secret") {
108109
109110async function seedOutstandingFollowUpBundle ( titles : string [ ] ) {
110111 const store = getDefaultInboxProcessingStore ( ) ;
112+ const followUpStore = getDefaultFollowUpRuntimeStore ( ) ;
111113
112114 seedInboxItemForProcessingTests ( {
113115 id : "inbox-seed" ,
@@ -170,7 +172,7 @@ async function seedOutstandingFollowUpBundle(titles: string[]) {
170172 } ) ;
171173
172174 const taskIds = listTasksForTests ( ) . map ( ( task ) => task . id ) ;
173- await ( store as any ) . markFollowUpSent ( taskIds , "2026-03-20T17:00:00.000Z" ) ;
175+ await followUpStore . markFollowUpSent ( taskIds , "2026-03-20T17:00:00.000Z" ) ;
174176
175177 await recordOutgoingTelegramMessageIfNew ( {
176178 userId : "123" ,
@@ -198,6 +200,7 @@ async function seedOutstandingFollowUpBundle(titles: string[]) {
198200
199201 return {
200202 store,
203+ followUpStore,
201204 taskIds
202205 } ;
203206}
@@ -336,7 +339,7 @@ describe("telegram webhook route", () => {
336339 } ) ;
337340
338341 it ( "binds numbered followup replies and marks the selected task done" , async ( ) => {
339- const { store } = await seedOutstandingFollowUpBundle ( [ "Review launch checklist" ] ) ;
342+ const { store, followUpStore } = await seedOutstandingFollowUpBundle ( [ "Review launch checklist" ] ) ;
340343
341344 const response = await handleTelegramWebhook (
342345 buildRequest ( {
@@ -351,7 +354,7 @@ describe("telegram webhook route", () => {
351354 } ) ,
352355 {
353356 store,
354- followUpStore : store as any ,
357+ followUpStore,
355358 primeProcessingStore : seedInboxItemForProcessingTests
356359 }
357360 ) ;
@@ -364,7 +367,7 @@ describe("telegram webhook route", () => {
364367 } ) ;
365368
366369 it ( "accepts short natural-language followup replies that reference bundle numbers" , async ( ) => {
367- const { store, taskIds } = await seedOutstandingFollowUpBundle ( [ "Task 1" , "Task 2" ] ) ;
370+ const { store, followUpStore , taskIds } = await seedOutstandingFollowUpBundle ( [ "Task 1" , "Task 2" ] ) ;
368371
369372 const response = await handleTelegramWebhook (
370373 buildRequest ( {
@@ -379,7 +382,7 @@ describe("telegram webhook route", () => {
379382 } ) ,
380383 {
381384 store,
382- followUpStore : store as any ,
385+ followUpStore,
383386 primeProcessingStore : seedInboxItemForProcessingTests
384387 }
385388 ) ;
@@ -395,7 +398,7 @@ describe("telegram webhook route", () => {
395398 } ) ;
396399
397400 it ( "accepts ordinal followup archive replies" , async ( ) => {
398- const { store, taskIds } = await seedOutstandingFollowUpBundle ( [ "Task 1" , "Task 2" ] ) ;
401+ const { store, followUpStore , taskIds } = await seedOutstandingFollowUpBundle ( [ "Task 1" , "Task 2" ] ) ;
399402
400403 const response = await handleTelegramWebhook (
401404 buildRequest ( {
@@ -410,7 +413,7 @@ describe("telegram webhook route", () => {
410413 } ) ,
411414 {
412415 store,
413- followUpStore : store as any ,
416+ followUpStore,
414417 primeProcessingStore : seedInboxItemForProcessingTests
415418 }
416419 ) ;
@@ -426,7 +429,7 @@ describe("telegram webhook route", () => {
426429 } ) ;
427430
428431 it ( "asks for clarification on ambiguous followup replies with multiple unresolved items" , async ( ) => {
429- const { store } = await seedOutstandingFollowUpBundle ( [ "Task 1" , "Task 2" ] ) ;
432+ const { store, followUpStore } = await seedOutstandingFollowUpBundle ( [ "Task 1" , "Task 2" ] ) ;
430433
431434 const response = await handleTelegramWebhook (
432435 buildRequest ( {
@@ -441,7 +444,7 @@ describe("telegram webhook route", () => {
441444 } ) ,
442445 {
443446 store,
444- followUpStore : store as any ,
447+ followUpStore,
445448 primeProcessingStore : seedInboxItemForProcessingTests
446449 }
447450 ) ;
@@ -454,7 +457,7 @@ describe("telegram webhook route", () => {
454457 } ) ;
455458
456459 it ( "lets mixed-intent messages fall through to the normal router even with outstanding followups" , async ( ) => {
457- const { store } = await seedOutstandingFollowUpBundle ( [ "Review launch checklist" , "Send investor update" ] ) ;
460+ const { store, followUpStore } = await seedOutstandingFollowUpBundle ( [ "Review launch checklist" , "Send investor update" ] ) ;
458461
459462 const response = await handleTelegramWebhook (
460463 buildRequest ( {
@@ -469,7 +472,7 @@ describe("telegram webhook route", () => {
469472 } ) ,
470473 {
471474 store,
472- followUpStore : store as any ,
475+ followUpStore,
473476 calendar : getDefaultCalendarAdapter ( ) ,
474477 primeProcessingStore : seedInboxItemForProcessingTests
475478 }
0 commit comments