Skip to content

fix(tier3): stop per-trial apt installs in Docker agent setup - #413

Merged
rng1995 merged 9 commits into
mainfrom
naren/port-tier3-docker-agent-setup-no-per-trial-apt
Nov 12, 2026
Merged

rng1995 merged 9 commits into
mainfrom
naren/port-tier3-docker-agent-setup-no-per-trial-apt

Conversation

@rng1995

@rng1995 rng1995 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On the evaluator-generated python:3.12-slim image, none of the supported Docker agents (Claude Code, Codex, OpenCode) now runs an apt-get install during Harbor's agent setup.

Why

The quickstart Tier 3 path is NVIDIA Build with OpenCode in Docker mode. Harbor 0.24's OpenCode install requests nodejs and npm on every image, even though its glibc branch installs Node with nvm. So every OpenCode trial first ran apt-get update && apt-get install -y nodejs npm, then installed a second Node. Every Claude Code trial ran apt-get update && apt-get install -y procps. Both run inside Harbor's 360-second agent setup timeout, and a package mirror error fails the trial before the agent starts.

On main at d717f22, a probe that runs each Docker agent's real install() against an environment with exactly the generated image's commands shows:

  • opencode (stock Harbor agent): apt-get update && apt-get install -y nodejs npm
  • claude-code (SkillEvaluatorClaudeCode): apt-get update && apt-get install -y procps
  • codex (SkillEvaluatorCodex): no package install

With this change all three run no package install.

Behavior change, documented: like Claude Code and Codex since 0.6.0, OpenCode containers on Debian-based images no longer have Debian's gcc, g++ and make, or a system Node.js outside the OpenCode process. Skills that need them list them in scripts/apt-packages.txt or a custom Dockerfile.

Kept from public

  • _installer_dependencies, its branch probe, the bundled-without-ca CA-bundle fallback and Harbor's package-manager logic are reused as they are. Harbor's installers are not patched.
  • SkillEvaluatorOpenCode does not add the install retry that the Claude Code and Codex wrappers have. Harbor's OpenCode install() has no installed-CLI check, so a retry would rerun nvm and npm in full.
  • GKE and Harbor-native cloud routing are unchanged, and so are custom execution backends: a backend with no OpenCode wrapper still gets Harbor's stock opencode.
  • Hermes, the experimental Docker agent from feat(tier3): add experimental Hermes agent with native NVIDIA Build routing #385, is not changed. Its setup also asks for xz, which the generated apt line does not list.
  • Custom Dockerfiles are not changed. They keep their own base image by default (harbor.base_image_mode is disabled) and with custom_dockerfile_mode: preserve, so the docs note says to install procps there. Only base_image_mode reuse or rebuild with rebase mode puts them on the shared base image, which now has procps.

