Skip to content

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

turn-watchdog: keep the silentMs comparison the Local VM e2e hook rewrites, so its forced stalls fire again (#5967)

milind-soni292c4b4a2b43
diff --git a/server/turn-watchdog.ts b/server/turn-watchdog.ts
index 14281d9a85..519267803a 100644
--- a/server/turn-watchdog.ts
+++ b/server/turn-watchdog.ts
@@ -222,10 +222,12 @@ export class TurnWatchdog {
if (sleptMs) turn.lastEventAt = Math.min(at, turn.lastEventAt + sleptMs);
const limit = this.silenceLimit(turn);
if (limit === null) continue;
+ // server/testing/group-local-vm-hooks.mjs rewrites the silentMs comparison below: keep that name.
+ const { ms: silentMs, reason } = limit;
if (at - turn.lastEventAt >= this.opts.stallMs) this.readCommandCpu(turn);
- if (at - turn.lastEventAt < limit.ms) continue;
+ if (at - turn.lastEventAt < silentMs) continue;
this.turns.delete(turn.threadId);
- this.opts.onStall(turn, limit.ms, limit.reason);
+ this.opts.onStall(turn, silentMs, reason);
}
this.freeUnheld(at);
}