Skip to content

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

fix(chief): skip the no-cloud-computer note for bots set to work on their cloud computer

AdityaUmale9406e947bd66
diff --git a/server/index.ts b/server/index.ts
index ff17f1d3f9..cad0fbec21 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -465,7 +465,7 @@ import { buildBotOverview, type BotOverview, connectedAppsFacts } from "./bot-ov
import { ProfileRequestService } from "./profile-requests.ts";
import { ModelRequestService } from "./model-requests.ts";
import { TeamSetupError, TeamSetupRequestService } from "./team-setup-requests.ts";
-import { teamSetupDecisionText as decisionText, type TeamSetupRequest } from "../shared/team-setup.ts";
+import { startsWithoutCloudComputer, teamSetupDecisionText as decisionText, type TeamSetupRequest } from "../shared/team-setup.ts";
import { profileRevision, profileSnapshot } from "./profile-revision.ts";
import { flushAllProfileHistory, flushProfileHistory, readHistory, recordProfileChange, soulChanges } from "./profile-versions.ts";
import { TeamMemory, TEAM_MEMORY_KINDS, type TeamMemoryKind } from "./team-memory.ts";
@@ -1922,7 +1922,7 @@ const computerParks = new Map<string, string>();
const parkedSeats = new Map<string, string>();
const COMPUTER_FREE_NOTE = "OpenMausBot computer update: the computer this conversation waited for is free again. Continue the task that parked waiting for it.";
const STEP_CAP_NOTE = "Your previous turn stopped at the step limit; continue from where it stopped.";
-const lacksCloudComputer = (bot: BotRecord | null | undefined): boolean => !!bot && boat.boatConfigured(cfg) && bot.cloudBackend !== "vps" && !inheritedTeamComputer(bot);
+const lacksCloudComputer = (bot: BotRecord | null | undefined): boolean => !!bot && startsWithoutCloudComputer(bot, { cloudOn: boat.boatConfigured(cfg), teamComputer: Boolean(inheritedTeamComputer(bot)) });
const teamSetupDecisionText = (request: TeamSetupRequest): string => decisionText(request, (id) => lacksCloudComputer(store.bot(id)));
const connectionUpdateText = (labels: readonly string[]): string =>
`OpenMausBot connection update: the user securely connected ${labels.join(", ")}. Continue the task that paused for this connection. Do not ask them to connect it again.`;
diff --git a/shared/team-setup.test.ts b/shared/team-setup.test.ts
index 643b3acf8c..81cd004b96 100644
--- a/shared/team-setup.test.ts
+++ b/shared/team-setup.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
-import { teamSetupDecisionText, type TeamSetupRequest } from "./team-setup.ts";
+import { startsWithoutCloudComputer, teamSetupDecisionText, type TeamSetupRequest } from "./team-setup.ts";
const request = (result: TeamSetupRequest["result"]): TeamSetupRequest => ({
version: 1, requestId: "req-1", botId: "chief", threadId: "t1", reason: "", createdAt: 0, requesterRevision: "r",
@@ -28,3 +28,17 @@ describe("teamSetupDecisionText", () => {
}
});
});
+
+describe("startsWithoutCloudComputer", () => {
+ it("is false for a bot set to work on its cloud computer, which starts one on its first turn", () => {
+ expect(startsWithoutCloudComputer({ computer: "cloud" }, { cloudOn: true, teamComputer: false })).toBe(false);
+ });
+
+ it("is true only for a box-backed bot with no team computer when the Cloud offers computers", () => {
+ expect(startsWithoutCloudComputer({}, { cloudOn: true, teamComputer: false })).toBe(true);
+ expect(startsWithoutCloudComputer({ computer: "browser" }, { cloudOn: true, teamComputer: false })).toBe(true);
+ expect(startsWithoutCloudComputer({}, { cloudOn: false, teamComputer: false })).toBe(false);
+ expect(startsWithoutCloudComputer({}, { cloudOn: true, teamComputer: true })).toBe(false);
+ expect(startsWithoutCloudComputer({ cloudBackend: "vps" }, { cloudOn: true, teamComputer: false })).toBe(false);
+ });
+});
diff --git a/shared/team-setup.ts b/shared/team-setup.ts
index d430010c6e..c4a01a30f0 100644
--- a/shared/team-setup.ts
+++ b/shared/team-setup.ts
@@ -53,6 +53,11 @@ export interface TeamSetupUndo {
revisions: Record<string, string>;
}
+/** A new bot gets no cloud computer until the person writes in its chat, unless it is set to work on one (it then starts one on its first turn), uses a VPS or the team's computer. */
+export function startsWithoutCloudComputer(bot: { computer?: string; cloudBackend?: string }, place: { cloudOn: boolean; teamComputer: boolean }): boolean {
+ return place.cloudOn && !place.teamComputer && bot.cloudBackend !== "vps" && bot.computer !== "cloud";
+}
+
/** Told to a Chief about a bot it just made that has no cloud computer of its own yet. */
export function noCloudComputerNote(name: string): string {
return ` @${name} has no cloud computer yet: work you hand it runs without one until the person writes to it in its own chat, which sets one up. If its first job needs a computer, tell the person that in one line.`;