Repository navigation
Add environment control package - #11
Merged
Merged
Conversation
Introduces a new package for managing WebArena environment containers with: - CLI interface (env-ctrl) for status checks, reset, and server operations - REST API server with dashboard for remote environment control - Site-specific operations for gitlab, reddit, shopping, shopping_admin, and wikipedia - Docker and HTTP client implementations for the main webarena_verified package - Integration tests for CLI, server, and dashboard functionality Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Am1n3e
commented
Feb 2, 2026
Am1n3e
commented
Feb 2, 2026
| version = "0.1.0" | ||
| description = "Environment control for WebArena Docker containers" | ||
| readme = "README.md" | ||
| requires-python = ">=3.9" |
Contributor
Author
There was a problem hiding this comment.
Add comment on why 3.9 (lowest supported version on the site docker files)
Am1n3e
commented
Feb 2, 2026
Am1n3e
force-pushed
the
pr/3-env-control
branch
from
February 2, 2026 11:53
8091e9e to
a7fdce8
Compare
Add documentation explaining why the package exists (version mismatch, limited container access), how it works (CLI and HTTP interfaces), and include a mermaid diagram showing the architecture.
There was a problem hiding this comment.
Pull request overview
Adds a new environment_control package plus client bindings and CLI hooks in webarena_verified to control/inspect Docker-based environments via a lightweight REST server and dashboard.
Changes:
- Introduces
packages/environment_control(CLI, REST server + HTML dashboard, ops implementations for multiple sites). - Adds
webarena_verified.environments.env_ctrl_client(stdlib HTTP client + docker-exec client) and exposes a newwebarena-verified env ...CLI group. - Adds Docker-based integration tests and updates dependency/lock files (pytest-playwright, rerunfailures, local editable package).
Reviewed changes
Copilot reviewed 37 out of 40 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds editable local environment-control package and new dev test dependencies. |
| pyproject.toml | Moves dev tooling deps into dependency-groups, adds local uv source for environment-control, adds ruff per-file ignores for packages. |
| src/webarena_verified/types/environment.py | Adds EnvCtrlResult model for env-ctrl command results. |
| src/webarena_verified/types/init.py | Re-exports EnvCtrlResult. |
| src/webarena_verified/environments/env_ctrl_client/http_client.py | Adds stdlib-only HTTP client for env-ctrl REST API. |
| src/webarena_verified/environments/env_ctrl_client/docker_client.py | Adds docker-exec client for running env-ctrl commands inside containers. |
| src/webarena_verified/environments/env_ctrl_client/base.py | Adds protocol interface intended to unify env control clients. |
| src/webarena_verified/environments/env_ctrl_client/init.py | Exposes client APIs and keeps EnvCtrlClient alias. |
| src/webarena_verified/main.py | Adds webarena-verified env {status,start,stop,init} subcommands. |
| tests/integration/environment_control/conftest.py | Adds Docker container fixture spinning up the env-ctrl server for integration tests. |
| tests/integration/environment_control/test_server.py | Adds integration tests for REST endpoints and client utilities. |
| tests/integration/environment_control/test_dashboard.py | Adds HTML + Playwright-based dashboard integration tests. |
| tests/integration/environment_control/test_cli.py | Adds integration tests for env-ctrl CLI behavior. |
| packages/environment_control/uv.lock | Adds lockfile for the new package. |
| packages/environment_control/pyproject.toml | Defines the new package build, scripts, and ruff config. |
| packages/environment_control/README.md | Documents package usage. |
| packages/environment_control/environment_control/init.py | Exposes package public API and version. |
| packages/environment_control/environment_control/main.py | Enables python -m environment_control .... |
| packages/environment_control/environment_control/cli.py | Implements env-ctrl CLI commands. |
| packages/environment_control/environment_control/env-ctrl | Adds a local dev wrapper script for env-ctrl. |
| packages/environment_control/environment_control/py.typed | Marks package as typed (PEP 561). |
| packages/environment_control/environment_control/_internal/init.py | Exposes internal config/logging utilities. |
| packages/environment_control/environment_control/_internal/config.py | Adds env-based server configuration. |
| packages/environment_control/environment_control/_internal/logging.py | Adds package-specific logging setup. |
| packages/environment_control/environment_control/server/init.py | Exposes server entrypoint. |
| packages/environment_control/environment_control/server/app.py | Implements REST API server + dashboard rendering. |
| packages/environment_control/environment_control/server/assets/dashboard.html | Adds HTML dashboard UI and JS actions. |
| packages/environment_control/environment_control/ops/init.py | Adds ops registry and exports ops surface. |
| packages/environment_control/environment_control/ops/base.py | Implements base ops API (init/start/stop/restart/health/cleanup). |
| packages/environment_control/environment_control/ops/types.py | Defines core types (Result/Health/ExecLog/OpsConfig). |
| packages/environment_control/environment_control/ops/mixins/init.py | Exposes mixins for ops implementations. |
| packages/environment_control/environment_control/ops/mixins/supervisor.py | Adds supervisord operations (status/start/stop, parsing, wait). |
| packages/environment_control/environment_control/ops/sites/init.py | Exports site-specific ops implementations. |
| packages/environment_control/environment_control/ops/sites/dummy.py | Adds dummy ops for tests/dev. |
| packages/environment_control/environment_control/ops/sites/gitlab.py | Adds GitLab ops implementation. |
| packages/environment_control/environment_control/ops/sites/map.py | Adds OpenStreetMap ops implementation. |
| packages/environment_control/environment_control/ops/sites/reddit.py | Adds Reddit/Postmill ops implementation. |
| packages/environment_control/environment_control/ops/sites/shopping.py | Adds Shopping ops implementation. |
| packages/environment_control/environment_control/ops/sites/shopping_admin.py | Adds Shopping Admin ops implementation. |
| packages/environment_control/environment_control/ops/sites/wikipedia.py | Adds Wikipedia ops implementation. |
Comments suppressed due to low confidence (1)
src/webarena_verified/main.py:1207
env_commandis annotated asint | None, but all code paths return anint. Consider tightening the return type tointto avoid implyingNoneis a valid return (especially since the result is passed tosys.exit(...)).
return 0
except Exception as e:
logger.error(f"Failed to trim network logs: {e}")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Create dedicated docs/environments/ section with overview page - Move Docker images docs from getting_started/environments.md - Add environment_control documentation with architecture diagram - Add Python client usage examples and API reference - Enable mermaid diagram support in mkdocs - Add redirect from old environments URL
- Add Dashboard section explaining the web UI - Include screenshot showing status, action buttons, and console
Am1n3e
commented
Feb 2, 2026
- Fix Result.to_dict() mutating self.value dict - Fix HTML injection by escaping env_name and site_url in dashboard - Add /restart endpoint to server and CLI - Add /is_ready as alias for /status endpoint - Fix dashboard JS to use data.details.value schema - Add restart() method to HttpClient and DockerClient - Fix stage_files() resource leak and tar exit code check - Simplify EnvCtrlClientProtocol to common methods only - Add Docker availability check in test fixtures - Remove low-value dashboard HTML content tests - Remove unused env-ctrl wrapper script - Add Python 3.9 version comment in pyproject.toml - Fix README HTTP API examples to use correct endpoints
- Add docker pytest marker for Docker-dependent tests - Use dynamic port allocation via env_ctrl_server_port fixture - Use pytest rootpath instead of manual path calculation - Return EnvControlContainer dataclass with name, base_url, port - Update tests to use fixture base_url instead of hardcoded URLs - Fix type annotation for generator fixture - Apply ruff formatting
- Consolidate test_dashboard_interactive.py into test_dashboard.py - Reduce granular tests into fewer comprehensive tests - Use env_control_container.base_url instead of hardcoded URL
Run env-ctrl integration tests only when relevant files change: - packages/environment_control/** - tests/integration/environment_control/** - src/webarena_verified/environments/env_ctrl_client/** Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds environment control package for managing WebArena Docker containers.
Added
environment_controlpackage (packages/environment_control/)env-ctrl) for status checks, reset, and server operationswebarena_verified.environments.env_ctrl_client)HttpClientfor HTTP API accessEnvCtrlDockerClientfor docker exec accessdocs/environments/)Dashboard
The env-ctrl server includes a web dashboard for manual environment management:
Usage
CLI (via docker exec)
HTTP API
Python Client