Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
fix(local-vm): let the bot attach browser tools to Chromium on its own desktop
Aditya Umale0411dd2ce55e
diff --git a/server/container-computer.test.ts b/server/container-computer.test.tsindex 2fd2d04e70..d973d99329 100644--- a/server/container-computer.test.ts+++ b/server/container-computer.test.ts@@ -961,7 +961,8 @@ describe("Cua integration", () => {// 0.37.0 waits 800 ms after every foreground key, click or scroll for a window it might open, and glides its agent cursor// for about 0.6 s before each pixel action; plain logs feed desktop_error.expect(dockerfile).toContain(`CUA_DRIVER_WINDOW_CHANGE_TIMEOUT_MS=200 NO_COLOR=1 ${CUA_EXECUTABLE} serve`);- expect(dockerfile).toContain(`--permission-mode standard --cursor-reduced-motion on'`);+ // Without the grant every browser_prepare existing_profile is refused (browser_consent_required) and the bot asks the person to authorize it.+ expect(dockerfile).toContain(`--permission-mode standard --grant existing-profile --cursor-reduced-motion on'`);expect(dockerfile).toContain("prepare-openmausbot-workspace.sh");expect(dockerfile).toContain('if ! chmod 0700 "$workspace"');expect(dockerfile).toContain('test -r "$directory" && test -w "$directory" && test -x "$directory"');@@ -981,7 +982,7 @@ describe("Cua integration", () => {expect(dockerfile).toContain("6a73f9541c2de74158c0e7cf6b0a58ef774f5a780bf191f2d7ec9cc53efe2bf2");expect(dockerfile).toContain("/usr/local/share/licenses/noto-cjk/OFL.txt");expect(dockerfile).toContain("fc-cache -f");- expect(IMAGE_LAYER_VERSION).toBe("8");+ expect(IMAGE_LAYER_VERSION).toBe("9");});it("starts the driver's Chrome without its own sandbox inside the hardened container", () => {diff --git a/server/container-computer.ts b/server/container-computer.tsindex 3cfa163b70..809bb68493 100644--- a/server/container-computer.ts+++ b/server/container-computer.ts@@ -52,7 +52,7 @@ export const BASE_IMAGE = `${BASE_IMAGE_REPOSITORY}@${BASE_IMAGE_DIGEST}`;// localhost/ is explicit: Podman prepends it to unqualified build tags and may then resolve the name on Docker Hub.// Image and container labels, not this mutable tag, decide compatibility.export const IMAGE_REPOSITORY = "localhost/openmausbot/cua-local-vm";-export const IMAGE_LAYER_VERSION = "8";+export const IMAGE_LAYER_VERSION = "9";export const IMAGE_LAYER_LABEL = "com.openmausbot.image-layer";export const IMAGE = `${IMAGE_REPOSITORY}:driver-${CUA_DRIVER_VERSION}-v${IMAGE_LAYER_VERSION}`;export const CONTAINER = "openmausbot-computer";@@ -179,7 +179,7 @@ RUN set -eux; \\echo '6a73f9541c2de74158c0e7cf6b0a58ef774f5a780bf191f2d7ec9cc53efe2bf2 /usr/local/share/licenses/noto-cjk/OFL.txt' | sha256sum -c -; \\fc-cache -f${workspacePreparationDockerfile(VM_WORKSPACE_GUEST)}-# A bot's own desktop: a 200 ms (not 800) watch for windows an action opens still sees Firefox popups; no cursor glide; plain logs; Chrome's own sandbox off, since it needs namespaces this hardened container (capabilities dropped, runtime seccomp) refuses and Chrome exits with code 21; the container is the isolation boundary here.+# A bot's own desktop: a 200 ms (not 800) watch for windows an action opens still sees Firefox popups; no cursor glide; plain logs; Chrome's own sandbox off, since it needs namespaces this hardened container (capabilities dropped, runtime seccomp) refuses and Chrome exits with code 21; the container is the isolation boundary here. --grant existing-profile lets the bot attach the browser tools to Chromium it opened on this desktop; without it every attach is refused with browser_consent_required.RUN printf '%s\\n' \\'#!/bin/sh' \\'/usr/local/bin/prepare-openmausbot-workspace.sh' \\@@ -189,7 +189,7 @@ RUN printf '%s\\n' \\' if [ "$attempt" -ge 45 ]; then echo "X display :1 did not become ready within 45 seconds" >&2; exit 1; fi' \\' sleep 1' \\'done' \\- 'exec env CUA_DRIVER_BROWSER_NO_SANDBOX=1 CUA_DRIVER_INSTALL_CHANNEL=python_package CUA_DRIVER_RS_TELEMETRY_ENABLED=0 CUA_DRIVER_WINDOW_CHANGE_TIMEOUT_MS=200 NO_COLOR=1 ${CUA_EXECUTABLE} serve --socket ${CUA_SOCKET} --permission-mode standard --cursor-reduced-motion on' \\+ 'exec env CUA_DRIVER_BROWSER_NO_SANDBOX=1 CUA_DRIVER_INSTALL_CHANNEL=python_package CUA_DRIVER_RS_TELEMETRY_ENABLED=0 CUA_DRIVER_WINDOW_CHANGE_TIMEOUT_MS=200 NO_COLOR=1 ${CUA_EXECUTABLE} serve --socket ${CUA_SOCKET} --permission-mode standard --grant existing-profile --cursor-reduced-motion on' \\> /usr/local/bin/start-openmausbot-cua-driver.sh \\&& chmod 0755 /usr/local/bin/start-openmausbot-cua-driver.shRUN printf '%s\\n' \\