Tests

  • tests/tier3/test_installed_agent_bootstrap.py (45 to 68 tests):
    • SkillEvaluatorOpenCode joins the installer-branch tests: glibc images install no system Node and keep the vendor installer (musl predicate, nvm install 22, npm i -g opencode-ai); the system-npm branch still installs nodejs npm on apt and apk; a missing CA bundle installs ca-certificates; an unknown platform stops before installing; probe transport errors propagate; non-Node requests skip the probe; unknown dependency validation is kept; a missing stdbuf still installs coreutils.
    • The Docker route for opencode resolves through Harbor's AgentFactory by name and import path with report identity opencode. SkillEvaluatorGatewayOpenCode joins the gateway and NVIDIA Build wrapper test.
    • New test_generated_images_satisfy_docker_agent_setup_dependencies (3 cases): for claude-code, codex and opencode from DOCKER_AGENT_IMPORT_PATHS, every apt package that reaches Harbor's package step is in the apt line of each generated Dockerfile (base image, _write_dockerfile, _write_default_environment_dockerfile, init-harbor-task starter), plus coreutils and ca-certificates from the slim base.
    • New test_custom_dockerfiles_reach_procps_only_through_the_shared_base_image_rebase: a custom Dockerfile keeps its own FROM by default (no base image) and with preserve, is rebased only with a base image and rebase, and the docs note says so.
    • New test_docker_setup_note_scopes_the_npx_mcp_example_to_claude_code: the note ties the npx MCP example to Claude Code and the toolchain to every agent.
    • New test_docker_setup_note_gives_procps_guidance_its_own_paragraph: the note has two paragraphs. The first covers nodejs, npm and scripts/apt-packages.txt and does not mention procps. The second starts with the sentence on procps in generated images and holds the rebase condition.
  • tests/tier3/test_private_setup_classification.py (44 to 49 tests): new test_opencode_plugin_arms_share_the_environment_default_agent checks that _private_agent_paths(["opencode"], {}, ...) gives PrivateInstalledOpenCode/NativeInstalledOpenCode on docker and PrivateOpenCode/NativeOpenCode on gke. Both arms must share install and ensure_system_dependencies with that environment's default agent: DOCKER_AGENT_IMPORT_PATHS["opencode"] on docker, Harbor's stock OpenCode on gke. The existing table tests now cover the two new wrappers.
  • tests/test_harbor_secure_docker_environment.py: the Docker command test expects DOCKER_AGENT_IMPORT_PATHS["opencode"].
  • Fail-before:
    • With adapter.py and commands.py from main, the image test fails for claude-code ({'procps'} missing).
    • With SkillEvaluatorOpenCode reduced to stock OpenCode, 13 bootstrap tests fail (55 pass): every new OpenCode case except the system-npm branch (2), the non-Node request and the Docker route identity cases (2), which pin behavior stock OpenCode already has.
    • With the Docker opencode route removed, 5 tests fail (113 pass): the docker case of the plugin-arm test, both Docker route identity cases for opencode, the image test for opencode, and the secure Docker command test.
    • With the stock NativeOpenCode based on SkillEvaluatorOpenCode, the gke case of the plugin-arm test fails.
    • With docs/eval-datasets.mdx from main, all three new docs tests fail (no note mentions procps). The custom Dockerfile and npx tests also fail on a note that tells only custom_dockerfile_mode: preserve users to install procps and gives the npx MCP example for every agent. The paragraph test fails on the same note written as one paragraph (1 failed, 2 passed).
    • With all of src/ from main, test_installed_agent_bootstrap.py fails to import SkillEvaluatorOpenCode, and the docker case of the plugin-arm test fails.
    • The plugin-arm test still passes if SkillEvaluatorOpenCode later gains an install retry, since it compares the arms with the environment's default agent, not with Harbor's OpenCode.install.
  • After the merge with main at d717f22, the full suite with -n 6: 27387 passed, 35 skipped, 12 failed. None of the failures are in code this PR touches:
    • 11 also fail on main on this machine: test_sidecar_retains_only_structurally_required_nonsecret_compose_task_value and test_sidecar_retains_structurally_required_nonsecret_host_compose_value in tests/test_harbor_secure_docker_environment.py, five Bedrock model-probe tests in tests/test_harbor_runtime_preflight.py, the bounded Harbor process timeout test in tests/test_harbor_runner_status.py, and three CI launcher tests in tests/ci/test_all_tier_preflight.py and tests/ci/test_feedback.py.
    • test_local_callback_receives_complete_line_before_process_exit in tests/test_harbor_local_mode.py waits 0.5 seconds for a line and timed out under load. It passes alone, on this branch and on main.
    • test_custom_execution_backends.py passes: a custom backend still gets stock opencode.
  • ruff check and ruff format --check are clean on the changed Python files, and scripts/check_oss_boundary.py passed.

🤖 Generated with Claude Code

rng1995 and others added 5 commits November 7, 2026 20:58
Harbor 0.24's OpenCode install requests the distribution nodejs and npm
packages on every image, although its glibc branch installs Node with
nvm. Every Docker OpenCode trial (the NVIDIA Build default) therefore
ran apt-get update && apt-get install -y nodejs npm inside the agent
setup timeout. Every Claude Code trial also apt-installed procps,
because the generated images lack pgrep.

- Add SkillEvaluatorOpenCode, which reuses _installer_dependencies with
  Harbor's OpenCode branch selector, so musl and Alpine images still get
  distro Node/npm. Route Docker-engine OpenCode to it and base the
  gateway OpenCode wrapper on it. GKE and Harbor-native cloud runs keep
  the stock agent.
- Add NativeInstalledOpenCode and PrivateInstalledOpenCode and the
  native import-path row, so plugin arms match the Docker baseline.
- Install procps in every generated image (base image, task and
  default environment Dockerfiles, init-harbor-task starter).

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name OpenCode in the Docker Node/npm note, say that nvm's node, npm
and npx are on PATH only for the agent and the commands it runs, and
note that generated images now include procps. Add the CHANGELOG entry
under Unreleased > Fixed.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…px example

harbor.base_image_mode defaults to disabled, so a custom
evals/environment/Dockerfile keeps its own FROM in the default setup as
well as with custom_dockerfile_mode: preserve. Only reuse or rebuild with
rebase puts it on the shared base image, which has procps. The note now
says that, and the CHANGELOG entry says the per-task images (or the shared
base image) rebuild once instead of implying everyone has a base image.

Codex and OpenCode stdio MCP servers inherit nvm's npx, so the npx MCP
example now applies to Claude Code, and the toolchain to every agent.

The _rebase_custom_dockerfile_content docstring now points at
_BASE_APT_PACKAGES instead of a stale package list.

New tests pin the custom Dockerfile FROM in the default, preserve and
rebase cases against the note, and the scoped npx example.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t agent

The arm symmetry test compared install with Harbor's OpenCode.install, so
an install retry on SkillEvaluatorOpenCode would fail it although both
arms would still match. It now resolves the environment's default agent
(DOCKER_AGENT_IMPORT_PATHS for docker, stock OpenCode for gke) and checks
that both arms share its install and ensure_system_dependencies.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Docker setup note covered two topics in one paragraph: which agents
get Node.js, npm and a toolchain, and procps in generated, starter and
custom Dockerfiles. Start a second paragraph at the procps guidance, so
an author with a custom Dockerfile finds it, and the rebase condition,
without reading the Node.js scope first. The wording is unchanged.

