Skip to content

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

fix(chief): tell the Chief a new bot has no cloud computer yet

AdityaUmale62ca484b00b2
diff --git a/server/drivers/agents-call.ts b/server/drivers/agents-call.ts
index 683fe5e17a..e6521b4a22 100644
--- a/server/drivers/agents-call.ts
+++ b/server/drivers/agents-call.ts
@@ -533,8 +533,12 @@ export async function callTool(called: string, input: Json, context: ToolCallCon
return { text: `One review card is visible: ${String(r.title)}. @${botName} has not been created yet. End this turn; the decision and structured result resume you automatically once. Do not ask again, poll, or repeat this request.` };
}
if (!r.id) return completedProposalResult(r, `creating @${botName}`) ?? { text: `@${botName} was not created.`, isError: true };
+ const created = r.name ?? botName;
+ const noComputer = r.noCloudComputerYet === true
+ ? ` @${created} 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.`
+ : "";
return {
- text: `Created @${r.name ?? botName} in ${r.section ?? "General"} [id: ${r.id}].${r.modelSelection ? ` Model: ${JSON.stringify(r.modelSelection)}.` : ""} Assign work with coordinate_bots.`,
+ text: `Created @${created} in ${r.section ?? "General"} [id: ${r.id}].${r.modelSelection ? ` Model: ${JSON.stringify(r.modelSelection)}.` : ""} Assign work with coordinate_bots.${noComputer}`,
};
}
if (member === "create_room") {
diff --git a/server/drivers/agents-proxy.test.ts b/server/drivers/agents-proxy.test.ts
index 56a7e447b2..096cc712bb 100644
--- a/server/drivers/agents-proxy.test.ts
+++ b/server/drivers/agents-proxy.test.ts
@@ -54,6 +54,7 @@ let computerRequests: { method: string; url: string; body: unknown }[] = [];
let computerResponse: unknown = { current: "local", available: ["local", "vm"] };
let computerStatus = 200;
let lastCreateBody: any = null;
+let createBotExtra: Record<string, unknown> = {};
let lastCreateRoomBody: unknown = null;
let lastManageRoomBody: unknown = null;
let lastCredentialBody: any = null;
@@ -299,7 +300,7 @@ beforeAll(async () => {
req.on("end", () => {
lastCreateBody = JSON.parse(data);
res.writeHead(201, { "content-type": "application/json" });
- res.end(JSON.stringify({ id: "bot-designer", name: "Pixel", section: "Work", modelSelection: lastCreateBody.modelSelection }));
+ res.end(JSON.stringify({ id: "bot-designer", name: "Pixel", section: "Work", modelSelection: lastCreateBody.modelSelection, ...createBotExtra }));
});
return;
}
@@ -1096,6 +1097,21 @@ describe("agents-proxy MCP surface", () => {
});
});
+ it("tells the Chief when the new bot has no cloud computer yet, so handed work runs without one", async () => {
+ const plain = await callTool("create_bot", { name: "Pixel", role: "Product designer", instructions: "Design." });
+ expect(plain.result.content[0].text).not.toContain("cloud computer");
+ createBotExtra = { noCloudComputerYet: true };
+ try {
+ const res = await callTool("create_bot", { name: "Pixel", role: "Product designer", instructions: "Design." });
+ const text = res.result.content[0].text;
+ expect(text).toContain("Created @Pixel in Work");
+ expect(text).toContain("@Pixel has no cloud computer yet");
+ expect(text).toContain("tell the person");
+ } finally {
+ createBotExtra = {};
+ }
+ });
+
it("passes an explicit specialist model selection intact and reports the applied model", async () => {
const modelSelection = { instanceId: "codex", model: "catalog-model", effort: "low" };
const result = await callTool("create_bot", {
diff --git a/server/index.ts b/server/index.ts
index f8906fd387..b0558f20b1 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -14241,7 +14241,7 @@ const handleRequest = async (req: IncomingMessage, res: ServerResponse) => {
section: created.section || "General",
model: created.modelSelection.model,
modelSelection: created.modelSelection, ...(botNameClash.warning(created.name) ? { warning: botNameClash.warning(created.name) } : {}),
- ...(paused ? { paused } : {}),
+ ...(paused ? { paused } : {}), ...(boat.boatConfigured(cfg) && created.cloudBackend !== "vps" && !inheritedTeamComputer(created) ? { noCloudComputerYet: true } : {}),
});
}
if (method === "POST" && (path === "/api/internal/create-room" || path === "/api/internal/manage-room")) {