Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.
fix(computer): install only the Chromium build the computer launches (#829)
Dustye5694c7e0d69
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 82f48d3c..d442a197 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -132,7 +132,8 @@ jobs:- run: bun install --frozen-lockfile- run: bun install --frozen-lockfileworking-directory: agent-computer- - run: bunx playwright install --with-deps chromium+ # `--no-shell` as the image does, so the headless run below proves nothing needs the shell.+ - run: bunx playwright install --with-deps --no-shell chromiumworking-directory: agent-computer# Headless here: these launch through the profile path without the computer's own X server.# The headless run of the Web Bot Auth test is also the one that checks the user agent fix.diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d093fe55..7f0c3254 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -188,6 +188,17 @@ the spot: the step showed "Didn't work" and the Bot said nothing more. The failuBot like any other result, so it can take a fresh snapshot, try another way, or tell you whatstopped it. A refused step reads as a refusal the Bot can explain.+### The computer image is about a fifth smaller to download++The `openbot-agent-computer` image carried two copies of Chromium: the full browser it runs, and+Playwright's separate headless shell, which it never starts. Every launch names a Chromium channel,+and Playwright runs the full browser for a named channel even with `COMPUTER_BROWSER_MODE=headless`.+The image now installs only the full browser and drops the package cache left from installing it.+The download falls from 537 MB to about 423 MB on arm64 and from 520 MB to about 411 MB on amd64.+Unpacked, the image is about 375 MB smaller on arm64 and 296 MB smaller on amd64. The all-in-one `openbot` image installs the same browser the same way and shrinks by about+as much. The browser and its behaviour are unchanged. On a desktop install the computer is the+largest image, so a first install and each upgrade download less.+### A Bot can send, draft and reply in GmailOpenBot left out every Composio action that takes a file, because a Bot has no way to supply one.diff --git a/Dockerfile b/Dockerfileindex 0152296c..65f52759 100644--- a/Dockerfile+++ b/Dockerfile@@ -31,11 +31,12 @@ ENV DEBIAN_FRONTEND=noninteractiveENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwrightCOPY --from=node-toolchain /usr/local /usr/localCOPY --from=bun-toolchain /usr/local/bin/bun /usr/local/bin/bun+# `--no-shell` and the bunx cache: see agent-computer/Dockerfile, which installs the same browser.RUN apt-get update && apt-get install -y --no-install-recommends \ca-certificates curl unzip xz-utils \&& ln -s bun /usr/local/bin/bunx \- && bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps chromium \- && rm -rf /root/.cache /tmp/* /var/lib/apt/lists/* \+ && bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps --no-shell chromium \+ && rm -rf /root/.cache /root/.bun /usr/local/install/cache /tmp/* /var/lib/apt/lists/* \# PINNED, BECAUSE THE CHART NAMES THESE NUMBERS. `computers.podSecurityContext` runs a computer# pod as 1001, and without `--uid` that is only where these happen to land today: `ubuntu:24.04`# ships its own `ubuntu` user at 1000, so the next two are 1001 and 1002. Let the base add onediff --git a/agent-computer/Dockerfile b/agent-computer/Dockerfileindex 42bf6da3..f706ec83 100644--- a/agent-computer/Dockerfile+++ b/agent-computer/Dockerfile@@ -15,11 +15,15 @@ ENV DEBIAN_FRONTEND=noninteractiveENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwrightCOPY --from=node-toolchain /usr/local /usr/localCOPY --from=bun-toolchain /usr/local/bin/bun /usr/local/bin/bun+# `--no-shell`: every launch names a Chromium channel (`browser-runtime.ts`), and Playwright runs+# the full build for a named channel even when headless, so the headless shell is never started. It+# was 340 MB unpacked and about 106 MB of every download. The bunx package cache goes too: Bun+# writes it under both BUN_INSTALL and the home directory, 35 MB the image never reads.RUN apt-get update && apt-get install -y --no-install-recommends \ca-certificates curl unzip xz-utils \&& ln -s bun /usr/local/bin/bunx \- && bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps chromium \- && rm -rf /root/.cache /tmp/* /var/lib/apt/lists/*+ && bunx --bun "playwright@${PLAYWRIGHT_VERSION}" install --with-deps --no-shell chromium \+ && rm -rf /root/.cache /root/.bun /usr/local/install/cache /tmp/* /var/lib/apt/lists/*WORKDIR /app# The lockfile as well as the manifest: `--frozen-lockfile` with no lockfile present resolves afreshdiff --git a/agent-computer/tests/sign-in.test.ts b/agent-computer/tests/sign-in.test.tsindex 6f24af29..9c7d550a 100644--- a/agent-computer/tests/sign-in.test.ts+++ b/agent-computer/tests/sign-in.test.ts@@ -105,7 +105,8 @@ beforeAll(async () => {origin = `http://127.0.0.1:${server.port}`;if (!asked) return;const { chromium } = await import("playwright");- browser = await chromium.launch();+ // A named channel, as the computer launches: the image has no headless shell for a bare launch.+ browser = await chromium.launch({ channel: "chromium" });});afterAll(async () => {diff --git a/docs/deployment.md b/docs/deployment.mdindex 8484da8c..0f5b6d73 100644--- a/docs/deployment.md+++ b/docs/deployment.md@@ -238,8 +238,9 @@ which makes them the shortest path from nothing to a running deployment.**The browser images carry only the Chromium browser family.** The all-in-one Dockerfile and thepublished `agent-computer` Dockerfile both build from Ubuntu and run Playwright's pinned-`install --with-deps chromium` path, so Firefox and WebKit are never introduced into the final image-layers. Keep that Playwright version matched to `agent-computer/package.json`; changing one without+`install --with-deps --no-shell chromium` path, so Firefox and WebKit are never introduced into the+final image layers. `--no-shell` leaves out Playwright's separate headless shell: every launch names a+Chromium channel, and Playwright runs the full browser for a named channel even when headless. Keep that Playwright version matched to `agent-computer/package.json`; changing one withoutthe other can make the browser protocol and executable revision diverge. The images keep thebaseline Node command-line tools (`node`, `npm`, and `npx`) from the official Node 24.18.1 image.Measured as local zstd OCI layer descriptors against the previous Playwright-base `agent-computer`diff --git a/tests/compose.test.ts b/tests/compose.test.tsindex 478c103c..1f14040c 100644--- a/tests/compose.test.ts+++ b/tests/compose.test.ts@@ -522,7 +522,7 @@ test("builds the deployment image with Playwright's Chromium payload only", () ='bunx --bun "playwright@' +"$" +"{PLAYWRIGHT_VERSION}" +- '" install --with-deps chromium',+ '" install --with-deps --no-shell chromium',);expect(dockerfile).not.toMatch(/\bnodejs\b|\bnpm\b/);expect(dockerfile).not.toMatch(