Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
docs(browser): drop agent-browser leftovers from browser docs and comments
trohitg6aa91e4fe186
diff --git a/docs-internal/browser.md b/docs-internal/browser.mdindex 28a4536f..ffaf6ac7 100644--- a/docs-internal/browser.md+++ b/docs-internal/browser.md@@ -47,9 +47,13 @@ version, platform checksums and the browser-use CLI pin live in[`server/config/browser_runtime.json`](../server/config/browser_runtime.json).Only testing mode installs Chrome under `<DATA_DIR>/packages/chrome-for-testing/`.Both modes install the pinned browser-use CLI through an isolated uv tool-installation under `<DATA_DIR>/packages/browser-use/`, outside the shared Bun-package tree. `uv` must be on PATH or selected by `OPENCOMPANY_UV_BIN`.-Installation can outlive the open request; the workspace reports progress.+installation under `<DATA_DIR>/packages/browser-use/{tools,bin}`, outside the+shared Bun package tree. When both `UV_TOOL_DIR` and `UV_TOOL_BIN_DIR` are set+(the desktop app sets them beside its bundled Python), the tool installs there+instead. `opencompany-browser-use.json` in the tool directory records the+installed pin; a different pin reinstalls. `uv` must be on PATH or selected by+`OPENCOMPANY_UV_BIN`. Installation can outlive the open request; the workspace+reports progress.Runtime settings are declared in[`server/core/config.py`](../server/core/config.py); stream diagnostics readsdiff --git a/docs-internal/node-logic-flows/web_automation/browserHarness.md b/docs-internal/node-logic-flows/web_automation/browserHarness.mdindex 25b7fd5e..144eea53 100644--- a/docs-internal/node-logic-flows/web_automation/browserHarness.md+++ b/docs-internal/node-logic-flows/web_automation/browserHarness.md@@ -2,7 +2,7 @@`browserHarness` is no longer a registered node or agent tool. Use the current [Browser node flow](browser.md), [native browser architecture](../../browser.md), and [browser workspace](../../browser_workspace.md).-The replacement `browser` node launches OpenCompany-managed Chrome with persistent owned profiles. The live viewer and human takeover use the native CDP path. Most agent/workflow operations still use the pinned browser-use CLI and its daemon internally; this dependency does not restore the old node or its real-Chrome attachment model.+The replacement `browser` node launches the installed Chrome, Edge or Chromium (Chrome for Testing only with `BROWSER_RUNTIME=testing`) in persistent OpenCompany-owned profiles. The live viewer and human takeover use the native CDP path. Most agent/workflow operations still use the pinned browser-use CLI and its daemon internally; this dependency does not restore the old node or its real-Chrome attachment model.[Workflow migration](../../../server/services/workflow_migrations.py) rewrites saved `browserHarness` nodes to `browser`:diff --git a/server/nodes/browser/_install_bu.py b/server/nodes/browser/_install_bu.pyindex e332d72b..3313a04f 100644--- a/server/nodes/browser/_install_bu.py+++ b/server/nodes/browser/_install_bu.py@@ -3,10 +3,11 @@``uv tool install browser-use==<pin>`` into ``UV_TOOL_DIR`` /``UV_TOOL_BIN_DIR``. The desktop app already sets both (next to the Pythonit bundles, so uninstalling the app cannot orphan the tool); anywhere else-they default to ``<DATA_DIR>/packages/browser-use/{tools,bin}``. The install-runs as an async subprocess with a timeout, never on the event loop, and a-failure is retried after a cooldown. ``install.json`` records what was-installed; a different pin reinstalls.+they default to ``<DATA_DIR>/packages/browser-use/{tools,bin}`` (both+variables must be set for the override to apply). The install runs as an+async subprocess with a timeout, never on the event loop, and a failure is+retried after a cooldown. ``opencompany-browser-use.json`` in the tool dir+records what was installed; a different pin reinstalls."""from __future__ import annotationsdiff --git a/server/nodes/browser/_screenshots.py b/server/nodes/browser/_screenshots.pyindex 82b8f18f..87d6a774 100644--- a/server/nodes/browser/_screenshots.py+++ b/server/nodes/browser/_screenshots.py@@ -1,12 +1,14 @@-"""Screenshot persistence shared by the two browser plugins.+"""Screenshot persistence for the ``browser`` node.-Both browser nodes historically leaked screenshots in shapes the platform-cannot use: ``browser`` returned whatever agent-browser printed (a base64-blob — a media-contract violation that also hits the 100 KB CLI-output-truncation), and ``browserHarness`` returned an absolute path under its-daemon tmp dir, which no HTTP route can serve. These helpers land the bytes-in the workflow workspace via ``write_media(kind="image")`` so a screenshot-becomes a ~400 B ``FileRef`` the Canvas board / gallery can display.+The browser-use CLI writes a screenshot to a PNG under its per-profile tmp+dir — an absolute host path no HTTP route can serve. ``persist_screenshot_file``+copies it into the workflow workspace via ``write_media(kind="image")`` so a+screenshot becomes a ~400 B ``FileRef`` the Canvas board / gallery can+display; the caller then deletes the temporary file.++``persist_screenshot_from_payload`` handles the retired agent-browser+driver's inline-base64 payload shape. The current node does not call it;+only its tests do.Every helper is TOLERANT by contract: an unrecognized payload shape, amissing workspace, or a write failure logs one warning and returns ``None``@@ -120,11 +122,11 @@ def persist_screenshot_from_payload(def persist_screenshot_file(path_text: str, ctx: Any, *, contained_under: Path) -> Optional[Dict[str, Any]]:- """A harness-printed screenshot path -> serialized FileRef.+ """A browser-use CLI screenshot path -> serialized FileRef.- Reads ONLY files contained under the harness runtime dir — the printed- path is process output, not a trusted input, so this is not a generic- read-any-path helper.+ Reads ONLY files contained under ``contained_under`` (the CLI's+ per-profile tmp dir) — the path is process output, not a trusted+ input, so this is not a generic read-any-path helper."""candidate = Path(str(path_text or "").strip())if not candidate.is_absolute():@@ -134,7 +136,7 @@ def persist_screenshot_file(root = contained_under.resolve(strict=False)if not resolved.is_relative_to(root):logger.warning(- "[BrowserHarness] Screenshot path escapes the harness dir; not persisted"+ "[Browser] Screenshot path escapes the CLI tmp dir; not persisted")return Noneexcept OSError:@@ -148,7 +150,7 @@ def persist_screenshot_file(try:payload = resolved.read_bytes()except OSError as exc:- logger.warning("[BrowserHarness] Could not read screenshot %s: %s", resolved, exc)+ logger.warning("[Browser] Could not read screenshot %s: %s", resolved, exc)return Nonereturn _write_image(payload, ctx, ext=suffix, mime=mime)