Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ RUN chown -R 1000:1000 /app /root/.cache/uv
ENV PATH="/app/.venv/bin:$PATH"
ENV UV_PROJECT_ENVIRONMENT="/app/.venv"

# Optional: CLI coding agents (codex / cursor / openclaw, plus the claude-code
# CLI). Off by default to keep the CI image small. Enable with:
# Optional: CLI coding agents (claude-code / codex / cursor / openhands /
# openclaw). Off by default to keep the CI image small. Enable with:
# docker build --build-arg INSTALL_CLI_AGENTS=true .
# Notes (see docs/cli-agents-deployment.md):
# - Node 22.x via NodeSource: openclaw declares engines node>=22.19.0.
# - OpenHands is installed as a uv tool with Python 3.12.
# - npm cache lives at a world-writable path so the uid-1000 runtime user
# reuses the pre-warmed Playwright MCP download (npx caches per-user via
# this env, not under /root).
Expand All @@ -100,12 +101,14 @@ RUN if [ "$INSTALL_CLI_AGENTS" = "true" ]; then \
&& rm -rf /var/lib/apt/lists/* \
&& if [ "$USE_CN_MIRROR" = "true" ]; then npm config set registry https://registry.npmmirror.com -g; fi \
&& npm install -g @anthropic-ai/claude-code @openai/codex openclaw \
&& UV_TOOL_DIR=/opt/uv-tools UV_TOOL_BIN_DIR=/usr/local/bin uv tool install openhands --python 3.12 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Relocate the uv-managed Python used by OpenHands

In this python:3.11-slim stage, --python 3.12 makes uv download a managed interpreter; uv python dir shows that the default installation directory is /root/.local/share/uv/python. Setting only UV_TOOL_DIR relocates the tool environment, not that interpreter, so its Python executable references a path beneath /root, which mode 0700 prevents the documented uid-1000 runtime user from traversing. The OpenHands entry point therefore cannot start in the CLI-enabled image. Set UV_PYTHON_INSTALL_DIR to a shared location (and grant traversal), or install Python 3.12 somewhere accessible to the runtime user.

Useful? React with 👍 / 👎.

&& curl https://cursor.com/install -fsS | bash \
&& mv /root/.local/share/cursor-agent /opt/cursor-agent \
&& ln -s /opt/cursor-agent/versions/*/cursor-agent /usr/local/bin/cursor-agent \
&& npx -y @playwright/mcp@latest --version \
&& chmod -R a+rwX /opt/npm-cache \
&& chmod -R a+rX /opt/cursor-agent \
&& chmod -R a+rX /opt/uv-tools \
# Real passwd entry + home for the uid-1000 runtime user: codex
# refuses a codex_home under temporary dirs, so HOME must not fall
# back to /tmp. docker run --user 1000 resolves HOME from passwd.
Expand All @@ -120,4 +123,4 @@ RUN cp /app/config.example.yaml /app/config.yaml

ENTRYPOINT ["/app/scripts/docker-entrypoint.sh"]

CMD ["uv", "run", "scripts/run.py", "--help"]
CMD ["uv", "run", "scripts/run.py", "--help"]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ source .venv/bin/activate # macOS / Linux
.venv\Scripts\Activate.ps1 # Windows PowerShell
```

**CLI agents: claude-code / codex / cursor / openclaw** (requires Node.js 18+; **openclaw requires Node.js 22.19+**)
**CLI agents: claude-code / codex / cursor / openhands / openclaw** (requires Node.js 18+; **openclaw requires Node.js 22.19+**; **openhands requires Python 3.12+ via uv**)

These agents share the main venv (`uv sync`, no extra) and drive an external
CLI installed separately:
Expand All @@ -114,6 +114,7 @@ npm install -g @anthropic-ai/claude-code # claude-code (auth: ANTHROPIC_API_
npm install -g @openai/codex # codex (auth: codex login or OPENAI_API_KEY)
curl https://cursor.com/install -fsS | bash # cursor (auth: CURSOR_API_KEY)
export PATH="$HOME/.local/bin:$PATH" # cursor-agent installs to ~/.local/bin
uv tool install openhands --python 3.12 # openhands (auth: LLM_API_KEY via config.yaml)
npm install -g openclaw # openclaw (no login; key via config.yaml)
```

Expand Down
3 changes: 2 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ source .venv/bin/activate # macOS / Linux
.venv\Scripts\Activate.ps1 # Windows PowerShell
```

**CLI agents: claude-code / codex / cursor / openclaw**(需要 Node.js 18+;**openclaw 需要 Node.js 22.19+**)
**CLI agents: claude-code / codex / cursor / openhands / openclaw**(需要 Node.js 18+;**openclaw 需要 Node.js 22.19+**;**openhands 需要通过 uv 使用 Python 3.12+**)

这些 agent 共用主 venv(`uv sync`,无 extra),并依赖单独安装的外部 CLI:

Expand All @@ -112,6 +112,7 @@ npm install -g @anthropic-ai/claude-code # claude-code(认证:ANTHROPIC_
npm install -g @openai/codex # codex(认证:codex login 或 OPENAI_API_KEY)
curl https://cursor.com/install -fsS | bash # cursor(认证:CURSOR_API_KEY)
export PATH="$HOME/.local/bin:$PATH" # cursor-agent 安装在 ~/.local/bin
uv tool install openhands --python 3.12 # openhands(认证:通过 config.yaml 注入 LLM_API_KEY)
npm install -g openclaw # openclaw(无需登录;key 通过 config.yaml 注入)
```

Expand Down
5 changes: 5 additions & 0 deletions browseruse_bench/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
except ImportError as exc:
logger.warning("Skipping optional agent module browseruse_bench.agents.cursor: %s", exc)

try:
from browseruse_bench.agents import openhands # noqa: F401
except ImportError as exc:
logger.warning("Skipping optional agent module browseruse_bench.agents.openhands: %s", exc)
Comment on lines +42 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not hide OpenHands import defects as an optional skip

The OpenHands module has no optional Python SDK import, so catching every ImportError here also swallows project or interface errors raised by its imports. In such an environment the provider is silently left unregistered and users receive a misleading unknown-agent failure rather than the underlying defect. Import it directly, or move genuinely optional loading into a lazy factory that only tolerates the target package being absent.

AGENTS.md reference: AGENTS.md:L12-L13

Useful? React with 👍 / 👎.


try:
from browseruse_bench.agents import openclaw # noqa: F401
except ImportError as exc:
Expand Down
Loading
Loading