Skip to content

[Bug]: First Agent browser use can be killed by the 4-minute ensure timeout and is reported as "Chromium unavailable" #1160

Open

Description

@linus-liu-web

Component / host

Platform — deployment

Edition

Platform

LoopForge version

v0.4.1-rc.1, Compose install from the release tag (ghcr.io/tencent/loopforge:0.4.1-rc.1). The cited code paths are unchanged on main at d58a85a.

What happened?

On a fresh Compose install, the first use of the Agent browser builds the sidecar image (agentflow-browser-<hash>, Chromium + Playwright MCP) inside the ensure request.

internal/httpapi/browser.go caps an ensure request at 4 minutes, and internal/runtime/browser.go derives the 15-minute build context from that request context. When the build takes longer than 4 minutes the HTTP request cancels docker build.

Observed on a network where deb.debian.org served at roughly 37 KB/s:

  • The ensure request blocked for about 240 s, then returned "reason": "Agent 浏览器启动失败:当前运行环境不支持,或 Chromium 不可用" (the same string is produced in internal/engine/browser.go and internal/runner/workspace.go).
  • No image was produced, and [docker-buildx] <defunct> stayed in the platform container's process list.
  • Retrying restarted the build and failed the same way.
  • Building the same image manually with a docker build that outlived the request succeeded; once the image exists, ensure returns available: true in about 2 s. So the failure is in the first-use build path, not in Chromium support.

The surfaced error is misleading: it reports missing Chromium support while the actual event is a cancelled build. The build's own output never reaches the operator, because it only goes to the request that was cancelled.

Related smaller points:

  • internal/runtime/browser_assets/Dockerfile hardcodes deb.debian.org and exposes only NPM_REGISTRY as a build argument. There is no Debian mirror argument, and at 37 KB/s the apt-get install chromium fonts-noto-cjk layer alone takes hours.
  • The pre-warm path exists but is undocumented: agentflow -browser-image (flag in cmd/agentflow/main.go) builds or pulls the image, and AGENTFLOW_BROWSER_IMAGE supplies a prebuilt image. Neither appears in docs/, README*, or the installer output. The image is also about 1.06 GB, which users notice as unexplained disk use.

Reproduction

  1. Install the release with Docker Compose:
    git clone --branch v0.4.1-rc.1 https://github.com/Tencent/LoopForge.git && cd LoopForge && ./start.sh
  2. Make sure no agentflow-browser-* image is present (docker images | grep agentflow-browser), then open a conversation's 浏览器 tab, or call:
    POST /api/runs/<run-id>/browser with {"operation":"status","ensure":true}.
  3. On a network where Debian/Node downloads are slow (or after docker rmi agentflow-browser-<hash>), the call returns after about 4 minutes with available: false and the Chromium reason; no browser container is created and buildx is left defunct.

Sanitized diagnostics

# ensure response after ~240 s
available: False | reason: Agent 浏览器启动失败:当前运行环境不支持,或 Chromium 不可用

# platform container process list after that request
root  209  1  0 17:01 ?  00:00:00 [docker-buildx] <defunct>

# manual pre-warm, then ensure again
$ docker compose exec platform /app/bin/agentflow -browser-image
agentflow-browser-<hash>
$ POST /api/runs/<run-id>/browser {"operation":"status","ensure":true}
HTTP 200 in 1.9 s, available: true, frame returned

Suggested direction

  1. Do not tie the sidecar build to the requesting HTTP context — for example context.WithoutCancel plus the existing 15-minute build timeout, or a background build job — so a client timeout only stops waiting. The existing browser.prepare telemetry event already announces first-time preparation.
  2. Surface the build failure and the tail of its output instead of the generic Chromium message.
  3. Add an apt mirror build argument next to NPM_REGISTRY (or document how to pass one) for slow networks.
  4. Document the pre-warm command and AGENTFLOW_BROWSER_IMAGE, and consider an opt-in pre-warm from start.sh given the image size.

Safety checks

  • I removed credentials, private endpoints, internal identifiers, and personal data.
  • I searched existing issues for duplicates. No open issue matches the first-use sidecar build timeout; fix(sandbox): explain missing isolated runtime images #1025 is about explaining missing isolated runtime images.

Activity

  1. cocofhu00 commented on Nov 20, 2026

    @cocofhu00
    Contributor

    Thanks for the report. I understand that on a fresh Compose install, the first Agent browser use can have its sidecar image build cancelled when the ensure request hits the 4-minute limit, and the result is reported as Chromium being unavailable even though a longer manual build of the same image later succeeds.

    This has been noted and will be reviewed along with the existing issues. No fix time is set yet.

  2. linus-liu-web commented on Nov 21, 2026

    @linus-liu-web
    Author

    Both follow-ups are up now, in case they help the review here:

    The ensure request still has its 4-minute cap; with #1173 the build survives it, so the next attempt starts the browser instead of rebuilding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions