Skip to content

Add native OpenEnv V1 taskset support#1997

Open
xeophon wants to merge 17 commits into
mainfrom
codex/openenv-native-v1
Open

Add native OpenEnv V1 taskset support#1997
xeophon wants to merge 17 commits into
mainfrom
codex/openenv-native-v1

Conversation

@xeophon

@xeophon xeophon commented Jul 14, 2026

Copy link
Copy Markdown
Member

Overview

Adds a reusable openenv-v1 adapter package that lets OpenEnv own environment startup and interaction while Verifiers maps reset observations, actions, rewards, and termination into the standard V1 task, user, and trace model.

The public surface stays small: import OpenEnvConfig and OpenEnvTaskset from openenv_v1 for any OpenEnv environment id or existing server, or subclass them to provide environment-specific defaults. openenv_wordle_v1 demonstrates the thin-wrapper pattern by supplying only Wordle's non-default ASGI app.

Execution model

OpenEnv runs as the task's V1 user simulator, independently of the model harness:

  • harness.runtime.* places the model harness.
  • taskset.task.user.runtime.* places the OpenEnv user for UV and base_url runs.
  • The OpenEnv user defaults to the host subprocess runtime.
  • Each entry in taskset.resets becomes one finite task and is passed directly to OpenEnv's reset.

The reset observation opens the conversation, so the adapter does not add a generic OpenEnv prompt. Each user turn contains the current observation and live action schema. Step rewards are accumulated on the V1 trace, and OpenEnv's done signal stops the rollout.

Environment startup modes

UV provider (default)

env="openenv/<name>" calls GenericEnvClient.from_env(..., use_docker=False). OpenEnv resolves the environment and launches its ASGI application with UV. Remote ids may require Git, network access, and environment-specific system packages in the selected user runtime; project_path can point at source already present in that runtime.

OpenEnv-native launch options live under task.user.provider_kwargs, including app, env_vars, project_path, port, workers, host, reload, and startup timeout settings.

UV works with host subprocess, Verifiers Docker, Prime, Modal, or a colocated harness runtime when that runtime provides the source and system requirements. It is the default because it does not require an inner Docker daemon.

OpenEnv Docker provider

use_docker=true asks OpenEnv to pull and run the environment's published image. Verifiers does not build an environment image.

Docker-backed OpenEnv always receives its own Prime VM user runtime (colocated=false, vm=true) so the Docker daemon runs inside a VM rather than inside another container. Existing Prime settings such as image, resources, networking, region, and labels are retained; only vm is forced on. A non-Prime user runtime selection is replaced with the Prime VM configuration.

Existing OpenEnv server

base_url connects to an already-running OpenEnv server. It performs no clone, dependency resolution, image pull, or server launch. The endpoint must be reachable from the configured user runtime. An inherited env default or unused provider settings do not affect this connection mode.

Configuration and extension

  • env: OpenEnv environment id.
  • base_url: existing OpenEnv server; required only when env is absent.
  • use_docker: use OpenEnv's Docker provider instead of UV.
  • resets: finite list of dictionaries passed to reset; defaults to one empty reset.
  • task.user.provider_kwargs: options passed to GenericEnvClient.from_env.
  • task.user.runtime: placement for UV or base_url; Docker always selects a Prime VM.
  • task.user.colocated: reuse the harness runtime for UV or base_url; Docker forces this off.

On setup the adapter connects the client, reads the environment's live schema, discovers concrete tools for generic MCP-style environments, and resets the environment. It accepts structured JSON actions plus raw values for single-field schemas, sums per-step rewards, and maps done to V1 stopping.

The included Wordle wrapper can be run directly:

uv run eval openenv_wordle_v1 -n 1 --push false

Other OpenEnv packages can depend on openenv-v1, subclass OpenEnvConfig to set env and any required provider defaults, then inherit OpenEnvTaskset.

Supporting V1 server changes

The standalone adapter declares its own OpenEnv dependency, keeping it out of the main Verifiers package extras while letting sandbox launch install it with the adapter. Server setup, serving, and cleanup now share one async event loop, so OpenEnv's native context manager closes UV processes, Docker containers, and remote sessions on graceful shutdown. Sandboxed server processes retain UV's user-bin path, and subprocess provider temp files live in the runtime workdir so normal runtime cleanup removes them.

Compared with the legacy integration

V1 OpenEnv taskset Legacy OpenEnvEnv
Environment source OpenEnv id or base_url Copied environments/<name>/proj/ tree
Required preparation None specific to Verifiers openenv.yaml, server package/Dockerfile, then vf-build
Runtime placement UV in the configured user runtime; Docker in a Prime VM Prime sandbox from a prebuilt image
Environment contract Read from the live OpenEnv schema Inferred during the build
Runtime metadata OpenEnv client/provider state Generated build manifest
Prompting Reset observation plus live action schema Custom prompt renderer

Legacy vf-build pushed a Prime image and generated the metadata used to start each rollout. V1 removes that Verifiers-specific build and lifecycle layer:

  • UV may clone source and resolve Python dependencies at startup.
  • OpenEnv Docker pulls and runs an upstream published image.
  • base_url does neither.

