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.
Read OPENBOT_ONE_COMPUTER_EACH from .env in start.sh (#676)
Asem ahmed5f0dd85aa847
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c77f7f37..95fd8eba 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -206,6 +206,13 @@ OpenAI SDK only defaults an absent URL, so it was given "" as the address. The B`https://api.openai.com/v1` for an empty value, as its Anthropic branch already did for`ANTHROPIC_BASE_URL`. An OpenAI-compatible endpoint is unchanged.+### `OPENBOT_ONE_COMPUTER_EACH=false` in `.env` is honoured by `start.sh`++`scripts/start.sh` read `OPENBOT_ONE_COMPUTER_EACH` from the environment alone, so the line that+`docs/configuration.md` tells people to put in `.env` was ignored: the supervisor was still started+and the server still told to give each Bot its own computer. It now reads the key as it reads every+other setting, the environment first, then `.env`, then the default of `true`.+### Skill selection keeps capabilities named across multiple JSON repliesWhen a model wraps its skill choice in prose or sends a revised JSON object, OpenBot reads eachdiff --git a/scripts/start-restart-guard.test.ts b/scripts/start-restart-guard.test.tsindex 984255c0..f2893f86 100644--- a/scripts/start-restart-guard.test.ts+++ b/scripts/start-restart-guard.test.ts@@ -293,6 +293,54 @@ describe("start.sh settings with no line in .env", () => {});});+describe("start.sh one computer each", () => {+ /**+ * `OPENBOT_ONE_COMPUTER_EACH=false` IN `.env` TURNS THE SUPERVISOR OFF, AS THE DOCS SAY.+ *+ * The key was read from the environment alone, so a `.env` line was ignored: the supervisor was+ * still started and the server still told to use it. docs/configuration.md says to set it "in+ * `.env` or in the environment", and every other setting in this script is read that way.+ *+ * THE SUPERVISOR IS WHAT GIVES EACH BOT ITS OWN COMPUTER, so its absence from the services handed+ * to `docker compose up` is the observable half; the shared computer stays.+ */+ test("false in .env starts no supervisor", async () => {+ const result = await runStartWithStaleServerProbe(401, {+ settings: { OPENBOT_ONE_COMPUTER_EACH: "false" },+ });++ expect({ exitCode: result.exitCode, stderr: result.stderr }).toEqual({+ exitCode: 0,+ stderr: "",+ });+ expect(result.dockerLog).toContain(+ "compose up -d --build postgres agent-computer agent-bot agent-langgraph",+ );+ expect(result.dockerLog).not.toContain("supervisor");+ });++ test("false in the process environment starts no supervisor either", async () => {+ const result = await runStartWithStaleServerProbe(401, {+ settings: { OPENBOT_ONE_COMPUTER_EACH: "true" },+ processEnvironment: { OPENBOT_ONE_COMPUTER_EACH: "false" },+ });++ expect(result.exitCode).toBe(0);+ expect(result.dockerLog).not.toContain("supervisor");+ });++ test("true, or absent, still starts it", async () => {+ for (const omitFromEnv of [[], ["OPENBOT_ONE_COMPUTER_EACH"]] as const) {+ const result = await runStartWithStaleServerProbe(401, { omitFromEnv });++ expect(result.exitCode).toBe(0);+ expect(result.dockerLog).toContain(+ "compose up -d --build postgres supervisor agent-computer agent-bot agent-langgraph",+ );+ }+ });+});+describe("start.sh selected provider services", () => {test.each([".env", "process environment"])("an Anthropic-only %s selection starts the managed Bot without the OpenAI-only sample",diff --git a/scripts/start.sh b/scripts/start.shindex 129c7bdc..88af586a 100755--- a/scripts/start.sh+++ b/scripts/start.sh@@ -49,7 +49,10 @@ BOT_PORT="$(setting BOT_PORT 4200)"LANGGRAPH_PORT="$(setting LANGGRAPH_PORT 4201)"BOT_PROVIDER="$(setting BOT_PROVIDER openai | tr '[:upper:]' '[:lower:]' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"SUPERVISOR_PORT="$(setting SUPERVISOR_PORT 4500)"-ONE_COMPUTER_EACH="${OPENBOT_ONE_COMPUTER_EACH:-true}"+# Through `setting`, like every other key here, so `.env` counts as the comment above says and as+# docs/configuration.md tells people to rely on. Read from the environment alone, `false` in `.env`+# was ignored: the supervisor was still started and the server still told to use it.+ONE_COMPUTER_EACH="$(setting OPENBOT_ONE_COMPUTER_EACH true)"export APP_PORT SERVER_PORTSUPERVISOR_TOKEN="$(setting SUPERVISOR_TOKEN openbot-dev-supervisor-token)"COMPUTER_TOKEN="$(setting COMPUTER_TOKEN openbot-dev-computer-token)"