Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

build(tier3): upgrade Harbor to 0.25.0 and preserve runtime contracts (#464)

Narendran Raghavana72a611963ac
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 16192c15..86a7aa88 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -207,6 +207,12 @@ All notable changes to SkillEvaluator are documented in this file.
### Changed
+- Upgrade the Tier 3 backend to Harbor 0.25.0. Align supported sandbox
+ constructor options with the release while reserving automatic mounts and
+ host Compose environment forwarding for evaluator policy. Preserve local
+ agent, verifier, and artifact evidence under Harbor's new mount checks, and
+ retain explicit Codex gateway URLs, credential aliases, and full model identifiers.
+
- Name Skill Lift as the headline comparison and label pass@k differences as
supporting reliability across reports and terminal output.
diff --git a/docs/agents-and-sandboxes.mdx b/docs/agents-and-sandboxes.mdx
index 21e2f9a2..ccdad603 100644
--- a/docs/agents-and-sandboxes.mdx
+++ b/docs/agents-and-sandboxes.mdx
@@ -253,37 +253,37 @@ Anthropic evaluator with `opencode` also does not support local mode.
SkillEvaluator exposes 27 environment modes: 26 Harbor-native backends,
including Docker, plus SkillEvaluator's own `local` host-execution mode.
-Docker is the default. The `tier3` extra installs base `harbor==0.24.0`; install
+Docker is the default. The `tier3` extra installs base `harbor==0.25.0`; install
the environment extra shown below when a managed backend needs one.
| Mode | Type | Harbor extra or system prerequisite |
| --- | --- | --- |
| `docker` | Harbor-native | No additional Python extra. Requires Docker Engine and Docker Compose v2 — see [Docker mode](#docker-mode). |
| `kata` | Harbor-native | No additional Python extra. Requires a Linux host with `/dev/kvm` and a Kata Containers runtime registered with Docker — see [Kata mode](#kata-mode). |
-| `daytona` | Harbor-native | `harbor[daytona]==0.24.0` |
-| `e2b` | Harbor-native | `harbor[e2b]==0.24.0` |
-| `modal` | Harbor-native | `harbor[modal]==0.24.0` |
-| `runloop` | Harbor-native | `harbor[runloop]==0.24.0` |
-| `langsmith` | Harbor-native | `harbor[langsmith]==0.24.0` |
-| `ec2` | Harbor-native | `harbor[ec2]==0.24.0` |
-| `gke` | Harbor-native | `harbor[gke]==0.24.0` |
-| `ack` | Harbor-native | `harbor[gke]==0.24.0` |
+| `daytona` | Harbor-native | `harbor[daytona]==0.25.0` |
+| `e2b` | Harbor-native | `harbor[e2b]==0.25.0` |
+| `modal` | Harbor-native | `harbor[modal]==0.25.0` |
+| `runloop` | Harbor-native | `harbor[runloop]==0.25.0` |
+| `langsmith` | Harbor-native | `harbor[langsmith]==0.25.0` |
+| `ec2` | Harbor-native | `harbor[ec2]==0.25.0` |
+| `gke` | Harbor-native | `harbor[gke]==0.25.0` |
+| `ack` | Harbor-native | `harbor[gke]==0.25.0` |
| `openshift` | Harbor-native | No Harbor Python extra; install and authenticate the OpenShift `oc` CLI. |
-| `novita` | Harbor-native | `harbor[novita]==0.24.0` |
+| `novita` | Harbor-native | `harbor[novita]==0.25.0` |
| `apple-container` | Harbor-native | No Harbor Python extra; install the Apple `container` CLI. |
| `singularity` | Harbor-native | No Harbor Python extra; install the `singularity` CLI Harbor invokes. |
-| `islo` | Harbor-native | `harbor[islo]==0.24.0` |
-| `tensorlake` | Harbor-native | `harbor[tensorlake]==0.24.0` |
-| `cwsandbox` | Harbor-native | `harbor[cwsandbox]==0.24.0` |
-| `wandb` | Harbor-native | `harbor[cwsandbox]==0.24.0` |
-| `use-computer` | Harbor-native | `harbor[use-computer]==0.24.0` |
-| `blaxel` | Harbor-native | `harbor[blaxel]==0.24.0` |
-| `beam` | Harbor-native | `harbor[beam]==0.24.0` |
-| `skypilot` | Harbor-native | `harbor[skypilot]==0.24.0` |
-| `hyperbrowser` | Harbor-native | `harbor[hyperbrowser]==0.24.0` |
-| `vercel` | Harbor-native | `harbor[vercel]==0.24.0` |
-| `runta` | Harbor-native | `harbor[runta]==0.24.0` |
-| `mosaic` | Harbor-native | `harbor[mosaic]==0.24.0` |
+| `islo` | Harbor-native | `harbor[islo]==0.25.0` |
+| `tensorlake` | Harbor-native | `harbor[tensorlake]==0.25.0` |
+| `cwsandbox` | Harbor-native | `harbor[cwsandbox]==0.25.0` |
+| `wandb` | Harbor-native | `harbor[cwsandbox]==0.25.0` |
+| `use-computer` | Harbor-native | `harbor[use-computer]==0.25.0` |
+| `blaxel` | Harbor-native | `harbor[blaxel]==0.25.0` |
+| `beam` | Harbor-native | `harbor[beam]==0.25.0` |
+| `skypilot` | Harbor-native | `harbor[skypilot]==0.25.0` |
+| `hyperbrowser` | Harbor-native | `harbor[hyperbrowser]==0.25.0` |
+| `vercel` | Harbor-native | `harbor[vercel]==0.25.0` |
+| `runta` | Harbor-native | `harbor[runta]==0.25.0` |
+| `mosaic` | Harbor-native | `harbor[mosaic]==0.25.0` |
| `local` | SkillEvaluator | Your machine, under an OS sandbox policy — see [Local mode](#local-mode). |
Installed packages can add more modes, for example an organization's internal
@@ -302,9 +302,9 @@ authentication (`auth=wandb`), using `WANDB_API_KEY` or the netrc file that
`wandb login` writes. Because SkillEvaluator sets `auth` itself, `--ek auth=...`
is rejected for both `cwsandbox` and `wandb`.
-Harbor 0.24 also defines `cua-cloud`, `opensandbox`, `hf-sandbox`, `podman`,
-`prime`, and `smol`, but those backends are not exposed until SkillEvaluator
-can project the complete task bundle — skill, verifier, dependencies, and
+Harbor 0.25 also defines `cua-cloud`, `opensandbox`, `hf-sandbox`, `podman`,
+`prime`, `smol`, `sbx`, `sail`, and `kernel`, but those backends are not exposed
+until SkillEvaluator can project the complete task bundle — skill, verifier, dependencies, and
inputs — through a trusted image or backend-native provisioning path, with
credentials and constructor options reviewed per backend. Selecting one of those
names is rejected before a run starts. Prime cannot build a Dockerfile-only
@@ -385,7 +385,7 @@ in-cluster service account and performs a bounded, namespaced pod-list probe
before launching trials. `KUBERNETES_SERVICE_HOST` and
`KUBERNETES_SERVICE_PORT` are forwarded only for this ACK client path.
-Harbor 0.24 Modal preflight requires `~/.modal.toml` or `MODAL_TOKEN_ID` plus
+Harbor 0.25 Modal preflight requires `~/.modal.toml` or `MODAL_TOKEN_ID` plus
`MODAL_TOKEN_SECRET`. SkillEvaluator validates and forwards an explicitly set
`MODAL_CONFIG_PATH`, but Harbor's child-process preflight does not recognize a
custom config path by itself; configure one of Harbor's supported credential
@@ -422,8 +422,14 @@ never deletes snapshots. Run evaluations in a Mosaic account that only trusted
operators can write to, and delete old `harbor-*` snapshots when you no longer
need the staged skills and inputs they contain.
+Harbor's `auto_mounts` and `auto_mounting` output controls are reserved for
+SkillEvaluator's runtime policy. The `cwsandbox` and `wandb` modes also reserve
+`forward_compose_env`, which could copy operator environment values into the
+task's Compose configuration. Credentials continue to use the evaluator's
+controlled handoff.
+
Other eligible, backend-specific constructor options are forwarded after
-validation. A key that the selected backend's Harbor 0.24.0 constructor does not
+validation. A key that the selected backend's Harbor 0.25.0 constructor does not
accept is rejected before the run starts; for example, Harbor 0.24 removed
Modal's `modal_sandbox_v2` option, so drop it from existing `--ek` flags. ACK
scheduling options such as `node_selector` and `tolerations` are accepted, and
@@ -433,6 +439,10 @@ object—not credential contents. Credential-bearing options such as LangSmith's
`--environment-kwarg` values and eligible non-Docker mode with `doctor` or
`health-check` to preflight the configuration you intend to evaluate.
+Harbor 0.25 adds eligible `dockerd_wait_sec` for Daytona,
+`sandbox_timeout_secs` for E2B, `connection_pool_maxsize` for Runta, and
+`dind_image` for `cwsandbox` and `wandb`.
+
A few Harbor options contain provider-managed secret **references**, not secret
values. These narrow shapes are allowed; every other credential-shaped kwarg,
embedded credential URI, or raw secret value is rejected:
@@ -482,7 +492,7 @@ directory, verifier, and trial paths as a Harbor-native backend.
### What a backend must provide
-- Support the Harbor release SkillEvaluator pins (`harbor==0.24.0`), including
+- Support the Harbor release SkillEvaluator pins (`harbor==0.25.0`), including
its environment constructor options.
- Run the evaluator-staged image: build each task's `environment/Dockerfile` as
written, or an equivalent image with the same layers. Do not substitute a
diff --git a/docs/cli-reference.mdx b/docs/cli-reference.mdx
index 8b4594ce..8ebcbe9f 100644
--- a/docs/cli-reference.mdx
+++ b/docs/cli-reference.mdx
@@ -553,8 +553,8 @@ Use `skillevaluator tier3 PATH` for the complete workflow with automatic missing
| Flag | Default | Effect |
| --- | --- | --- |
| `-a, --agents TEXT` | provider-native | Comma-separated Harbor agents. Defaults: NVIDIA Build=`opencode`, OpenAI=`codex`, Anthropic=`claude-code`. Supported: `claude-code`, `codex`, `opencode`; Experimental: `hermes` (Docker with NVIDIA Build only; see [Experimental Hermes](agents-and-sandboxes.mdx#experimental-hermes)). The alias `claude` is accepted for `claude-code`. See [Agents & Sandboxes](agents-and-sandboxes.mdx). |
-| `--env-mode` | `docker` | Where trials run. SkillEvaluator exposes 27 environment modes: 26 Harbor-native modes — `docker`, `daytona`, `e2b`, `modal`, `runloop`, `langsmith`, `ec2`, `gke`, `ack`, `openshift`, `novita`, `apple-container`, `singularity`, `islo`, `tensorlake`, `cwsandbox`, `wandb`, `use-computer`, `blaxel`, `beam`, `skypilot`, `hyperbrowser`, `vercel`, `kata`, `runta`, `mosaic` — plus SkillEvaluator `local` mode. `wandb` runs Harbor's `cwsandbox` backend with W&B authentication, so it needs the `harbor[cwsandbox]==0.24.0` extra; Harbor 0.24 has no `wandb` extra. Harbor's `cua-cloud`, `opensandbox`, `hf-sandbox`, `podman`, `prime`, and `smol` backends are not selectable. See the complete extras and prerequisites matrix in [Agents & Sandboxes](agents-and-sandboxes.mdx#where-trials-run). Installed packages can add more modes; see [Custom execution backends](agents-and-sandboxes.mdx#custom-execution-backends). |
-| `--environment-kwarg`, `--ek` | none | Operator-only `KEY=VALUE` constructor option for Harbor-native non-Docker backends (repeatable). Values accept JSON-compatible types; skill-owned `evals/config.yml` cannot set them. Never pass secrets. Docker and local reject all kwargs, Kata accepts only `kata_runtime` and `kata_dns`, and Harbor runtime-policy fields for overrides, mounts, networks, extra Compose, lifecycle, and pod security are reserved, as are `stream`, `enable_environment_dir_upload`, and `auth` for `cwsandbox`/`wandb`. Names the selected backend does not accept in Harbor 0.24.0 are rejected. See [Native backend constructor options](agents-and-sandboxes.mdx#native-backend-constructor-options). |
+| `--env-mode` | `docker` | Where trials run. SkillEvaluator exposes 27 environment modes: 26 Harbor-native modes — `docker`, `daytona`, `e2b`, `modal`, `runloop`, `langsmith`, `ec2`, `gke`, `ack`, `openshift`, `novita`, `apple-container`, `singularity`, `islo`, `tensorlake`, `cwsandbox`, `wandb`, `use-computer`, `blaxel`, `beam`, `skypilot`, `hyperbrowser`, `vercel`, `kata`, `runta`, `mosaic` — plus SkillEvaluator `local` mode. `wandb` runs Harbor's `cwsandbox` backend with W&B authentication, so it needs the `harbor[cwsandbox]==0.25.0` extra; Harbor 0.25 has no `wandb` extra. Harbor's `cua-cloud`, `opensandbox`, `hf-sandbox`, `podman`, `prime`, `smol`, `sbx`, `sail`, and `kernel` backends are not selectable. See the complete extras and prerequisites matrix in [Agents & Sandboxes](agents-and-sandboxes.mdx#where-trials-run). Installed packages can add more modes; see [Custom execution backends](agents-and-sandboxes.mdx#custom-execution-backends). |
+| `--environment-kwarg`, `--ek` | none | Operator-only `KEY=VALUE` constructor option for Harbor-native non-Docker backends (repeatable). Values accept JSON-compatible types; skill-owned `evals/config.yml` cannot set them. Never pass secrets. Docker and local reject all kwargs, Kata accepts only `kata_runtime` and `kata_dns`, and Harbor runtime-policy fields for overrides, mounts, networks, extra Compose, lifecycle, and pod security are reserved, as are `stream`, `enable_environment_dir_upload`, `auto_mounts`, `auto_mounting`, and `auth`/`forward_compose_env` for `cwsandbox`/`wandb`. Names the selected backend does not accept in Harbor 0.25.0 are rejected. See [Native backend constructor options](agents-and-sandboxes.mdx#native-backend-constructor-options). |
| `--autopilot` | off | Create one eval case when no dataset/task source exists, then evaluate. The case is LLM-generated with the configured provider, with a deterministic keyless template fallback; an existing source is never overwritten. |
| `--skip-baseline` | off | Skip the without-skill baseline (no lift analysis, faster). |
| `--skip-with-skill` | off | Run only the without-skill baseline, for example to calibrate a task set or measure a model change before running the skill. The report is marked baseline-only: the overall score is the baseline score, with-skill and lift are unavailable (shown as `skipped` or N/A, never 0.0), and no skill verdict is given. Mutually exclusive with `--skip-baseline`. Not available on `validate`. |
diff --git a/docs/custom-graders.mdx b/docs/custom-graders.mdx
index 8ef4e83b..43f5421f 100644
--- a/docs/custom-graders.mdx
+++ b/docs/custom-graders.mdx
@@ -211,7 +211,7 @@ contract as BYOG applies.
A `custom_only` task that keeps its own Harbor test script instead of
`tests/grader.py` runs that script unchanged, so the script must follow
-Harbor's reward contract. Harbor 0.24 requires every top-level value in its
+Harbor's reward contract. Harbor 0.25 requires every top-level value in its
`reward.json` to be a number, for example
`{"overall": 1.0, "native_quality": 1.0}`; SkillEvaluator reports each numeric
key other than `overall` as a custom metric. Nested objects such as
diff --git a/docs/installation.mdx b/docs/installation.mdx
index 4f55e6d1..cd5a4c61 100644
--- a/docs/installation.mdx
+++ b/docs/installation.mdx
@@ -171,14 +171,14 @@ and environment backends.
| --- | --- |
| `llm` | Shared LLM and embedding clients used by LLM-backed checks, Tier 2, and Tier 3 |
| `tier2` | Intra-skill deduplication and local-catalog inter-skill similarity; includes `llm` |
-| `tier3` | Docker, local, and cloud live-agent evaluation through Harbor (pins `harbor==0.24.0` and requires `python-dotenv>=1.2.0`); includes `llm` |
+| `tier3` | Docker, local, and cloud live-agent evaluation through Harbor (pins `harbor==0.25.0` and requires `python-dotenv>=1.2.0`); includes `llm` |
| `security` | Bandit and pip-audit |
| `all` | `tier2`, `tier3`, and `security` in one bundle |
| `dashboard` | Local Streamlit tables for comparing saved reports and retained runs (`skillevaluator dashboard`); not included in `all` |
| `dev` | Build, test, coverage, and formatting tools for contributors |
<Tip>
-`[all]` installs the evaluator extras (`tier2`, `tier3`, `security`); add `dashboard` with `[all,dashboard]`. External scanner tools, Docker, agent CLIs, and the Harbor extras for managed sandbox backends (such as `harbor[modal]==0.24.0`) stay separate no matter which extra you pick — see [Agents & Sandboxes](agents-and-sandboxes.mdx#where-trials-run).
+`[all]` installs the evaluator extras (`tier2`, `tier3`, `security`); add `dashboard` with `[all,dashboard]`. External scanner tools, Docker, agent CLIs, and the Harbor extras for managed sandbox backends (such as `harbor[modal]==0.25.0`) stay separate no matter which extra you pick — see [Agents & Sandboxes](agents-and-sandboxes.mdx#where-trials-run).
</Tip>
## System tools
diff --git a/docs/tier3-live-evaluation.mdx b/docs/tier3-live-evaluation.mdx
index d35f1c84..611a59b4 100644
--- a/docs/tier3-live-evaluation.mdx
+++ b/docs/tier3-live-evaluation.mdx
@@ -206,23 +206,23 @@ depth.
| The agent and its credential | Same `doctor` run, with your agents; `tier3 evaluate` re-validates before any run | [Agents & Sandboxes](agents-and-sandboxes.mdx) |
| Docker running (the default environment) | `docker info` | [Agents & Sandboxes](agents-and-sandboxes.mdx) |
-## Harbor 0.24 compatibility
+## Harbor 0.25 compatibility
-The `tier3` extra installs Harbor 0.24.0, the supported Tier 3 backend for this
+The `tier3` extra installs Harbor 0.25.0, the supported Tier 3 backend for this
release. The `[all]` extra includes `tier3`. Existing SkillEvaluator commands do
not change: the public `--agents` and `--env-mode` options map built-in names and
installed adapters to Harbor's unified `--agent` and `--env` selectors.
The exact Harbor pin is deliberate: its CLI, Python models, result artifacts,
and environment/agent subclass interfaces form one compatibility surface. This
-release targets stable Harbor 0.24.0 rather than unreleased `main`. Harbor stays
+release targets stable Harbor 0.25.0 rather than unreleased `main`. Harbor stays
behind the operator-selected `tier3` extra, so static Tier 1 installs do not pull
it in. The shared LLM client window (`litellm>=1.92.0,<1.94.0.dev0`) admits
patched 1.92 and 1.93 releases validated with this integration while excluding
prerelease and as-yet unvalidated 1.94 behavior.
The integration preserves SkillEvaluator's runtime and artifact contracts while
-using Harbor 0.24:
+using Harbor 0.25:
- Every Harbor process starts in an empty, evaluator-owned working directory
with `.env` loading and Harbor telemetry disabled. Harbor ignores `.env.local`
@@ -273,13 +273,13 @@ using Harbor 0.24:
and accepts regular files and directories only. Links, junctions, hardlinks,
sparse files, special files, compressed streams, and unsafe or colliding
Windows path spellings fail closed before publication.
-- Generated tasks retain schema 1.3, which Harbor 0.24 accepts. User-owned native
+- Generated tasks retain schema 1.3, which Harbor 0.25 accepts. User-owned native
tasks, including schema 1.4, are staged without a schema rewrite. Collection
- accepts Harbor 0.24 job, trial, reward, and ATIF v1.8 artifacts, including
+ accepts Harbor 0.25 job, trial, reward, and ATIF v1.8 artifacts, including
single-step `step_results: null`, authoritative multi-step results, and
multimodal tool output, which judges and reports see as text with
`[image]`/`[audio]` markers.
-- Native tasks follow Harbor 0.24's separate-verifier precedence. For a verify
+- Native tasks follow Harbor 0.25's separate-verifier precedence. For a verify
pass that runs in a separate verifier container, a `docker_image` in the step
or task `[verifier.environment]`, or a `Dockerfile` or `docker-compose.yaml`
in the step or task `tests/` directory, defines a dedicated verifier that
@@ -289,7 +289,7 @@ using Harbor 0.24:
its environment allowlist, and rejects `docker-compose.yml` verifier
definitions, which Harbor ignores. Standard grading modes reject separate
verifiers entirely; see [Custom Graders & Tasks](custom-graders.mdx).
-- Harbor 0.24 rejects a `reward.json` whose top-level values are not all
+- Harbor 0.25 rejects a `reward.json` whose top-level values are not all
finite numbers. SkillEvaluator's verifier and wrapped custom graders already
write numeric rewards; a native task's own test script must do the same. When
Harbor's job statistics do not account for every trial, the failure names the
@@ -591,18 +591,18 @@ explicit models — see [Agents & Sandboxes](agents-and-sandboxes.mdx).
including the default Docker backend, plus SkillEvaluator's **local mode**,
which runs the agent CLI directly on the host under an OS-sandbox policy.
Managed backends such as `daytona`, `e2b`, and `modal` require their mapped
-Harbor 0.24 extra; OpenShift, Apple Container, and Singularity instead use
+Harbor 0.25 extra; OpenShift, Apple Container, and Singularity instead use
system CLIs and have no Harbor Python extra. These are selectable integration
modes, not evidence that every managed backend was exercised end to end for
-this release. Harbor 0.24 transport verification covers Docker and local;
+this release. The transport integration suites target Docker and local;
Kata mode reuses the Docker transport but has not been exercised on a KVM host.
Validate any managed backend's extra, credentials, infrastructure, and
constructor settings with `doctor` and its Harbor preflight before relying on
it.
-Harbor's `cua-cloud`, `opensandbox`, `hf-sandbox`, `podman`, `prime`, and
-`smol` backends are not selectable because they cannot
-yet receive SkillEvaluator's complete generated task bundle through a trusted
+Harbor's `cua-cloud`, `opensandbox`, `hf-sandbox`, `podman`, `prime`,
+`smol`, `sbx`, `sail`, and `kernel` backends are not selectable until they can
+receive SkillEvaluator's complete generated task bundle through a trusted
image or backend-native provisioning path.
Environment kwargs are only for Harbor-native non-Docker backends. Pass
@@ -611,9 +611,12 @@ non-secret constructor settings with the repeatable, operator-only
`evals/config.yml` cannot set them. `docker` and `local` reject any environment
kwargs, and `kata` accepts only `kata_runtime` and `kata_dns`. Fields owned by Harbor runtime policy are also reserved: resource
overrides, mounts, network policy, extra Compose definitions, SkillEvaluator's
-own lifecycle fields (`delete`, `force_build`, `keep_containers`), and
+own lifecycle fields (`delete`, `force_build`, `keep_containers`), output
+mount controls (`auto_mounts`, `auto_mounting`), and
Kubernetes pod security are not exposed through this surface. Other
-backend-specific timeout and retention knobs remain operator-owned. Use the same
+backend-specific timeout and retention knobs remain operator-owned. The
+`cwsandbox` and `wandb` modes also reserve `forward_compose_env` to prevent host
+environment values from being copied into task Compose definitions. Use the same
eligible-backend flags with `doctor` and `health-check`; never pass secrets
through constructor kwargs. GKE requires
`cluster_name`, `region`, `namespace`, `registry_location`, and
diff --git a/pyproject.toml b/pyproject.toml
index 1d0e583f..88d3252b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -65,7 +65,7 @@ tier2 = [
# Tier 3 live agent evaluation through Harbor's native environments.
tier3 = [
"skillevaluator[llm]",
- "harbor[gke]==0.24.0",
+ "harbor[gke]==0.25.0",
# CVE-2026-59950, CVE-2026-52870, and CVE-2026-52869 fixed floor.
"mcp>=1.28.1,<2",
# CVE-2026-48522 through CVE-2026-48526 fixed floor.
diff --git a/src/skillevaluator/cli.py b/src/skillevaluator/cli.py
index f24b1bf4..1a6b7f83 100644
--- a/src/skillevaluator/cli.py
+++ b/src/skillevaluator/cli.py
@@ -3575,7 +3575,7 @@ def evaluate(
console.print(
Panel(
Text(
- "Intended for trusted skills and least-privilege service accounts. Harbor 0.24.0 single-pod "
+ "Intended for trusted skills and least-privilege service accounts. Harbor 0.25.0 single-pod "
"GKE execution shares the pod service account and metadata server with evaluated skill commands.",
style="yellow",
),
diff --git a/src/skillevaluator/tier3/harbor/local_agents.py b/src/skillevaluator/tier3/harbor/local_agents.py
index e12da993..8d847f32 100644
--- a/src/skillevaluator/tier3/harbor/local_agents.py
+++ b/src/skillevaluator/tier3/harbor/local_agents.py
@@ -21,9 +21,9 @@ from pathlib import Path, PurePosixPath
from typing import TYPE_CHECKING, Any
from urllib.parse import urlsplit
+from harbor.agents.agent_auth_resolution import ResolvedModelConnection, without_inferred_endpoint
from harbor.agents.installed.base import NetworkConnectionError, NonZeroAgentExitCodeError
from harbor.agents.installed.opencode import OpenCode
-from harbor.agents.model_connection import ResolvedModelConnection, without_inferred_endpoint
from harbor.models.trial.paths import EnvironmentPaths
from harbor.utils.env import parse_bool_env_value
@@ -92,15 +92,30 @@ async def _close_running_bridge(
await _await_task_uninterruptibly(close_task, preserve_cancellation=preserve_cancellation)
-def _merge_codex_openai_compatible_config(config: dict[str, Any], base_url: str) -> dict[str, Any]:
+def _merge_codex_openai_compatible_config(
+ config: dict[str, Any],
+ base_url: str,
+ user_config: Mapping[str, Any],
+ *,
+ env_key: str = "OPENAI_API_KEY",
+) -> dict[str, Any]:
"""Apply SkillEvaluator's Responses routing without discarding user config."""
config["model_provider"] = "openai_compatible"
+ config["openai_base_url"] = base_url
model_providers = config.get("model_providers")
if not isinstance(model_providers, dict):
model_providers = {}
config["model_providers"] = model_providers
+ # Harbor 0.25 rewrites the originally selected provider's URL. That provider
+ # becomes inactive when we select our Responses route, so retain its config.
+ user_providers = user_config.get("model_providers", {})
+ if isinstance(user_providers, Mapping):
+ for name, value in user_providers.items():
+ if name != "openai_compatible":
+ model_providers[name] = copy.deepcopy(value)
+
provider = model_providers.get("openai_compatible")
if not isinstance(provider, dict):
provider = {}
@@ -110,7 +125,7 @@ def _merge_codex_openai_compatible_config(config: dict[str, Any], base_url: str)
{
"name": "OpenAI-compatible provider",
"base_url": base_url,
- "env_key": "OPENAI_API_KEY",
+ "env_key": env_key,
"wire_api": "responses",
}
)
@@ -197,6 +212,12 @@ class SkillEvaluatorClaudeCode(_InstalledClaudeCode):
return without_inferred_endpoint(access)
return access
+ def _resolved_model_name(self) -> str | None:
+ """Let the native Vertex client select its endpoint after model parsing."""
+ if self._uses_vertex_auth() and self.model_name and not self.skip_model_parsing:
+ return self._parse_model_name(self.model_name)[1]
+ return super()._resolved_model_name()
+
def _resolve_auth_env(self) -> dict[str, str]:
"""Resolve Claude Code authentication environment including Vertex AI variables."""
if not self._uses_vertex_auth():
@@ -409,7 +430,10 @@ class SkillEvaluatorGatewayCodex(SkillEvaluatorCodex):
"""Extend Harbor's final user/MCP config with SkillEvaluator routing."""
config = super()._build_effective_config(openai_base_url)
base_url = openai_base_url or os.environ.get("OPENAI_BASE_URL") or _DEFAULT_OPENAI_BASE_URL
- return _merge_codex_openai_compatible_config(config, base_url)
+ # Harbor may project the selected key into a custom provider variable
+ # and clear OPENAI_API_KEY before launching the CLI.
+ env_key = self.model_connection.api_key_destination_name or "OPENAI_API_KEY"
+ return _merge_codex_openai_compatible_config(config, base_url, self._base_config, env_key=env_key)
def _preserve_gateway_model_name(self, command: str, env: dict[str, str] | None) -> str:
"""Undo Harbor's default Codex model truncation when routing through an OpenAI-compatible gateway."""
@@ -417,10 +441,10 @@ class SkillEvaluatorGatewayCodex(SkillEvaluatorCodex):
if not model_name or "/" not in model_name or not (env or {}).get("OPENAI_BASE_URL"):
return command
- short_model = model_name.rsplit("/", 1)[-1]
+ runtime_models = {model_name.rsplit("/", 1)[-1], self._parse_model_name(model_name)[1]}
def replace(match: re.Match[str]) -> str:
- if match.group("model") != short_model:
+ if match.group("model") not in runtime_models:
return match.group(0)
return f"{match.group('prefix')}{shlex.quote(model_name)}{match.group('suffix')}"
@@ -952,7 +976,7 @@ class SkillEvaluatorNvidiaBuildCodex(_NvidiaBuildBridgeAgent, SkillEvaluatorCode
_ = openai_base_url
bridge_api_url = self._bridge_api_url()
config = super()._build_effective_config(bridge_api_url)
- return _merge_codex_openai_compatible_config(config, bridge_api_url)
+ return _merge_codex_openai_compatible_config(config, bridge_api_url, self._base_config)
def _rewrite_bridge_client_command(self, command: str) -> str:
model_name = str(self.model_name or "")
@@ -962,10 +986,10 @@ class SkillEvaluatorNvidiaBuildCodex(_NvidiaBuildBridgeAgent, SkillEvaluatorCode
)
if not model_name or "/" not in model_name:
return command
- short_model = model_name.rsplit("/", 1)[-1]
+ runtime_models = {model_name.rsplit("/", 1)[-1], self._parse_model_name(model_name)[1]}
def replace(match: re.Match[str]) -> str:
- if match.group("model") != short_model:
+ if match.group("model") not in runtime_models:
return match.group(0)
return f"{match.group('prefix')}{model_name}{match.group('suffix')}"
diff --git a/src/skillevaluator/tier3/harbor/local_environment.py b/src/skillevaluator/tier3/harbor/local_environment.py
index c61394c3..ee382b4f 100644
--- a/src/skillevaluator/tier3/harbor/local_environment.py
+++ b/src/skillevaluator/tier3/harbor/local_environment.py
@@ -19,10 +19,10 @@ import stat
import subprocess
import sys
import tempfile
-from pathlib import Path
+from pathlib import Path, PurePosixPath
from typing import Any, NoReturn
-from harbor.environments.base import BaseEnvironment, ExecResult, OutputCallback, OutputStream
+from harbor.environments.base import BaseEnvironment, EnvironmentPath, ExecResult, OutputCallback, OutputStream
from harbor.environments.capabilities import EnvironmentCapabilities
from harbor.models.environment_type import EnvironmentType
@@ -77,6 +77,7 @@ _BLOCKED_COMMAND_ENV_PREFIXES = ("DYLD_", "LD_", "PYTHON")
# Harbor transports Claude Code prompts through an uppercased UUID-named
# variable; keep that contract narrow so unrelated Harbor controls stay private.
_HARBOR_INSTRUCTION_ENV_RE = re.compile(r"HARBOR_(?:INSTRUCTION|CLAUDE_CODE_INSTRUCTION_[0-9A-F]{32})")
+_CLAUDE_INSTRUCTION_ENV_RE = re.compile(r"CLAUDE_CODE_INSTRUCTION_[0-9A-F]{32}")
_INNER_ENV_BOOTSTRAP = """
import json
import os
@@ -530,6 +531,28 @@ class SkillEvaluatorLocalEnvironment(BaseEnvironment):
def capabilities(self) -> EnvironmentCapabilities:
return EnvironmentCapabilities(mounted=True)
+ def is_path_mounted(self, environment_path: EnvironmentPath, host_path: Path) -> bool:
+ """Report direct host mappings so Harbor does not copy outputs onto themselves."""
+ path = PurePosixPath(environment_path)
+ try:
+ if self._resolve_path(str(path)).resolve() != host_path.resolve():
+ return False
+ except ValueError:
+ return False
+ # A parent mapping does not cover a child redirected elsewhere.
+ return all(
+ local.resolve() == host_path.joinpath(*child.relative_to(path).parts).resolve()
+ for remote, local in self._path_map()
+ if (child := PurePosixPath(remote)) != path and child.is_relative_to(path)
+ )
+
+ @property
+ def _artifact_staging_dir(self) -> Path:
+ """Keep sandbox writes separate from Harbor's collected output destinations."""
+ # Explicit destinations also copy the convention directory. Sharing
+ # their host path would make a transfer delete its own source.
+ return self._root / "artifacts"
+
@classmethod
def preflight(cls) -> None:
return None
@@ -563,6 +586,7 @@ class SkillEvaluatorLocalEnvironment(BaseEnvironment):
self.trial_paths.agent_dir,
self.trial_paths.verifier_dir,
self.trial_paths.artifacts_dir,
+ self._artifact_staging_dir,
self._solution,
self._installed_agent,
self._tmp,
@@ -1343,7 +1367,7 @@ class SkillEvaluatorLocalEnvironment(BaseEnvironment):
"HARBOR_LOGS_DIR": str(self.trial_paths.trial_dir),
"HARBOR_AGENT_LOGS_DIR": str(self.trial_paths.agent_dir),
"HARBOR_VERIFIER_DIR": str(self.trial_paths.verifier_dir),
- "HARBOR_ARTIFACTS_DIR": str(self.trial_paths.artifacts_dir),
+ "HARBOR_ARTIFACTS_DIR": str(self._artifact_staging_dir),
"HARBOR_SOLUTION_DIR": str(self._solution),
"HARBOR_INSTALLED_AGENT_DIR": str(self._installed_agent),
"HARBOR_SKILLS_DIR": str(self._workspace / "skills"),
@@ -1698,8 +1722,11 @@ class SkillEvaluatorLocalEnvironment(BaseEnvironment):
return os.pathsep.join(parts)
def _rewrite_env_values(self, env: dict[str, str]) -> dict[str, str]:
- """Map Harbor container paths that are passed through environment values."""
- return {key: self._rewrite_raw_paths(value) for key, value in env.items()}
+ """Map runtime paths while preserving Claude's instruction payload verbatim."""
+ return {
+ key: value if _CLAUDE_INSTRUCTION_ENV_RE.fullmatch(key) else self._rewrite_raw_paths(value)
+ for key, value in env.items()
+ }
@staticmethod
def _filter_command_env(env: dict[str, str], *, protected: set[str]) -> dict[str, str]:
@@ -1718,6 +1745,8 @@ class SkillEvaluatorLocalEnvironment(BaseEnvironment):
)
if key in protected or key in {"HOME", "TMPDIR", "PATH", "PWD"}:
continue
+ if key.startswith("CLAUDE_CODE_INSTRUCTION") and _CLAUDE_INSTRUCTION_ENV_RE.fullmatch(key) is None:
+ continue
if (
key.startswith("HARBOR_")
and key != "HARBOR_DECLARED_PORTS"
@@ -1731,7 +1760,7 @@ class SkillEvaluatorLocalEnvironment(BaseEnvironment):
return [
("/logs/agent", self.trial_paths.agent_dir),
("/logs/verifier", self.trial_paths.verifier_dir),
- ("/logs/artifacts", self.trial_paths.artifacts_dir),
+ ("/logs/artifacts", self._artifact_staging_dir),
("/logs", self.trial_paths.trial_dir),
("/workspace", self._workspace),
("/tests", self._tests),
diff --git a/src/skillevaluator/tier3/harbor/runner.py b/src/skillevaluator/tier3/harbor/runner.py
index 08add6d4..8113217a 100644
--- a/src/skillevaluator/tier3/harbor/runner.py
+++ b/src/skillevaluator/tier3/harbor/runner.py
@@ -1607,6 +1607,8 @@ def _resolve_environment_kwargs(
_HARBOR_RUNTIME_POLICY_KWARGS = frozenset(
{
+ "auto_mounting",
+ "auto_mounts",
"context_id",
"cpu_enforcement_policy",
"delete",
@@ -1662,8 +1664,9 @@ _HARBOR_ENVIRONMENT_RUNTIME_POLICY_KWARGS: dict[str, frozenset[str]] = {
}
),
"blaxel": frozenset({"dind_extra_args"}),
- # Credential strategy selection; SkillEvaluator sets it only for the wandb alias.
- "cwsandbox": frozenset({"auth"}),
+ # SkillEvaluator owns credential strategy selection and prevents arbitrary
+ # host environment values from reaching remote task Compose interpolation.
+ "cwsandbox": frozenset({"auth", "forward_compose_env"}),
"daytona": frozenset({"network_block_all"}),
"ec2": frozenset({"iam_instance_profile", "strict_host_key_checking"}),
"gke": frozenset({"memory_limit_multiplier"}),
@@ -1679,7 +1682,7 @@ _HARBOR_ENVIRONMENT_RUNTIME_POLICY_KWARGS: dict[str, frozenset[str]] = {
"singularity": frozenset({"singularity_no_mount"}),
"use-computer": frozenset({"resources"}),
"vercel": frozenset({"ports"}),
- "wandb": frozenset({"auth"}),
+ "wandb": frozenset({"auth", "forward_compose_env"}),
}
diff --git a/src/skillevaluator/tier3_environments.py b/src/skillevaluator/tier3_environments.py
index 2cfb017c..20f418a3 100644
--- a/src/skillevaluator/tier3_environments.py
+++ b/src/skillevaluator/tier3_environments.py
@@ -22,7 +22,7 @@ from typing import Any
#: The exact Harbor release whose CLI, models, and environment interfaces this
#: SkillEvaluator release targets; the ``tier3`` extra pins it.
-HARBOR_VERSION = "0.24.0"
+HARBOR_VERSION = "0.25.0"
HARBOR_ENVIRONMENTS = (
"docker",
@@ -111,10 +111,12 @@ HARBOR_ENVIRONMENT_EXTRAS: dict[str, str | None] = {
# importing the base SkillEvaluator CLI never imports Harbor or optional provider
# SDKs. The packaging parity test AST-reads the pinned Harbor sources and catches
# additions, removals, and provider kwargs that are consumed through **kwargs.
-# Registry-only entries (cua-cloud, opensandbox, hf-sandbox, podman, prime, smol)
-# keep that parity exact; those modes are not exposed.
+# Registry-only entries (cua-cloud, opensandbox, hf-sandbox, podman, prime, smol,
+# sbx, sail, kernel) keep that parity exact; those modes are not exposed.
_HARBOR_BASE_ENVIRONMENT_KWARGS = frozenset(
{
+ "auto_mounting",
+ "auto_mounts",
"cpu_enforcement_policy",
"enable_environment_dir_upload",
"environment_dir",
@@ -143,10 +145,10 @@ _HARBOR_BACKEND_ENVIRONMENT_KWARGS = {
"docker": "keep_containers",
"daytona": (
"assume_global_snapshot auto_delete_interval_mins auto_labels auto_snapshot auto_stop_interval_mins "
- "connection_pool_maxsize dind_image dind_snapshot expose_sandbox_id labels network_block_all secrets "
- "snapshot_template_name"
+ "connection_pool_maxsize dind_image dind_snapshot dockerd_wait_sec expose_sandbox_id labels network_block_all "
+ "secrets snapshot_template_name"
),
- "e2b": "",
+ "e2b": "sandbox_timeout_secs",
"modal": (
"app_name auto_labels dind_image keepalive labels modal_vm_runtime region registry_secret "
"sandbox_idle_timeout_secs sandbox_timeout_secs secrets volumes"
@@ -181,8 +183,8 @@ _HARBOR_BACKEND_ENVIRONMENT_KWARGS = {
"islo": "delete_after_seconds gateway gateway_profile",
"tensorlake": "dind_image is_public preinstall_packages snapshot_id timeout_secs use_oci_image_build",
"cwsandbox": (
- "auth base_url docker_image max_lifetime_seconds max_timeout_seconds mounts_json request_timeout_seconds "
- "secrets tags"
+ "auth base_url dind_image docker_image forward_compose_env max_lifetime_seconds max_timeout_seconds "
+ "mounts_json request_timeout_seconds secrets tags"
),
"use-computer": (
"api_key base_url device_type family gateway_url host keepalive_interval mode override_exec_timeout platform "
@@ -209,13 +211,20 @@ _HARBOR_BACKEND_ENVIRONMENT_KWARGS = {
),
"podman": "keep_containers",
"kata": "kata_dns kata_runtime keep_containers",
- "runta": "endpoint mode request_timeout_sec startup_timeout_sec token",
+ "runta": "connection_pool_maxsize endpoint mode request_timeout_sec startup_timeout_sec token",
"prime": "api_key compose_host_image gpu_type region team_id timeout_minutes",
"mosaic": "build_args build_target enable_ssh metadata persist replicas secrets ttl_seconds volume",
"smol": (
"api_key auto_checkpoint base_url checkpoints fork_batch_size fork_batch_window_ms gpu_mode ready_timeout_sec "
"target"
),
+ "sbx": "target",
+ "sail": "app_name max_lifetime_seconds",
+ "kernel": (
+ "browser_create_overrides browser_memory chrome_policy extensions gpu headless hypeman_create_attempts "
+ "kiosk_mode memory name network profile profile_id profile_name proxy proxy_id region start_url stealth tags "
+ "telemetry timeout_seconds vaults video_memory viewport viewport_height viewport_width"
+ ),
}
HARBOR_ENVIRONMENT_KWARGS: dict[str, frozenset[str]] = {
mode: _HARBOR_BASE_ENVIRONMENT_KWARGS | frozenset(names.split())
diff --git a/tests/test_harbor_environment_contract.py b/tests/test_harbor_environment_contract.py
index 141d715b..9862061f 100644
--- a/tests/test_harbor_environment_contract.py
+++ b/tests/test_harbor_environment_contract.py
@@ -49,20 +49,64 @@ def test_operators_cannot_choose_cwsandbox_auth(env_mode: str) -> None:
@pytest.mark.parametrize("env_mode", ["daytona", "modal", "tensorlake", "beam"])
[email protected]("name", ["stream", "enable_environment_dir_upload"])
-def test_harbor_stream_and_upload_controls_are_reserved(env_mode: str, name: str) -> None:
+ ("name", "value"),
+ [
+ ("stream", False),
+ ("enable_environment_dir_upload", False),
+ ("auto_mounts", [{"source": "/operator-private", "target": "/workspace/exposed"}]),
+ ("auto_mounting", True),
+ ],
+)
+def test_harbor_output_and_upload_controls_are_reserved(env_mode: str, name: str, value: object) -> None:
with pytest.raises(ValueError, match="reserved for Harbor runtime policy"):
build_harbor_run_command(
dataset_path="/tmp/dataset",
agent="opencode",
job_name="reserved",
env_mode=env_mode,
- environment_kwargs={name: False},
+ environment_kwargs={name: value},
+ )
+
+
[email protected]("env_mode", ["cwsandbox", "wandb"])
+def test_cwsandbox_cannot_forward_operator_environment_into_task_compose(env_mode: str) -> None:
+ with pytest.raises(ValueError, match=r"reserved for Harbor runtime policy.*forward_compose_env"):
+ build_harbor_run_command(
+ dataset_path="/tmp/dataset",
+ agent="opencode",
+ job_name="host-environment",
+ env_mode=env_mode,
+ environment_kwargs={"forward_compose_env": ["NVIDIA_API_KEY"]},
)
+ ("env_mode", "environment_kwargs", "encoded"),
+ [
+ ("daytona", {"dockerd_wait_sec": 120}, "dockerd_wait_sec=120"),
+ ("e2b", {"sandbox_timeout_secs": 900}, "sandbox_timeout_secs=900"),
+ ("runta", {"connection_pool_maxsize": 16}, "connection_pool_maxsize=16"),
+ ("cwsandbox", {"dind_image": "docker:28.3.3-dind"}, 'dind_image="docker:28.3.3-dind"'),
+ ("wandb", {"dind_image": "docker:28.3.3-dind"}, 'dind_image="docker:28.3.3-dind"'),
+ ],
+)
+def test_harbor_025_backend_options_reach_the_constructor(
+ env_mode: str, environment_kwargs: dict[str, object], encoded: str
+) -> None:
+ command = build_harbor_run_command(
+ dataset_path="/tmp/dataset",
+ agent="opencode",
+ job_name="backend-options",
+ env_mode=env_mode,
+ environment_kwargs=environment_kwargs,
+ )
+
+ assert encoded in _environment_kwargs(command)
+
+
def test_backend_kwargs_track_the_pinned_harbor_release() -> None:
- with pytest.raises(ValueError, match=r"Harbor 0\.24\.0 environment 'modal'.*modal_sandbox_v2"):
+ with pytest.raises(ValueError, match=r"Harbor 0\.25\.0 environment 'modal'.*modal_sandbox_v2"):
build_harbor_run_command(
dataset_path="/tmp/dataset",
agent="opencode",
@@ -438,7 +482,7 @@ def test_missing_extra_message_keeps_harbor_diagnosis_without_unpinned_install_h
)
[email protected]("env_mode", ["prime", "smol"])
[email protected]("env_mode", ["prime", "smol", "sbx", "sail", "kernel"])
def test_harbor_backends_without_task_projection_stay_unexposed(env_mode: str) -> None:
assert env_mode not in runner.HARBOR_ENV_MODES
assert "Unsupported Harbor environment" in runner._check_prerequisites(env_mode=env_mode, agents=["opencode"])[0]
@@ -446,7 +490,7 @@ def test_harbor_backends_without_task_projection_stay_unexposed(env_mode: str) -
def test_cwsandbox_prerequisites_require_sdk_and_api_key(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(runner.importlib.util, "find_spec", lambda name: None if name == "cwsandbox" else object())
- assert "harbor[cwsandbox]==0.24.0" in runner._cwsandbox_prerequisite_errors("cwsandbox")[0]
+ assert "harbor[cwsandbox]==0.25.0" in runner._cwsandbox_prerequisite_errors("cwsandbox")[0]
monkeypatch.setattr(runner.importlib.util, "find_spec", lambda _name: object())
monkeypatch.delenv("CWSANDBOX_API_KEY", raising=False)
diff --git a/tests/test_harbor_local_environment.py b/tests/test_harbor_local_environment.py
index bfd5fc45..ccd866bc 100644
--- a/tests/test_harbor_local_environment.py
+++ b/tests/test_harbor_local_environment.py
@@ -4,22 +4,209 @@
from __future__ import annotations
import asyncio
+import logging
import os
import shutil
import stat
import subprocess
import sys
import venv
-from pathlib import Path
+from pathlib import Path, PurePosixPath
+from types import SimpleNamespace
import pytest
-from harbor.models.task.config import EnvironmentConfig
+from harbor.models.task.config import ArtifactConfig, EnvironmentConfig
+from harbor.models.task.task import Task
+from harbor.models.trial.config import AgentConfig
from harbor.models.trial.paths import TrialPaths
+from harbor.trial.artifact_handler import ArtifactHandler
+from harbor.trial.trial import Trial
+from harbor.verifier.verifier import Verifier
from skillevaluator.tier3.harbor import local_sandbox
from skillevaluator.tier3.harbor.local_environment import SkillEvaluatorLocalEnvironment
+def local_output_environment(tmp_path: Path) -> SkillEvaluatorLocalEnvironment:
+ environment_dir = tmp_path / "environment"
+ environment_dir.mkdir()
+ runtime_root = tmp_path / "runtime"
+ runtime_root.mkdir()
+ paths = TrialPaths(tmp_path / "trial")
+ paths.mkdir()
+ return SkillEvaluatorLocalEnvironment(
+ environment_dir=environment_dir,
+ environment_name="local-outputs",
+ session_id="local-outputs",
+ trial_paths=paths,
+ task_env_config=EnvironmentConfig(),
+ runtime_agent="codex",
+ runtime_root=str(runtime_root),
+ sandbox_mode="off",
+ )
+
+
[email protected]("role", ["agent", "user-agent"])
[email protected]("direction", ["upload", "download"])
+def test_harbor_role_log_lifecycle_preserves_local_files(
+ local_output_environment: SkillEvaluatorLocalEnvironment,
+ role: str,
+ direction: str,
+) -> None:
+ """Harbor must recognize direct host mappings before copying role logs."""
+ environment = local_output_environment
+ host_logs = environment.trial_paths.trial_dir / role
+ host_logs.mkdir(exist_ok=True)
+ retained_log = host_logs / "session.jsonl"
+ retained_log.write_text('{"message":"retained"}\n', encoding="utf-8")
+ trial = SimpleNamespace(agent_environment=environment, logger=logging.getLogger(__name__))
+ sandbox_logs = PurePosixPath("/logs") / role
+
+ if direction == "upload":
+ asyncio.run(Trial._upload_role_logs(trial, source_dir=host_logs, target_dir=sandbox_logs))
+ else:
+ asyncio.run(
+ Trial._download_role_logs(
+ trial,
+ agent_config=AgentConfig(name="codex"),
+ source_dir=sandbox_logs,
+ target_dir=host_logs,
+ )
+ )
+
+ assert retained_log.exists(), "Copying local logs onto themselves deleted the session"
+ assert retained_log.read_text(encoding="utf-8") == '{"message":"retained"}\n'
+
+
[email protected]("destination", [None, "logs/artifacts"])
+def test_harbor_collects_local_convention_artifacts_without_recursive_copy(
+ local_output_environment: SkillEvaluatorLocalEnvironment,
+ destination: str | None,
+) -> None:
+ environment = local_output_environment
+ published_file = environment._resolve_path("/logs/artifacts/answer.txt")
+ published_file.parent.mkdir(parents=True, exist_ok=True)
+ published_file.write_text("agent answer", encoding="utf-8")
+ assert Path(environment._exec_env({})["HARBOR_ARTIFACTS_DIR"]) == published_file.parent
+ handler = ArtifactHandler(artifacts=[], logger=logging.getLogger(__name__))
+
+ entry = asyncio.run(
+ handler._download_artifact(
+ source_env=environment,
+ artifacts_dir=environment.trial_paths.artifacts_dir,
+ artifact=ArtifactConfig(source="/logs/artifacts", destination=destination),
+ convention_source="/logs/artifacts",
+ )
+ )
+
+ assert entry.status == "ok"
+ recorded_file = environment.trial_paths.artifacts_dir / "logs" / "artifacts" / "answer.txt"
+ assert published_file != recorded_file
+ assert not environment.is_path_mounted("/logs/artifacts", recorded_file.parent)
+ assert recorded_file.read_text(encoding="utf-8") == "agent answer"
+ assert published_file.read_text(encoding="utf-8") == "agent answer"
+ asyncio.run(environment.stop(delete=True))
+ assert not published_file.exists()
+ assert recorded_file.read_text(encoding="utf-8") == "agent answer"
+
+
[email protected](os.name == "nt", reason="Native Windows local mode is unsupported")
+def test_local_exec_writes_and_reads_logical_artifact_paths(
+ local_output_environment: SkillEvaluatorLocalEnvironment,
+) -> None:
+ environment = local_output_environment
+
+ async def exercise():
+ await environment.start()
+ try:
+ return await environment.exec(
+ "printf agent-answer > /logs/artifacts/answer.txt && "
+ 'cat /logs/artifacts/answer.txt && cat "$HARBOR_ARTIFACTS_DIR/answer.txt"'
+ )
+ finally:
+ await environment.stop(delete=False)
+
+ result = asyncio.run(exercise())
+
+ assert result.return_code == 0, result.stderr
+ assert result.stdout == "agent-answeragent-answer"
+ assert environment._resolve_path("/logs/artifacts/answer.txt").read_text(encoding="utf-8") == "agent-answer"
+
+
+def test_local_artifact_collection_retains_source_and_separate_step_snapshots(
+ local_output_environment: SkillEvaluatorLocalEnvironment,
+) -> None:
+ environment = local_output_environment
+ source = environment._resolve_path("/logs/artifacts/answer.txt")
+ source.parent.mkdir(parents=True, exist_ok=True)
+ handler = ArtifactHandler(artifacts=[], logger=logging.getLogger(__name__))
+
+ async def collect_steps() -> None:
+ for step_name, answer in (("first", "first answer"), ("second", "second answer")):
+ source.write_text(answer, encoding="utf-8")
+ handler.begin_collection()
+ entry = await handler._download_artifact(
+ source_env=environment,
+ artifacts_dir=environment.trial_paths.step_artifacts_dir(step_name),
+ artifact=ArtifactConfig(source="/logs/artifacts", destination="logs/artifacts"),
+ convention_source="/logs/artifacts",
+ )
+ assert entry.status == "ok"
+ assert source.read_text(encoding="utf-8") == answer
+
+ asyncio.run(collect_steps())
+
+ for step_name, answer in (("first", "first answer"), ("second", "second answer")):
+ recorded = environment.trial_paths.step_artifacts_dir(step_name) / "logs" / "artifacts" / "answer.txt"
+ assert recorded.read_text(encoding="utf-8") == answer
+
+
[email protected](os.name == "nt", reason="Native Windows local mode is unsupported")
+def test_harbor_verifier_preserves_local_reward_and_stdout(
+ local_output_environment: SkillEvaluatorLocalEnvironment,
+) -> None:
+ environment = local_output_environment
+ task_dir = environment.environment_dir.parent
+ (task_dir / "task.toml").write_text('[verifier]\nenvironment_mode = "shared"\n', encoding="utf-8")
+ (task_dir / "instruction.md").write_text("Evaluate the local reward lifecycle.", encoding="utf-8")
+ tests_dir = task_dir / "tests"
+ tests_dir.mkdir()
+ (tests_dir / "test.sh").write_text(
+ '#!/bin/sh\nprintf \'{"reward":1}\' > /logs/verifier/reward.json\nprintf "verification complete\\n"\n',
+ encoding="utf-8",
+ )
+ verifier = Verifier(Task(task_dir), environment.trial_paths, environment)
+
+ async def verify():
+ await environment.start()
+ try:
+ return await verifier.verify()
+ finally:
+ await environment.stop(delete=False)
+
+ result = asyncio.run(verify())
+
+ assert result.rewards == {"reward": 1}
+ assert environment.trial_paths.reward_json_path.read_text(encoding="utf-8") == '{"reward":1}'
+ assert "verification complete" in environment.trial_paths.test_stdout_path.read_text(encoding="utf-8")
+
+
+def test_local_path_mount_detection_requires_matching_host_destination(
+ local_output_environment: SkillEvaluatorLocalEnvironment,
+ tmp_path: Path,
+) -> None:
+ environment = local_output_environment
+ logs = environment.trial_paths.agent_dir
+
+ assert environment.is_path_mounted("/logs/agent", logs)
+ assert environment.is_path_mounted(PurePosixPath("/logs/agent/session.jsonl"), logs / "session.jsonl")
+ assert not environment.is_path_mounted("/logs/agent", environment.trial_paths.verifier_dir)
+ assert not environment.is_path_mounted("/logs", environment.trial_paths.trial_dir)
+ assert not environment.is_path_mounted("/logs/agent-other", logs)
+ assert not environment.is_path_mounted("/etc/passwd", tmp_path / "passwd")
+
+
@pytest.mark.skipif(os.name == "nt", reason="Native Windows local mode is unsupported")
def test_verifier_python_keeps_virtualenv_dependencies(monkeypatch, tmp_path: Path) -> None:
"""Resolving the interpreter symlink loses the venv's installed dependencies."""
diff --git a/tests/test_harbor_local_mode.py b/tests/test_harbor_local_mode.py
index 96fbf265..6e548034 100644
--- a/tests/test_harbor_local_mode.py
+++ b/tests/test_harbor_local_mode.py
@@ -466,8 +466,11 @@ def test_registered_native_env_modes_are_supported_subset_of_pinned_harbor_relea
"cua-cloud",
"opensandbox",
"hf-sandbox",
+ "kernel",
"podman",
"prime",
+ "sail",
+ "sbx",
"smol",
}
@@ -1000,7 +1003,8 @@ def test_nvidia_build_codex_bridge_isolated_from_client_and_cleans_up(
**_kwargs: object,
) -> SimpleNamespace:
calls.append((command, dict(env or {})))
- return SimpleNamespace(return_code=0)
+ stdout = "CODEX_RUNTIME_ID 1000 1000\n" if "CODEX_RUNTIME_ID" in command else ""
+ return SimpleNamespace(return_code=0, stdout=stdout, stderr="")
async def root_exec(
_self: Codex,
@@ -1807,7 +1811,13 @@ def test_nested_background_shell_is_blocked_before_process_survives(tmp_path: Pa
@pytest.mark.skipif(os.name == "nt", reason=_NATIVE_WINDOWS_LOCAL_REASON)
@pytest.mark.parametrize(
- "name", ["SAFE_TASK_VALUE", "HARBOR_INSTRUCTION", "HARBOR_CLAUDE_CODE_INSTRUCTION_0123456789ABCDEF0123456789ABCDEF"]
+ "name",
+ [
+ "SAFE_TASK_VALUE",
+ "HARBOR_INSTRUCTION",
+ "HARBOR_CLAUDE_CODE_INSTRUCTION_0123456789ABCDEF0123456789ABCDEF",
+ "CLAUDE_CODE_INSTRUCTION_0123456789ABCDEF0123456789ABCDEF",
+ ],
)
def test_task_env_is_hidden_from_launcher_but_reaches_inner_command(tmp_path: Path, name: str) -> None:
environment = _local_environment(tmp_path)
@@ -1897,6 +1907,37 @@ def test_local_instruction_env_does_not_allow_unrecognized_harbor_values(tmp_pat
assert name not in environment._exec_env({name: "untrusted"})
+def test_local_claude_instruction_env_preserves_literal_prompt_paths(tmp_path: Path) -> None:
+ environment = _local_environment(tmp_path)
+ name = "CLAUDE_CODE_INSTRUCTION_0123456789ABCDEF0123456789ABCDEF"
+ instruction = 'Read /workspace/SKILL.md and /tests/test.sh; keep "quotes", $(printf literal), and π.\n'
+
+ child_env = environment._exec_env({name: instruction, "HOME": "/outside"})
+
+ assert child_env[name] == instruction
+ assert child_env["HOME"] == str(environment._home)
+
+
+ "name",
+ [
+ "CLAUDE_CODE_INSTRUCTION",
+ "CLAUDE_CODE_INSTRUCTION_",
+ "CLAUDE_CODE_INSTRUCTION_ABCDEF",
+ "CLAUDE_CODE_INSTRUCTION_" + "A" * 31,
+ "CLAUDE_CODE_INSTRUCTION_" + "A" * 33,
+ "CLAUDE_CODE_INSTRUCTION_" + "G" * 32,
+ "CLAUDE_CODE_INSTRUCTION_" + "a" * 32,
+ "CLAUDE_CODE_INSTRUCTION_" + "A" * 32 + "_PATH",
+ "CLAUDE_CODE_INSTRUCTION_" + "A" * 32 + "\n",
+ ],
+)
+def test_local_instruction_env_rejects_malformed_claude_channels(tmp_path: Path, name: str) -> None:
+ environment = _local_environment(tmp_path)
+
+ assert name not in environment._exec_env({name: "untrusted"})
+
+
@pytest.mark.skipif(os.name == "nt", reason=_NATIVE_WINDOWS_LOCAL_REASON)
@pytest.mark.parametrize("sandbox_mode", ["off", pytest.param("require", marks=pytest.mark.integration)])
def test_harbor_claude_run_delivers_instruction_to_local_cli(
@@ -1914,7 +1955,9 @@ def test_harbor_claude_run_delivers_instruction_to_local_cli(
monkeypatch.setenv("ANTHROPIC_API_KEY", "test-only")
monkeypatch.setenv("ANTHROPIC_BASE_URL", "https://provider.example/v1")
instruction = (
- "Explain argparse's nargs='?' in two lines.\nKeep \"quotes\", $(touch injected), `touch injected`, and π."
+ "Explain argparse's nargs='?' in two lines.\n"
+ "Keep /workspace/SKILL.md, /tests/test.sh, --permission-mode=bypassPermissions, "
+ '"quotes", $(touch injected), `touch injected`, and π.\n'
)
agent = SkillEvaluatorLocalClaudeCode(logs_dir=tmp_path / "agent", model_name="anthropic/test-model")
@@ -1927,7 +1970,8 @@ def test_harbor_claude_run_delivers_instruction_to_local_cli(
f"#!{sys.executable}\n"
"import json, os, sys\n"
"json.dump({'prompt': sys.stdin.read(), 'argv': sys.argv[1:], "
- "'instruction_env': [key for key in os.environ if key.startswith('HARBOR_') and '_INSTRUCTION_' in key]}, sys.stdout)\n",
+ "'instruction_env': [key for key in os.environ if key.startswith("
+ "('CLAUDE_CODE_INSTRUCTION_', 'claude_code_instruction_', 'HARBOR_CLAUDE_CODE_INSTRUCTION_'))]}, sys.stdout)\n",
encoding="utf-8",
)
cli.chmod(0o755)
diff --git a/tests/test_hermes_agent.py b/tests/test_hermes_agent.py
index 6d2790e9..03c54bac 100644
--- a/tests/test_hermes_agent.py
+++ b/tests/test_hermes_agent.py
@@ -18,6 +18,7 @@ import pytest
pytest.importorskip("harbor")
from harbor.agents.installed.base import NonZeroAgentExitCodeError
+from harbor.environments.capabilities import EnvironmentCapabilities
from harbor.models.agent.context import AgentContext
from harbor.models.task.task import Task
from harbor.models.trial.config import (
@@ -335,7 +336,9 @@ def test_harbor_trial_run_recovers_missing_hermes_session_as_execution_failure(t
download = TaskDownloadResult(path=task_dir, download_time_sec=0, cached=True)
def initialize_agent_environment(trial):
- trial.agent_environment = SimpleNamespace()
+ trial.agent_environment = SimpleNamespace(
+ capabilities=EnvironmentCapabilities(mounted=True, docker_compose=True),
+ )
async def no_prepare(_trial):
pass
@@ -364,6 +367,9 @@ def test_harbor_trial_run_recovers_missing_hermes_session_as_execution_failure(t
result = asyncio.run(trial.run())
assert result.exception_info is not None
+ assert result.exception_info.exception_type == "RuntimeError"
+ assert "Hermes produced no valid session trajectory" in result.exception_info.exception_message
+ assert result.agent_result is not None
assert result.agent_result.metadata == {"hermes_session_error": "missing_or_invalid_session"}
diff --git a/tests/test_oss_packaging.py b/tests/test_oss_packaging.py
index 147cddf8..975b9df3 100644
--- a/tests/test_oss_packaging.py
+++ b/tests/test_oss_packaging.py
@@ -155,7 +155,7 @@ def test_harbor_dependency_contract_keeps_base_install_isolated() -> None:
assert base_names.isdisjoint({"harbor", "litellm"})
assert len(harbor_requirements) == 1
assert harbor_requirements[0].extras == {"gke"}
- assert HARBOR_VERSION == "0.24.0"
+ assert HARBOR_VERSION == "0.25.0"
assert str(harbor_requirements[0].specifier) == f"=={HARBOR_VERSION}"
assert len(litellm_requirements) == 1
litellm_specifier = litellm_requirements[0].specifier
diff --git a/tests/test_tier3_public_runtime.py b/tests/test_tier3_public_runtime.py
index 762511c0..31bc9f52 100644
--- a/tests/test_tier3_public_runtime.py
+++ b/tests/test_tier3_public_runtime.py
@@ -191,7 +191,7 @@ def test_native_environment_kwargs_round_trip_through_real_harbor_parser() -> No
@pytest.mark.parametrize("env_mode", sorted(HARBOR_NATIVE_ENV_MODES - {"docker"}))
def test_native_environment_kwargs_reject_unknown_harbor_022_names(env_mode: str) -> None:
- with pytest.raises(ValueError, match=rf"Harbor 0\.24\.0 environment '{env_mode}'.*totally_ignored"):
+ with pytest.raises(ValueError, match=rf"Harbor 0\.25\.0 environment '{env_mode}'.*totally_ignored"):
build_harbor_run_command(
dataset_path="/tmp/dataset",
agent="codex",
@@ -576,9 +576,9 @@ def test_native_environment_required_kwargs_reject_whitespace_padded_ec2_launch_
def test_native_environment_install_hints_use_real_harbor_022_extra_names() -> None:
- assert "harbor[gke]==0.24.0" in _environment_extra_install_hint("ack")
- assert "harbor[cloud]==0.24.0" not in _environment_extra_install_hint("ack")
- assert "harbor[cwsandbox]==0.24.0" in _environment_extra_install_hint("wandb")
+ assert "harbor[gke]==0.25.0" in _environment_extra_install_hint("ack")
+ assert "harbor[cloud]==0.25.0" not in _environment_extra_install_hint("ack")
+ assert "harbor[cwsandbox]==0.25.0" in _environment_extra_install_hint("wandb")
assert "no Python extra" in _environment_extra_install_hint("openshift")
diff --git a/tests/tier3/test_gateway_codex.py b/tests/tier3/test_gateway_codex.py
index 352d063e..4ccce0bc 100644
--- a/tests/tier3/test_gateway_codex.py
+++ b/tests/tier3/test_gateway_codex.py
@@ -110,8 +110,9 @@ def test_selected_codex_launcher_preserves_provider_model_contract(
self.uploads = {}
async def exec(self, command, **kwargs):
- self.commands.append((command, kwargs.get("env") or {}))
- return ExecResult(return_code=0, stdout="", stderr="")
+ self.commands.append((command, kwargs.get("env") or {}, kwargs.get("user")))
+ stdout = "CODEX_RUNTIME_ID 1000 1001\n" if "CODEX_RUNTIME_ID" in command else ""
+ return ExecResult(return_code=0, stdout=stdout, stderr="")
async def upload_file(self, source_path, target_path):
self.uploads[str(target_path)] = Path(source_path).read_text(encoding="utf-8")
@@ -127,7 +128,20 @@ def test_selected_codex_launcher_preserves_provider_model_contract(
assert configs[0]["model_provider"] == "openai_compatible"
assert configs[0]["model_providers"]["openai_compatible"]["base_url"] == base_url
- launchers = [(text, env) for text, env in environment.commands if "codex exec " in text]
+ identities = [(text, user) for text, _env, user in environment.commands if "CODEX_RUNTIME_ID" in text]
+ assert len(identities) == 1
+ assert "$(id -u)" in identities[0][0]
+ assert "$(id -g)" in identities[0][0]
+ assert identities[0][1] is None
+ expected_home = "/logs/agent/codex-home" if mode == "local" else "/installed-agent/codex-home"
+ private_dirs = [(text, user) for text, _env, user in environment.commands if "chown -R" in text]
+ assert len(private_dirs) == 1
+ private_dir_command, private_dir_user = private_dirs[0]
+ assert private_dir_user == "root"
+ assert private_dir_command.endswith(
+ f"mkdir -p {expected_home} && chown -R 1000:1001 {expected_home} && chmod 700 {expected_home}"
+ )
+ launchers = [(text, env) for text, env, _user in environment.commands if "codex exec " in text]
assert len(launchers) == 1
launcher, launch_env = launchers[0]
argv = shlex.split(launcher)
diff --git a/tests/tier3/test_harbor_local_agents.py b/tests/tier3/test_harbor_local_agents.py
index f067104c..e87d6292 100644
--- a/tests/tier3/test_harbor_local_agents.py
+++ b/tests/tier3/test_harbor_local_agents.py
@@ -15,15 +15,16 @@ import pytest
pytest.importorskip("harbor")
from harbor.agents.installed.base import NonZeroAgentExitCodeError
-from harbor.agents.installed.codex import Codex
from harbor.environments.base import BaseEnvironment, ExecResult
from harbor.models.task.config import EnvironmentConfig, MCPServerConfig
from harbor.models.trial.paths import EnvironmentPaths, TrialPaths
from skillevaluator.tier3.harbor.local_agents import (
SkillEvaluatorClaudeCode,
+ SkillEvaluatorGatewayCodex,
SkillEvaluatorLocalClaudeCode,
SkillEvaluatorLocalCodex,
+ SkillEvaluatorLocalNvidiaBuildCodex,
SkillEvaluatorLocalOpenCode,
SkillEvaluatorNvidiaBuildClaudeCode,
SkillEvaluatorNvidiaBuildCodex,
@@ -35,6 +36,12 @@ class _RecordingEnvironment:
def __init__(self) -> None:
self.uploads: list[tuple[str, str]] = []
+ self.root_commands: list[str] = []
+
+ async def exec(self, command: str, *, user: str | None = None, **_kwargs: object) -> ExecResult:
+ assert user == "root"
+ self.root_commands.append(command)
+ return ExecResult(return_code=0, stdout="", stderr="")
async def upload_file(self, source: object, destination: object) -> None:
self.uploads.append((str(destination), Path(source).read_text(encoding="utf-8")))
@@ -140,7 +147,8 @@ def _record_installed_agent_exec(monkeypatch: pytest.MonkeyPatch) -> list[tuple[
**_kwargs: object,
) -> SimpleNamespace:
calls.append((command, dict(env or {})))
- return SimpleNamespace(return_code=0, stdout="", stderr="")
+ stdout = "CODEX_RUNTIME_ID 1000 1000\n" if "CODEX_RUNTIME_ID" in command else ""
+ return SimpleNamespace(return_code=0, stdout=stdout, stderr="")
monkeypatch.setattr(
"harbor.agents.installed.base.BaseInstalledAgent.exec_as_agent",
@@ -172,10 +180,11 @@ def test_local_codex_uploads_openai_responses_config_and_creates_per_trial_state
asyncio.run(agent.run("do the thing", environment=environment, context=object()))
- setup_command, setup_env = calls[0]
+ setup_command, setup_env = next((command, env) for command, env in calls if 'mkdir -p "$CODEX_HOME"' in command)
assert 'mkdir -p "$CODEX_HOME"' in setup_command
assert SkillEvaluatorLocalCodex._REMOTE_CODEX_SECRETS_DIR.as_posix() in setup_command
assert setup_env["CODEX_HOME"] == SkillEvaluatorLocalCodex._REMOTE_CODEX_HOME.as_posix()
+ assert any("chown -R 1000:1000" in command and "chmod 700" in command for command in environment.root_commands)
config = environment.last_codex_config(SkillEvaluatorLocalCodex._REMOTE_CODEX_HOME)
assert config["model_provider"] == "openai_compatible"
assert config["model_providers"] == {
@@ -296,6 +305,50 @@ def test_local_codex_runtime_provider_fields_win_without_losing_unrelated_user_c
}
[email protected]("agent_type", [SkillEvaluatorGatewayCodex, SkillEvaluatorLocalCodex])
+def test_gateway_codex_active_provider_uses_the_selected_launch_credential(
+ monkeypatch: pytest.MonkeyPatch,
+ tmp_path: Path,
+ agent_type: type[SkillEvaluatorGatewayCodex],
+) -> None:
+ calls = _record_installed_agent_exec(monkeypatch)
+ monkeypatch.delenv("CODEX_AUTH_JSON_PATH", raising=False)
+ monkeypatch.delenv("CODEX_FORCE_AUTH_JSON", raising=False)
+ environment = _RecordingEnvironment()
+ original_provider = {
+ "base_url": "https://original.example/v1",
+ "env_key": "USER_API_KEY",
+ "http_headers": {"X-User": "preserved"},
+ }
+ unrelated_provider = {"base_url": "https://unrelated.example/v1", "env_key": "UNRELATED_API_KEY"}
+ agent = agent_type(
+ logs_dir=tmp_path,
+ model_name="openai/vendor/model",
+ extra_env={"OPENAI_API_KEY": "selected-test-key", "OPENAI_BASE_URL": "https://gateway.example/v1"},
+ config={
+ "model_provider": "user-provider",
+ "model_providers": {"user-provider": original_provider, "unrelated-provider": unrelated_provider},
+ "mcp_servers": {"user-tools": {"url": "https://user-tools.example/mcp"}},
+ },
+ mcp_servers=[MCPServerConfig(name="task-tools", transport="stdio", command="python3", args=["-m", "tools"])],
+ )
+
+ asyncio.run(agent.run("do the thing", environment=environment, context=object()))
+
+ config = environment.last_codex_config(agent._REMOTE_CODEX_HOME)
+ active_provider = config["model_providers"][config["model_provider"]]
+ run_env = next(env for command, env in calls if "codex exec" in command)
+ assert run_env[active_provider["env_key"]] == "selected-test-key"
+ assert active_provider["base_url"] == "https://gateway.example/v1"
+ assert active_provider["wire_api"] == "responses"
+ assert config["model_providers"]["user-provider"] == original_provider
+ assert config["model_providers"]["unrelated-provider"] == unrelated_provider
+ assert config["mcp_servers"] == {
+ "user-tools": {"url": "https://user-tools.example/mcp"},
+ "task-tools": {"command": "python3", "args": ["-m", "tools"]},
+ }
+
+
def test_local_codex_rewrites_upstream_tmp_secrets_dir(monkeypatch, tmp_path) -> None:
captured: dict[str, str] = {}
@@ -367,9 +420,7 @@ def test_local_claude_does_not_rewrite_instruction_permission_text(monkeypatch,
)
run_command, run_env = next((command, env) for command, env in calls if "claude --verbose" in command)
- instruction_vars = {
- key: value for key, value in run_env.items() if key.startswith("HARBOR_") and "_INSTRUCTION_" in key
- }
+ instruction_vars = {key: value for key, value in run_env.items() if key.startswith("CLAUDE_CODE_INSTRUCTION_")}
assert instruction_vars and list(instruction_vars.values()) == [instruction]
assert next(iter(instruction_vars.values())).encode() == instruction.encode()
assert "--permission-mode=auto" in run_command
@@ -455,14 +506,17 @@ def test_local_install_rejects_a_cli_too_old_for_the_model(
assert "--env-mode docker" in str(excinfo.value)
[email protected]("agent_type", [SkillEvaluatorNvidiaBuildCodex, SkillEvaluatorLocalNvidiaBuildCodex])
def test_nvidia_build_codex_final_config_keeps_dynamic_bridge_over_user_and_runtime_values(
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,
+ agent_type: type[SkillEvaluatorNvidiaBuildCodex],
) -> None:
calls = _record_installed_agent_exec(monkeypatch)
environment = _RecordingEnvironment()
bridge_origin = "http://127.0.0.1:43123"
- agent = SkillEvaluatorNvidiaBuildCodex(
+ original_provider = {"base_url": "https://original.example/v1", "env_key": "USER_API_KEY"}
+ agent = agent_type(
logs_dir=tmp_path,
model_name="nvidia/meta/llama-3.1-8b-instruct",
extra_env={
@@ -474,10 +528,11 @@ def test_nvidia_build_codex_final_config_keeps_dynamic_bridge_over_user_and_runt
"openai_base_url": "https://user-must-not-win.example/v1",
"model_provider": "user-provider",
"model_providers": {
+ "user-provider": original_provider,
"openai_compatible": {
"base_url": "https://user-must-not-win.example/v1",
"http_headers": {"X-User": "preserved"},
- }
+ },
},
"mcp_servers": {"user-tools": {"url": "https://user-tools.example/mcp"}},
},
@@ -498,11 +553,12 @@ def test_nvidia_build_codex_final_config_keeps_dynamic_bridge_over_user_and_runt
asyncio.run(agent.run("do the thing", environment=environment, context=object()))
- config = environment.last_codex_config(Codex._REMOTE_CODEX_HOME)
+ config = environment.last_codex_config(agent._REMOTE_CODEX_HOME)
assert config["approval_policy"] == "never"
assert config["mcp_servers"] == {"user-tools": {"url": "https://user-tools.example/mcp"}}
assert config["model_provider"] == "openai_compatible"
assert config["openai_base_url"] == f"{bridge_origin}/v1"
+ assert config["model_providers"]["user-provider"] == original_provider
assert config["model_providers"]["openai_compatible"] == {
"name": "OpenAI-compatible provider",
"base_url": f"{bridge_origin}/v1",
@@ -513,6 +569,7 @@ def test_nvidia_build_codex_final_config_keeps_dynamic_bridge_over_user_and_runt
run_command, run_env = next((command, env) for command, env in calls if "codex exec" in command)
assert "--model nvidia/meta/llama-3.1-8b-instruct " in run_command
assert run_env["OPENAI_API_KEY"] == "bridge-client-token"
+ assert run_env[config["model_providers"]["openai_compatible"]["env_key"]] == "bridge-client-token"
assert "OPENAI_BASE_URL" not in run_env
assert "external-key" not in run_command
@@ -1060,7 +1117,7 @@ def test_claude_code_vertex_model_connection_and_auth_env(
conn = agent.model_connection
assert conn.provider is None
assert conn.api_key is None
- assert conn.configured_base_url is None
+ assert conn.candidate_base_url is None
assert agent._resolved_model_name() == "claude-sonnet-4-6"
auth_env = agent._resolve_auth_env()
@@ -1111,4 +1168,3 @@ def test_claude_code_vertex_exec_as_agent_unsets_anthropic_vars(
)
asyncio.run(direct_agent.exec_as_agent(object(), "claude --version"))
assert captured[-1] == "claude --version"
-
diff --git a/uv.lock b/uv.lock
index 74a71297..046fc17f 100644
--- a/uv.lock
+++ b/uv.lock
@@ -841,9 +841,10 @@ wheels = [
[[package]]
name = "harbor"
-version = "0.24.0"
+version = "0.25.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
+ { name = "certifi" },
{ name = "dirhash" },
{ name = "fastapi" },
{ name = "filelock" },
@@ -868,9 +869,9 @@ dependencies = [
{ name = "typer" },
{ name = "uvicorn" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/82/7d/16e21cfd52938260dce71ff77ec1ed156bd8c327642760fe66163b0cd3ce/harbor-0.24.0.tar.gz", hash = "sha256:6c5185e6a76abc677ed3f95e688dc0dbf8597e4fa50847cb9a37a4448c91b1e5", size = 2090577, upload-time = "2026-10-05T05:04:46.252Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/b5/8f/624ed4b2763565d50c78e9278d2800037c9147d56ee977d3b8ed6c5b81b1/harbor-0.25.0.tar.gz", hash = "sha256:a66543a223539cd853889ee0eea77d15a3e5222963418a87c0f079b63dadb4b2", size = 2309418, upload-time = "2026-10-25T20:27:27.643Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/9e/63/0e3d788e8d1ed116125507c6a01e3fb95cf82be71f2ea7040a1458709d21/harbor-0.24.0-py3-none-any.whl", hash = "sha256:23b7ba616a3aae4eff561ced5e2c51c7186f2981e53a770dea9c689d3969877c", size = 2331740, upload-time = "2026-10-05T05:04:42.088Z" },
+ { url = "https://files.pythonhosted.org/packages/90/72/2ead84b6d43e4737682dd489b107be9d828bf5ae4869d0d4f2aa72243149/harbor-0.25.0-py3-none-any.whl", hash = "sha256:51923ac567fc57b03279e93468b105f689628bcac2cd3d541d4e44aa5c0ec309", size = 2535481, upload-time = "2026-10-25T20:27:25.575Z" },
]
[package.optional-dependencies]
@@ -2634,7 +2635,7 @@ requires-dist = [
{ name = "boto3", marker = "extra == 'llm'", specifier = ">=1.34.0" },
{ name = "build", marker = "extra == 'dev'", specifier = ">=1.2" },
{ name = "click", specifier = ">=8.3.3,<9" },
- { name = "harbor", extras = ["gke"], marker = "extra == 'tier3'", specifier = "==0.24.0" },
+ { name = "harbor", extras = ["gke"], marker = "extra == 'tier3'", specifier = "==0.25.0" },
{ name = "httpx", marker = "extra == 'dev'", specifier = ">=0.27" },
{ name = "idna", specifier = ">=3.10,<4" },
{ name = "jinja2", specifier = ">=3.1" },