The legacy API and vf-build remain separate; V1 OpenEnv tasksets do not use them.


Note

Medium Risk
New external OpenEnv integration and Docker-forced Prime VM placement affect rollout runtime behavior; lockfile adds a large dependency surface but core verifiers paths are mostly additive.

Overview
Introduces a reusable openenv-v1 package that wires OpenEnv into Verifiers V1: OpenEnvUser connects via GenericEnvClient (UV, Docker, or base_url), loads the live action schema (including MCP tool discovery), maps agent messages to step/reset, and scores rollouts from accumulated rewards and OpenEnv’s done flag. openenv-wordle-v1 is a thin subclass that pins openenv/wordle and defaults Wordle’s non-standard ASGI app in provider_kwargs.

Both packages are added to the repo examples group and uv.sources; uv.lock gains the openenv dependency tree.

Supporting MCP changes: sandbox launches set TMPDIR on subprocess runtimes and wrap server startup in one async loop with AsyncExitStack so providers like OpenEnv can shut down cleanly; non-subprocess launches preserve PATH for uv.

Reviewed by Cursor Bugbot for commit 29ea522. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add native OpenEnv V1 taskset support for Wordle and generic environments

  • Adds openenv_v1 package with OpenEnvTaskset, OpenEnvUser, and supporting config/data models to run OpenEnv-compatible environments as verifier tasksets.
  • OpenEnvUser.setup_task connects to or launches an OpenEnv instance, introspects the action schema over HTTP (including MCP tool listing), and performs an initial reset before interaction begins.
  • OpenEnvUser.respond steps the environment on each turn, accumulates reward, and returns the observation plus action schema; termination and scoring are driven by the environment's done flag and cumulative reward.
  • Adds openenv_wordle_v1 package as a concrete specialization, defaulting the provider app to textarena_env.server.app:app.
  • OpenEnvConfig validation enforces that either env or base_url is set, and automatically switches the user runtime to VM mode when use_docker is true.
  • Updates serve_in_runtime in launch.py to set TMPDIR to the runtime workdir for subprocess providers and to launch sandboxed providers through a shell that exports $HOME/.local/bin on PATH.

Macroscope summarized 29ea522.

Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread environments/openenv_wordle_v1/pyproject.toml
Comment thread docs/v1/overview.md Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 14, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

Unable to check for correctness in 29ea522. This PR introduces a new OpenEnv V1 taskset feature with ~170 lines of new integration code, new components (OpenEnvTaskset, OpenEnvUser), and modifications to core runtime behavior in launch.py and server.py. New feature with external integrations warrants human review.

You can customize Macroscope's approvability policy. Learn more.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aed0c1aa11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/openenv_v1/openenv_v1/taskset.py
@xeophon
xeophon requested a review from willccbb July 14, 2026 12:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e0d114956

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread environments/openenv_wordle_v1/pyproject.toml
Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated
Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread environments/openenv_wordle_v1/pyproject.toml
Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated
Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8ad2c423e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated
Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread environments/openenv_wordle_v1/openenv_wordle_v1/taskset.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6c4116031

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated
Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated
Comment thread verifiers/v1/mcp/launch.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad39bead64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread environments/openenv_wordle_v1/openenv_wordle_v1/taskset.py Outdated
Comment thread packages/openenv_v1/openenv_v1/taskset.py
@kemo04

kemo04 commented Jul 14, 2026

Copy link
Copy Markdown

AI Code Review (PR Review Agent)

  • [Logic & Correctness · High]verifiers/v1/mcp/launch.py (diff line 1589): The variable 'packages' uses shlex.join on a list containing a path and dependencies, but the resulting string is passed directly to 'uv pip install' which expects space-separated arguments; if dependencies contain spaces, this will break.
  • [Logic & Correctness · High]verifiers/v1/mcp/launch.py (diff line 1597): The 'packages' variable is used in a shell command string; if any dependency name contains shell-sensitive characters, it may cause command injection or syntax errors.
  • [Logic & Correctness · High]verifiers/v1/mcp/launch.py (diff line 1621): The command string uses shlex.join(command) inside a shell -c string, which double-escapes the command and will likely cause the shell to fail to execute the intended binary.
  • [Logic & Correctness · High]verifiers/v1/mcp/server.py (diff line 1676): o
  • [Logic & Correctness · High]verifiers/v1/tasksets/openenv/taskset.py (diff line 1817): The check launch_options & overrides.keys() is insufficient because overrides contains the entire nested structure, not just top-level keys.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7d3b606cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/openenv_v1/openenv_v1/taskset.py
@xeophon
xeophon force-pushed the codex/openenv-native-v1 branch from 91231ec to 0a98a78 Compare July 15, 2026 12:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a98a783eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated
@xeophon
xeophon force-pushed the codex/openenv-native-v1 branch from d15e217 to c173e7f Compare July 16, 2026 16:12
Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c173e7f8e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/openenv/taskset.py Outdated
Comment thread packages/openenv_v1/openenv_v1/taskset.py
Comment thread pyproject.toml Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 83f968b. Configure here.

Comment thread packages/openenv_v1/openenv_v1/taskset.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants