Skip to content

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

Burst mode: a burst whose bot is gone ends instead of waiting

Milind Soni675c9f148962
diff --git a/server/host/burst-host.ts b/server/host/burst-host.ts
index 7423880731..9e39013615 100644
--- a/server/host/burst-host.ts
+++ b/server/host/burst-host.ts
@@ -96,7 +96,8 @@ export function createBurstHost(deps: BurstHostDeps): BurstManager & { model(bot
if (child.threadId) deps.stop(burst.botId, child.threadId, "The person cancelled this burst.");
},
async startMerge(burst, text, done) {
- if (!store.bot(burst.botId) || deps.threadBusy(burst.botId, burst.threadId)) return false;
+ if (!store.bot(burst.botId)) throw new Error("The bot is no longer here.");
+ if (deps.threadBusy(burst.botId, burst.threadId)) return false;
await deps.startTurn(burst.botId, text(), { threadId: burst.threadId, cardContinuation: true, ...(burst.cardMessageId ? { requestMessageId: burst.cardMessageId } : {}), origin: deps.origin(burst), allowRoomTurnElsewhere: true,
onSettled: (result) => { done(outcomeOf(result)); }, onDispatchError: (message) => { done({ ok: false, text: message }); } });
return true;