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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,23 @@ All notable changes to SkillEvaluator are documented in this file.
without rerunning the scan. The version is shown even when the report omits
its timestamp.

### Changed

- Docker Claude Code and Codex containers no longer get the distribution
`nodejs` and `npm` packages from agent setup, except on Alpine images. On
Debian-based images, including the default eval image, those packages also
provided `npx`, `gcc`, `g++`, and `make`. Claude Code containers now have no
Node.js unless the image provides it, and Codex's own Node.js is on `PATH`
only for the Codex process. Skills whose scripts, tasks, or stdio MCP servers
need these tools must install them through `scripts/apt-packages.txt` or a
custom `evals/environment/Dockerfile`.

### Fixed

- Fixed Docker Codex and Claude Code setup wasting its timeout installing
distribution Node/npm before Harbor's own installers. Native, gateway Codex,
and NVIDIA Build agents now provision Node/npm only on the installer branches
that need them, while preserving installed-agent and version-pin checks.
- Preserved multiline skill descriptions when saving and loading Tier 2
embedding catalogs. Descriptions can contain line breaks and tabs, while
catalog identifiers and other control characters remain strictly validated.
Expand Down
19 changes: 19 additions & 0 deletions docs/eval-datasets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,25 @@ command = "python /workspace/tools/server.py"
transport = "stdio"
```

<Note>
In Docker mode, Claude Code and Codex 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`.
</Note>

```text title="my-skill/scripts/apt-packages.txt"
nodejs
npm
build-essential
```

## Validate before you run

Check the whole contract — dataset fields, case IDs, `config.yml`, Dockerfile
Expand Down
8 changes: 8 additions & 0 deletions src/skillevaluator/tier3/harbor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
"opencode": "skillevaluator.tier3.harbor.local_agents:SkillEvaluatorLocalOpenCode",
}

# Docker wrappers retain Harbor's installers while avoiding redundant Node/npm
# packages on the branches that bootstrap their own runtime.
DOCKER_AGENT_IMPORT_PATHS = {
"codex": "skillevaluator.tier3.harbor.installed_agents:SkillEvaluatorCodex",
"claude-code": "skillevaluator.tier3.harbor.installed_agents:SkillEvaluatorClaudeCode",
}