A new test checks that the note has two paragraphs and that procps
appears only in the second.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 marked this pull request as ready for review November 9, 2026 19:49
…ial-apt

Conflicts:
- CHANGELOG.md: both sides appended a Fixed entry under Unreleased after
  the HTTPie security-grading entry (main: the tier3 compare Overall lift
  entry from #386). Kept both, main's entry first, then this branch's
  OpenCode Node/npm and procps entry.

Auto-merged without conflicts: docs/eval-datasets.mdx,
tier3/commands.py, tier3/harbor/__init__.py (the new OpenCode row sits
next to main's Hermes row in DOCKER_AGENT_IMPORT_PATHS),
tier3/harbor/adapter.py, tier3/harbor/native_agents.py and
tier3/plugin_native.py (the new OpenCode row sits next to main's Hermes
rows in NATIVE_AGENT_IMPORT_PATHS).

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewed the complete production diff and regression coverage; checked every generated Dockerfile package list, pinned Harbor OpenCode installer predicates, wrapper inheritance, native/private routing and bootstrap failure coverage. No actionable findings.

Verification at unchanged head 749352b6594af25bc19dad75600d24cddf3b8da2: 20 existing CI checks succeeded and 2 were intentionally skipped, including the supported Python tests, lint/package and security/platform gates where applicable. Fresh git merge-tree --write-tree is clean against the frozen main commit ce52a09. No new local test run is claimed for this unchanged code.

Signed-off-by: Narendran Raghavan <[email protected]>

# Conflicts:
#	CHANGELOG.md

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Integration review at 4694502c0bb55140ed6a4658569a05dde7bbe20f: resolved the actual CHANGELOG conflict while merging main a0b65a91d512fdc2254d2559900b6c30404218b8, retaining both independent entries. No additional production edit was made beyond the reviewed integration. Focused verification: 117 passed in 24.75s; make lint passed; pinned Fern 5.121.0 check passed with 0 errors and only the existing authenticated-redirect warning.

The candidate is merge-clean against explicitly audited main a0b65a91d512fdc2254d2559900b6c30404218b8; subsequent main checks are recorded where main advanced during external merges. The merge commit has DCO sign-off and was pushed normally after fresh open-PR and live-head checks. Fresh hosted CI is pending. No PR was merged by this review.

Signed-off-by: Narendran Raghavan <[email protected]>

# Conflicts:
#	CHANGELOG.md
@rng1995
rng1995 enabled auto-merge (squash) November 12, 2026 20:07

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Concurrent-merge integration review at 554b0c571ac42f765d1f9b5c101aea0ac0c51cbe: The actual CHANGELOG overlap preserves every independent entry and places this PR’s complete entry at the start of its existing Unreleased subsection. No production conflict required manual edits. Focused contracts: 117 passed in 72.22s (0:01:12). Lint passes; pinned Fern validation reports 0 errors and only the existing authenticated-redirect warning.

The signed-off fix was pushed normally after live open/head/base guards and clean merge checks against captured main b38b71be01f7fdf332e37efbfec49714f3939161 and actual base main at b38b71be01f7fdf332e37efbfec49714f3939161. Fresh exact-head hosted CI is pending. No PR was merged by this review.

Signed-off-by: Narendran Raghavan <[email protected]>

# Conflicts:
#	CHANGELOG.md

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Concurrent-merge integration review at f6114bf07ef9d7572a1ab782fceef18a1dbe737c: The actual CHANGELOG overlap preserves every independent entry and places this PR’s complete entry after its assigned existing bullet in the same Unreleased subsection. Exact route identity expectations follow Harbor 0.25 OpenCode native model nvidia/test-model/provider null; Codex and Claude expectations retained. Unwrapped agent and wrapper match; production behavior unchanged. No production conflict required manual edits. Focused contracts: 117 passed in 75.63s (0:01:15). Lint passes; pinned Fern validation reports 0 errors and only the existing authenticated-redirect warning.

The signed-off fix was pushed normally after live open/head/base guards and clean merge checks against captured main 3cf34ec3f052cc2e75d1fadeb34d2a83a5a9a97f and actual base main at 3cf34ec3f052cc2e75d1fadeb34d2a83a5a9a97f. Fresh exact-head hosted CI is pending. No PR was merged by this review.

@rng1995
rng1995 merged commit 882ec05 into main Nov 12, 2026
27 checks passed
@rng1995
rng1995 deleted the naren/port-tier3-docker-agent-setup-no-per-trial-apt branch November 12, 2026 21:33
rng1995 added a commit that referenced this pull request Nov 12, 2026
Brings in #410, #412, #413, #419, #421, #425, #430 and #444. Conflicts: CHANGELOG.md (kept both Unreleased Fixed entries) and evaluation/options.py (kept main's tolerate_baseline_timeouts field and this PR's backend field).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant