Skip to content

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

fix(asks): keep server/index.ts at its size for the repeated-ask check

milind-soni00ba5356e6b1
diff --git a/server/index.ts b/server/index.ts
index 54988657b1..943ab64ac9 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -6436,14 +6436,11 @@ bus.subscribe((event: RuntimeEvent) => {
}
break;
case "request.opened": {
- // A provider that repeats an ask it already showed (a broker reconnect, a re-delivered event) must not post a
- // second identical card and notification; the live card is still the one to answer.
- if (event.requestId && askMessageByRequest.has(`${event.threadId}:${event.requestId}`)) break;
+ if (event.requestId && askMessageByRequest.has(`${event.threadId}:${event.requestId}`)) break; // an ask the provider repeats (a reconnect, a re-delivered event) keeps its live card: no second card or notification
// A structured ask is a question whatever channel carried it, and no approval mode answers a question for the person (at Full access one nobody is there for is not asked).
const permission = event.requestType === "permission" && !event.questions?.length;
// The provider's own mode already ran; only Full access, an exact saved command or an exact remembered MCP tool that sends nothing answers here.
- const asker = bot ?? (speaker ? store.bot(speaker.botId) : undefined);
- if (asker && proactive.fence.answers(event, asker, pushMessage)) break;
+ const asker = bot ?? (speaker ? store.bot(speaker.botId) : undefined); if (asker && proactive.fence.answers(event, asker, pushMessage)) break;
const unattended = permission && asker && event.requestId ? isUnattended(asker.id, event.threadId) : false;
// No command the owner saved answers for a guest-driven turn.
const guestDriven = cloudGuestDriven(event.threadId) || botApiThread(event.threadId);