HARBOR_AGENTS_SUPPORTED = frozenset(
{
"claude-code",
Expand Down Expand Up @@ -61,6 +68,7 @@ def canonical_agent_name(agent: str) -> str:
"AGENT_ALIASES",
"DEFAULT_ENV_MODE",
"DEFAULT_LLM_VERIFIER_TIMEOUT_SEC",
"DOCKER_AGENT_IMPORT_PATHS",
"ENV_MODE_LOCAL",
"HARBOR_AGENTS",
"HARBOR_AGENTS_EXPERIMENTAL",
Expand Down
82 changes: 82 additions & 0 deletions src/skillevaluator/tier3/harbor/installed_agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

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

from __future__ import annotations

from typing import TYPE_CHECKING

from harbor.agents.installed.claude_code import ClaudeCode
from harbor.agents.installed.codex import Codex

if TYPE_CHECKING:
from harbor.environments.base import BaseEnvironment

# Harbor's installers download over HTTPS but never request a CA bundle; apt
# images used to get one only as a dependency of the skipped npm package.
_CA_BUNDLE_PREDICATE = "[ -s /etc/ssl/certs/ca-certificates.crt ] || [ -s /etc/pki/tls/certs/ca-bundle.crt ]"
_INSTALLER_BRANCHES = frozenset({"system", "bundled", "bundled-without-ca"})


async def _installer_dependencies(
environment: BaseEnvironment,
dependencies: tuple[str, ...],
*,
system_npm_predicate: str,
) -> tuple[str, ...]:
if not {"nodejs", "npm"}.intersection(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.
result = await environment.exec(
command=(
f"if {system_npm_predicate}; then printf '%s' system; "
f"elif {_CA_BUNDLE_PREDICATE}; then printf '%s' bundled; "
"else printf '%s' bundled-without-ca; fi"
),
user="root",
)
installer = (result.stdout or "").strip()
if result.return_code != 0 or installer not in _INSTALLER_BRANCHES:
raise RuntimeError("Could not determine agent installer system dependency requirements")
if installer == "system":
return dependencies
bundled = tuple(dependency for dependency in dependencies if dependency not in {"nodejs", "npm"})
if installer == "bundled-without-ca":
return (*bundled, "ca_certificates")
return bundled


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

async def ensure_system_dependencies(
self,
environment: BaseEnvironment,
dependencies: tuple[str, ...],
) -> None:
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)


class SkillEvaluatorClaudeCode(ClaudeCode):
"""Avoid distribution Node/npm for Harbor's native Claude installer."""
Comment thread
rng1995 marked this conversation as resolved.
Resolved

async def ensure_system_dependencies(
self,
environment: BaseEnvironment,
dependencies: tuple[str, ...],
) -> None:
dependencies = await _installer_dependencies(
environment,
dependencies,
system_npm_predicate="command -v apk >/dev/null 2>&1",
)
await super().ensure_system_dependencies(environment, dependencies)
8 changes: 4 additions & 4 deletions src/skillevaluator/tier3/harbor/local_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

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 harbor.models.trial.paths import EnvironmentPaths

from skillevaluator.tier3.harbor.installed_agents import SkillEvaluatorClaudeCode, SkillEvaluatorCodex
from skillevaluator.tier3.harbor.nvidia_build_bridge import (
MAX_REQUESTS_PER_BRIDGE,
RunningBridge,
Expand Down Expand Up @@ -148,7 +148,7 @@ async def exec_as_agent(
)


class SkillEvaluatorGatewayCodex(Codex):
class SkillEvaluatorGatewayCodex(SkillEvaluatorCodex):
"""Use an explicit Responses gateway without truncating its catalog model ID."""

def _build_effective_config(self, openai_base_url: str | None = None) -> dict[str, Any]:
Expand Down Expand Up @@ -668,7 +668,7 @@ async def run(self, instruction, environment: BaseEnvironment, context) -> None:
raise


class SkillEvaluatorNvidiaBuildCodex(_NvidiaBuildBridgeAgent, Codex):
class SkillEvaluatorNvidiaBuildCodex(_NvidiaBuildBridgeAgent, SkillEvaluatorCodex):
"""Stock Codex CLI routed through the in-trial NVIDIA Build bridge."""

_BRIDGE_CLIENT_ENV_UNSET = ("NVIDIA_API_KEY", "OPENAI_BASE_URL", "OPENAI_API_BASE")
Expand Down Expand Up @@ -714,7 +714,7 @@ def replace(match: re.Match[str]) -> str:
return _rewrite_launcher_segment(command, lambda text: _CODEX_MODEL_ARG_RE.sub(replace, text))


class SkillEvaluatorNvidiaBuildClaudeCode(_NvidiaBuildBridgeAgent, ClaudeCode):
class SkillEvaluatorNvidiaBuildClaudeCode(_NvidiaBuildBridgeAgent, SkillEvaluatorClaudeCode):
"""Stock Claude Code CLI routed through the in-trial NVIDIA Build bridge."""

def _bridge_client_environment(self) -> dict[str, str]:
Expand Down
7 changes: 3 additions & 4 deletions src/skillevaluator/tier3/harbor/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,10 +1263,9 @@ def build_harbor_run_command(
]
)
elif env_mode == "docker":
if agent_import_path:
command.extend(["--agent", agent_import_path])
else:
command.extend(["--agent", agent])
from skillevaluator.tier3.harbor import DOCKER_AGENT_IMPORT_PATHS

command.extend(["--agent", agent_import_path or DOCKER_AGENT_IMPORT_PATHS.get(agent, agent)])
command.extend(["--env", SECURE_DOCKER_ENV_IMPORT_PATH])
else:
command.extend(["--agent", agent_import_path or agent, "--env", harbor_environment_type(env_mode)])
Expand Down
8 changes: 5 additions & 3 deletions tests/test_harbor_local_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

from skillevaluator.provider_config import ProviderConfig
from skillevaluator.tier3.harbor import (
DOCKER_AGENT_IMPORT_PATHS,
ENV_MODE_LOCAL,
HARBOR_ENV_MODES,
HARBOR_NATIVE_ENV_MODES,
Expand Down Expand Up @@ -496,13 +497,14 @@ def test_build_command_wires_strict_read_policy(monkeypatch: pytest.MonkeyPatch)
assert "strict_reads=true" in " ".join(cmd)


def test_build_command_docker_mode_uses_secure_import_path() -> None:
cmd = build_harbor_run_command(dataset_path="/tmp/ds", agent="codex", job_name="j", env_mode="docker")
@pytest.mark.parametrize("agent", ["codex", "claude-code", "opencode"])
def test_build_command_docker_mode_uses_secure_import_path(agent: str) -> None:
cmd = build_harbor_run_command(dataset_path="/tmp/ds", agent=agent, job_name="j", env_mode="docker")
assert "--agent-import-path" not in cmd
assert "--environment-import-path" not in cmd
assert "-a" not in cmd
assert cmd.count("--agent") == 1
assert cmd[cmd.index("--agent") + 1] == "codex"
assert cmd[cmd.index("--agent") + 1] == DOCKER_AGENT_IMPORT_PATHS.get(agent, agent)
assert cmd.count("--env") == 1
assert cmd[cmd.index("--env") + 1] == SECURE_DOCKER_ENV_IMPORT_PATH

Expand Down
Loading
Loading