Skip to content

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

Merge pull request #6149 from TuftyBruno/feat/room-lanes-default

milind-sonibf4e877facd2
diff --cc server/host/room-jobs.ts
index cf3104c358,de223109e8..810f0c753f
--- a/server/host/room-jobs.ts
+++ b/server/host/room-jobs.ts
@@@ -51,9 -51,16 +51,16 @@@ export function createRoomJobs({ store
function useLanes(room: GroupRecord, roomThreadId: string, jobs: number, mode: string): boolean {
if (mode === "notify" || !parallelRoomJobsEnabled(cfg)) return false;
- return jobs > 1 || coordinator.all().some(n => live(n) && (n.groupId === room.id ? n.threadId === roomThreadId : laneRoomThread(n) === roomThreadId));
+ return jobs > 1 || coordinator.active().some(n => live(n) && (n.groupId === room.id ? n.threadId === roomThreadId : laneRoomThread(n) === roomThreadId));
}
+ // A job running beside its room still follows the room's shared instructions.
+ function laneBulletin(n: Pick<HandoffView, "botId" | "threadId" | "groupId">): string {
+ const room = store.groupByThread(laneRoomThread(n) ?? "");
+ const bulletin = room?.bulletin.trim();
+ return room && bulletin ? `Room bulletin of "${room.name}" (shared instructions for everyone):\n${bulletin}` : "";
+ }
+
function openLane(room: GroupRecord, roomThreadId: string, botId: string, sender: { id: string; name: string }, brief: string) {
const existing = store.workThread(botId, sender.id, roomThreadId, true);
const snippet = brief.replace(/\s+/g, " ").trim().slice(0, 48);