Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Routine ledger tests: an ended run's conversation reads as idle

milind-sonidc283162ebc4
diff --git a/server/routine-ledger-faults.test.ts b/server/routine-ledger-faults.test.ts
index feccb1be91..61753fb80d 100644
--- a/server/routine-ledger-faults.test.ts
+++ b/server/routine-ledger-faults.test.ts
@@ -28,7 +28,9 @@ function harness(start = START, file = folder(), more: Partial<RoutineManagerOpt
const options: RoutineManagerOptions = {
file, now: () => now, botState: () => bot, createTask: () => ({ threadId: `thread-${++task}` }),
startTurn: async (_botId, threadId, prompt) => { started.push(threadId); prompts.push(prompt); },
- interruptTurn: async () => {}, onRunFailed: (run) => failed.push(run), turnLive: () => live, ...more,
+ interruptTurn: async () => {}, onRunFailed: (run) => failed.push(run),
+ // The fake turn is the working run's: an ended run's conversation is idle here.
+ turnLive: (run) => (run.status === "running" || run.status === "waiting" ? live : false), ...more,
};
const h = {
file, options, started, prompts, failed, manager: new RoutineManager(options),