Skip to content

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

Merge remote-tracking branch 'origin/main' into feat/bot-api

milind-soni94232a4acfe7
diff --cc server/index.ts
index 3ce62943a6,cc977bc83b..da74d367b9
--- a/server/index.ts
+++ b/server/index.ts
@@@ -8077,7 -8068,10 +8068,10 @@@ async function beginTurn
const mountsComputerMcp = instance.adapter.capabilities.computerMcp === true;
const mountsLocalComputer = instance.adapter.capabilities.localComputerMcp === true;
const dispatchTask = store.taskByThread(bot.id, threadId);
- let wants: ComputerWant = computerSkipped || (plan.computer === "local" && botApiDriven(threadId)) ? "off" : plan.computer;
+ const handoffMayUseCloud = !computerSkipped && plan.computer === undefined && isHandedWork(opts?.coordination ? coordinator.node(opts.coordination.id) : undefined) && !teamComputer && cloudBackend === "box" && boat.boatConfigured(cfg)
+ && canWorkOnCloud(cloudEngine(instance)) && !computerPlaceRefusal("box") && !cloudPlaceRefusal(cloudEngine(instance, bot.modelSelection.model), "works-on", bot.name) && !computerToolsRefusal(toolScope, "works-on", bot.name);
+ const ownCloud = handoffMayUseCloud ? await ownCloudStateWithin(boat.boatStatus(cfg, bot.id)) : undefined, handoffOwnCloud = handoffUsesOwnCloud({ plan, handoffWork: Boolean(ownCloud), ownCloudState: ownCloud?.state });
- let wants: ComputerWant = computerSkipped ? "off" : handoffOwnCloud ? "cloud" : plan.computer;
++ let wants: ComputerWant = computerSkipped || (plan.computer === "local" && botApiDriven(threadId)) ? "off" : handoffOwnCloud ? "cloud" : plan.computer;
const skipComputer = (error: unknown) => {
if (!answer.incident || error instanceof DirectTurnSetupCancelled || error instanceof ComputerWaitParked) throw error;
computerSkipped ??= error instanceof Error ? error.message : String(error);