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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,22 @@ All notable changes to SkillEvaluator are documented in this file.
- PII findings clarify that required author attribution is accepted while
duplicate contact addresses need removal, replacement, or a reviewed waiver.

- Docker OpenCode containers no longer get the distribution `nodejs` and
`npm` packages from agent setup, except on Alpine images, and generated
images now include `procps`. Before, OpenCode, the default agent with NVIDIA
Build, installed Debian's Node.js and npm with `apt-get` in every trial and
then its own Node.js with nvm, and Claude Code installed `procps` (for
`pgrep`) in every trial. Both took time from the 360-second agent setup
timeout, and a package mirror error failed the trial. Like Claude Code and
Codex containers since 0.6.0, OpenCode containers on Debian-based images now
have no `gcc`, `g++`, or `make`, and OpenCode's Node.js is on `PATH` only for
the OpenCode process and the commands it runs, including its stdio MCP
servers. Skills whose scripts, tasks, or verifier need these tools, or whose
stdio MCP servers need `gcc`, `g++`, or `make`, must install them through
`scripts/apt-packages.txt` or a custom `evals/environment/Dockerfile`.
Generated images rebuild once for the new package list: the per-task images,
or the shared base image when `harbor.base_image_mode` is `reuse`.

- A `tier3 evaluate --skip-with-skill` run with two or more agents now records
the dataset-size status in `result.json` and the `tier3 evaluate` summary. It
is taken from the agent with the best baseline score, as in the reports.
Expand Down
24 changes: 18 additions & 6 deletions docs/eval-datasets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,28 @@ transport = "stdio"
```

<Note>
In Docker mode, Claude Code and Codex setup no longer installs the
In Docker mode, Claude Code, Codex, and OpenCode setup no longer installs the
distribution `nodejs` and `npm` packages, except on Alpine images. On
Debian-based images, including the default `python:3.12-slim` image, those
packages also brought `npx` and a C/C++ toolchain (`gcc`, `g++`, `make`).
Claude Code containers now have no Node.js unless the image provides it.
Codex installs its own Node.js, which is on `PATH` only for the Codex process
and the commands it runs. If your skill's scripts, its tasks, or a stdio MCP
server (for example `command = "npx ..."`) need these tools, install them in
the image: list the packages in `scripts/apt-packages.txt`, one per line, for
the auto-generated image, or install them in `evals/environment/Dockerfile`.
Codex and OpenCode install their own Node.js with nvm. Its `node`, `npm`, and
`npx` are on `PATH` only for the agent process and the commands it runs,
including stdio MCP servers, not for the verifier (`test.sh`) or task
healthchecks. If your skill's scripts, its tasks, or the verifier need these
tools, or a stdio MCP server does (Node.js with Claude Code, for example
`command = "npx ..."`, or `gcc`, `g++`, or `make` with any agent), install
them in the image: list the packages in `scripts/apt-packages.txt`, one per
line, for the auto-generated image, or install them in
`evals/environment/Dockerfile`.

The auto-generated image and the `init-harbor-task` starter Dockerfile also
include `procps`, so Claude Code setup no longer installs it (for `pgrep`)
with `apt-get` in every trial. A custom `evals/environment/Dockerfile` keeps
its own base image, so it should install `procps` too, unless
`harbor.base_image_mode` is `reuse` or `rebuild` and
`harbor.custom_dockerfile_mode` is `rebase`. Then it is rebased onto the
shared base image, which has `procps`.
</Note>

```text title="my-skill/scripts/apt-packages.txt"
Expand Down
2 changes: 1 addition & 1 deletion src/skillevaluator/tier3/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def init_harbor_task(
"""FROM python:3.12-slim

RUN apt-get -o Acquire::Retries=3 update && \\
apt-get -o Acquire::Retries=3 install -y --no-install-recommends bash curl git jq ripgrep && \\
apt-get -o Acquire::Retries=3 install -y --no-install-recommends bash curl git jq procps ripgrep && \\
rm -rf /var/lib/apt/lists/*

RUN mkdir -p /workspace/skills /logs/agent /logs/verifier
Expand Down
4 changes: 3 additions & 1 deletion src/skillevaluator/tier3/harbor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@
LOCAL_CODEX_SECRETS_DIRNAME = "codex-secrets"

# Docker wrappers retain Harbor's installers while avoiding redundant Node/npm
# packages on the branches that bootstrap their own runtime. Claude Code uses the
# packages on the branches that bootstrap their own runtime. Codex and OpenCode
# install their own Node with NVM on glibc images. Claude Code uses the
# container wrapper, which builds on that installer fix and adds Vertex AI
# routing and rich MCP server declarations.
DOCKER_AGENT_IMPORT_PATHS = {
"codex": "skillevaluator.tier3.harbor.installed_agents:SkillEvaluatorCodex",
"opencode": "skillevaluator.tier3.harbor.installed_agents:SkillEvaluatorOpenCode",
"claude-code": CONTAINER_AGENT_IMPORT_PATHS["claude-code"],
"hermes": "skillevaluator.tier3.harbor.hermes_agent:SkillEvaluatorHermes",
}
Expand Down
16 changes: 11 additions & 5 deletions src/skillevaluator/tier3/harbor/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
_EVAL_CORE_DIR.parent.parent / "evidence.py",
)
_EVALUATOR_TESTS_SUBDIR = "skill_evaluator"
# Harbor's agent setup checks each prerequisite command (curl, bash, pgrep, rg,
# stdbuf) in every trial and apt-installs the missing ones. Claude Code's setup
# needs pgrep, so procps in every generated image removes that per-trial apt
# step and its package mirror dependency. The starter Dockerfile that
# `tier3 init-harbor-task` writes (tier3/commands.py) lists the same packages.
_BASE_APT_PACKAGES = "bash curl git jq procps ripgrep"
_BASE_IMAGE_PREFIX = "skillevaluator-base"
# Compose 2 treats HEALTHCHECK NONE as a configured check, then fails its
# readiness wait because Docker supplies no health state. Replace authored
Expand Down Expand Up @@ -1535,7 +1541,7 @@ def build_eval_base_image(
"",
"RUN apt-get -o Acquire::Retries=3 update && \\",
" apt-get -o Acquire::Retries=3 install -y --no-install-recommends \\",
" bash curl git jq ripgrep \\",
f" {_BASE_APT_PACKAGES} \\",
]
if extra_apt:
lines[-1] += " \\"
Expand Down Expand Up @@ -3932,8 +3938,8 @@ def _rebase_custom_dockerfile_content(
) -> tuple[str, str]:
"""Return custom Dockerfile content layered on top of the eval base image.

The base image already contains: python:3.12-slim, system packages
(bash/curl/git/jq), verifier dependencies, and the
The base image already contains: python:3.12-slim, the system packages in
``_BASE_APT_PACKAGES``, verifier dependencies, and the
standard directory structure (/workspace/skills, /logs, etc.).

The custom Dockerfile's FROM line is replaced so the skill author's
Expand Down Expand Up @@ -4367,7 +4373,7 @@ def _write_dockerfile(
"",
"RUN apt-get -o Acquire::Retries=3 update && \\",
" apt-get -o Acquire::Retries=3 install -y --no-install-recommends \\",
" bash curl git jq ripgrep \\",
f" {_BASE_APT_PACKAGES} \\",
]
if apt_pkgs:
dockerfile_lines[-1] += " \\"
Expand Down Expand Up @@ -4503,7 +4509,7 @@ def _write_default_environment_dockerfile(
"",
"RUN apt-get -o Acquire::Retries=3 update && \\",
" apt-get -o Acquire::Retries=3 install -y --no-install-recommends \\",
" bash curl git jq ripgrep \\",
f" {_BASE_APT_PACKAGES} \\",
]
if apt_pkgs:
dockerfile_lines[-1] += " \\"
Expand Down
29 changes: 25 additions & 4 deletions src/skillevaluator/tier3/harbor/installed_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

"""Keep Harbor's bootstrap dependencies aligned with its installer branches.

The wrappers also retry a failed agent CLI install, since a dropped download or
a package mirror error otherwise fails the trial before the agent starts.
The Claude Code, Codex and OpenCode wrappers request distribution Node/npm only
on the installer branch that uses it. The Claude Code and Codex wrappers also
retry a failed agent CLI install, since a dropped download or a package mirror
error otherwise fails the trial before the agent starts.
"""

from __future__ import annotations
Expand All @@ -17,6 +19,7 @@
from harbor.agents.installed.base import NonZeroAgentExitCodeError
from harbor.agents.installed.claude_code import ClaudeCode
from harbor.agents.installed.codex import Codex
from harbor.agents.installed.opencode import OpenCode

from skillevaluator.utils.redaction import redact_sensitive_text

Expand Down Expand Up @@ -113,8 +116,8 @@ async def _installer_dependencies(
return dependencies

# Match the pinned Harbor installer's branch before removing prerequisites.
# Codex supplies Node via NVM on glibc; Claude's native installer needs no
# Node. Both still need system npm on their respective fallback branches.
# Codex and OpenCode supply Node via NVM on glibc; Claude's native installer
# needs no Node. All three still need system npm on their fallback branches.
result = await environment.exec(
command=(
f"if {system_npm_predicate}; then printf '%s' system; "
Expand Down Expand Up @@ -170,3 +173,21 @@ async def ensure_system_dependencies(
system_npm_predicate="command -v apk >/dev/null 2>&1",
)
await super().ensure_system_dependencies(environment, dependencies)


class SkillEvaluatorOpenCode(OpenCode):
"""Avoid a redundant distribution Node/npm install before Harbor's NVM."""

async def ensure_system_dependencies(
self,
environment: BaseEnvironment,
dependencies: tuple[str, ...],
) -> None:
# The predicate is the one Harbor's OpenCode install uses to choose
# between distribution Node (musl) and NVM (glibc).
dependencies = await _installer_dependencies(
environment,
dependencies,
system_npm_predicate="ldd --version 2>&1 | grep -qi musl || [ -f /etc/alpine-release ]",
)
await super().ensure_system_dependencies(environment, dependencies)
4 changes: 2 additions & 2 deletions src/skillevaluator/tier3/harbor/local_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from skillevaluator.provider_config import is_claude_5_5_or_later, is_gpt6_model
from skillevaluator.tier3.harbor import LOCAL_CODEX_HOME_DIRNAME, LOCAL_CODEX_SECRETS_DIRNAME
from skillevaluator.tier3.harbor.installed_agents import SkillEvaluatorClaudeCode as _InstalledClaudeCode
from skillevaluator.tier3.harbor.installed_agents import SkillEvaluatorCodex
from skillevaluator.tier3.harbor.installed_agents import SkillEvaluatorCodex, SkillEvaluatorOpenCode
from skillevaluator.tier3.harbor.nvidia_build_bridge import (
MAX_REQUESTS_PER_BRIDGE,
RunningBridge,
Expand Down Expand Up @@ -499,7 +499,7 @@ async def exec_as_agent(
return await super().exec_as_agent(environment, command=command, env=env, cwd=cwd, timeout_sec=timeout_sec)


class SkillEvaluatorGatewayOpenCode(OpenCode):
class SkillEvaluatorGatewayOpenCode(SkillEvaluatorOpenCode):
"""Use Chat Completions for an explicitly OpenAI-compatible gateway."""

def __init__(self, *args: Any, **kwargs: Any) -> None:
Expand Down
9 changes: 9 additions & 0 deletions src/skillevaluator/tier3/harbor/native_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
SkillEvaluatorLocalOpenCode,
SkillEvaluatorNvidiaBuildClaudeCode,
SkillEvaluatorNvidiaBuildCodex,
SkillEvaluatorOpenCode,
)
from skillevaluator.tier3.plugin_native import SETUP_SCRIPT, ClaudeCodeAdapter, OpenCodeAdapter

Expand Down Expand Up @@ -283,6 +284,10 @@ class NativeOpenCode(_NativeOpenCodeMixin, OpenCode):
"""OpenCode with ``OPENCODE_CONFIG`` and ``OPENCODE_CONFIG_DIR`` pointing at the staged plugin."""


class NativeInstalledOpenCode(_NativeOpenCodeMixin, SkillEvaluatorOpenCode):
"""Installer-aware OpenCode (the Docker-engine baselines' wrapper) with the staged plugin config."""


class NativeGatewayOpenCode(_NativeOpenCodeMixin, SkillEvaluatorGatewayOpenCode):
"""Gateway-routed OpenCode with the staged plugin config."""

Expand Down Expand Up @@ -329,6 +334,10 @@ class PrivateOpenCode(SetupNetworkErrorAgent, OpenCode):
"""Stock OpenCode with setup-only network error classification."""


class PrivateInstalledOpenCode(SetupNetworkErrorAgent, SkillEvaluatorOpenCode):
"""Installer-aware OpenCode with setup-only network error classification."""


class PrivateGatewayOpenCode(SetupNetworkErrorAgent, SkillEvaluatorGatewayOpenCode):
"""Gateway OpenCode with setup-only network error classification."""

Expand Down
6 changes: 6 additions & 0 deletions src/skillevaluator/tier3/plugin_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,12 @@ def resolve_plugin_load(
("codex", f"{_LOCAL_AGENTS}:SkillEvaluatorGatewayCodex"): f"{_NATIVE_AGENTS}:NativeGatewayCodex",
("codex", f"{_LOCAL_AGENTS}:SkillEvaluatorNvidiaBuildCodex"): f"{_NATIVE_AGENTS}:NativeNvidiaBuildCodex",
("opencode", None): f"{_NATIVE_AGENTS}:NativeOpenCode",
# The installer-aware OpenCode wrapper the Docker-engine baselines run; GKE and
# Harbor-native cloud baselines keep the stock agent above.
(
"opencode",
"skillevaluator.tier3.harbor.installed_agents:SkillEvaluatorOpenCode",
): f"{_NATIVE_AGENTS}:NativeInstalledOpenCode",
("opencode", f"{_LOCAL_AGENTS}:SkillEvaluatorGatewayOpenCode"): f"{_NATIVE_AGENTS}:NativeGatewayOpenCode",
("hermes", None): f"{_NATIVE_AGENTS}:NativeHermes",
(
Expand Down
3 changes: 2 additions & 1 deletion tests/test_harbor_secure_docker_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from harbor.models.task.config import EnvironmentConfig
from harbor.models.trial.paths import TrialPaths

from skillevaluator.tier3.harbor import DOCKER_AGENT_IMPORT_PATHS
from skillevaluator.tier3.harbor import stream_redaction as stream_redaction_module
from skillevaluator.tier3.harbor.adapter import generate_harbor_tasks
from skillevaluator.tier3.harbor.runner import build_harbor_run_command
Expand Down Expand Up @@ -1601,7 +1602,7 @@ def test_docker_command_uses_secure_environment_import_path() -> None:

assert "--agent-import-path" not in command
assert "--environment-import-path" not in command
assert command[command.index("--agent") + 1] == "opencode"
assert command[command.index("--agent") + 1] == DOCKER_AGENT_IMPORT_PATHS["opencode"]
assert command[command.index("--env") + 1] == SECURE_DOCKER_ENV_IMPORT_PATH


Expand Down
Loading
Loading