Skip to content

feat(agents): add Deep Agents Code harness - #5197

Merged
cv merged 57 commits into
mainfrom
codex/4861-langchain-deepagents-code
Jun 23, 2026
Merged

feat(agents): add Deep Agents Code harness#5197
cv merged 57 commits into
mainfrom
codex/4861-langchain-deepagents-code

Conversation

@cv

@cv cv commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds experimental LangChain Deep Agents Code support as a terminal-oriented NemoClaw harness. The change introduces manifest-driven terminal runtime handling so NemoClaw can onboard, status-check, log, snapshot, and document an agent that does not expose an in-sandbox gateway.

Related Issue

Refs #4861. This PR is scoped to the experimental harness/framework slice; #4861 remains open for live runtime acceptance, release/launch material, and broader terminal-agent diagnostics.

Changes

  • Adds agents/langchain-deepagents-code/ with pinned deepagents-code[nvidia], managed dcode wrapper, deterministic non-secret config.toml generation, sandbox policy additions, and durable state declarations.
  • Extends agent manifests/runtime helpers with gateway vs terminal runtime metadata and skips dashboard forwarding, gateway recovery, and gateway log probing for terminal agents.
  • Updates onboard/status/connect/logs behavior to report Deep Agents Code as a terminal harness with interactive and headless command guidance.
  • Hardens the managed Deep Agents Code posture by rejecting unmanaged sandbox/MCP/shell overrides, patching direct module execution, avoiding unsupported generic web-search advertising, and omitting credential-bearing proxy URLs from persisted shell env.
  • Adds focused tests for manifest loading, terminal runtime recovery behavior, config generation, onboarding policy selection, dashboard forwarding, sandbox naming, image/startup contracts, and E2E scenario metadata.
  • Adds E2E scenario metadata plus an experimental quickstart doc and README entry.

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)

Verification

Targeted local verification plus commit/push hooks were used by design; full npm test was not run locally.

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Ran:

  • npm run build:cli
  • npx vitest run src/lib/onboard/initial-policy.test.ts src/lib/agent/defs.test.ts src/lib/agent/runtime.test.ts test/process-recovery.test.ts test/onboard-dashboard.test.ts test/langchain-deepagents-code-config.test.ts test/onboard-sandbox-name.test.ts
  • npx vitest run test/e2e-scenario/support-tests/e2e-manifests.test.ts test/e2e-scenario/support-tests/e2e-live-registry-discovery.test.ts test/e2e-scenario/support-tests/e2e-scenario-matrix.test.ts
  • npx vitest run test/langchain-deepagents-code-image.test.ts
  • npx vitest run src/lib/agent/runtime-terminal.test.ts
  • npx tsx scripts/validate-configs.ts
  • bash -n agents/langchain-deepagents-code/start.sh
  • bash -n agents/langchain-deepagents-code/dcode-wrapper.sh
  • npx prek run shellcheck --files agents/langchain-deepagents-code/start.sh agents/langchain-deepagents-code/dcode-wrapper.sh
  • pre-commit hooks on branch commits, including a0a1f1281
  • pre-push hooks on codex/4861-langchain-deepagents-code, including latest push to a0a1f1281
  • dispatched fresh E2E / Vitest Scenarios workflow for a0a1f1281: https://github.com/NVIDIA/NemoClaw/actions/runs/27326191673

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

Summary by CodeRabbit

Release Notes

  • New Features
    • Added experimental LangChain Deep Agents Code as a terminal agent, with NVIDIA-backed inference support, manifest/integration, and a new Quickstart guide.
  • Bug Fixes / Improvements
    • Improved connect/probe, onboarding, and sandbox status output for terminal runtimes, including better harness commands and terminal-first readiness flow.
  • Security / Hardening
    • Hardened the terminal sandbox and managed harness (stricter overrides, tighter file/network controls, Landlock read-only verification).
    • Prevented credential-bearing proxy values from being exported into the sandbox environment.
  • Documentation / Tests
    • Updated get-started navigation and expanded contract/e2e coverage for terminal agent behavior.

@cv cv self-assigned this Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f776d40c-92e4-4375-93e0-e4551d0def75

📥 Commits

Reviewing files that changed from the base of the PR and between 0519019 and 0a30ab6.

📒 Files selected for processing (15)
  • agents/langchain-deepagents-code/dependency-review.md
  • agents/langchain-deepagents-code/generate-config.ts
  • agents/langchain-deepagents-code/policy-additions.yaml
  • src/lib/actions/sandbox/connect.ts
  • src/lib/actions/sandbox/terminal-connect-probe.ts
  • src/lib/onboard/host-proxy-env.ts
  • src/lib/onboard/sandbox-create-launch.test.ts
  • src/lib/onboard/sandbox-create-launch.ts
  • test/e2e-scenario/manifests/langchain-deepagents-code-nvidia.yaml
  • test/e2e-scenario/scenarios/scenarios/baseline.ts
  • test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh
  • test/langchain-deepagents-code-config.test.ts
  • test/langchain-deepagents-code-image.test.ts
  • test/sandbox-logs-terminal.test.ts
  • test/snapshot.test.ts
✅ Files skipped from review due to trivial changes (3)
  • test/e2e-scenario/manifests/langchain-deepagents-code-nvidia.yaml
  • test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh
  • agents/langchain-deepagents-code/dependency-review.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • test/e2e-scenario/scenarios/scenarios/baseline.ts
  • agents/langchain-deepagents-code/generate-config.ts
  • src/lib/onboard/sandbox-create-launch.ts
  • agents/langchain-deepagents-code/policy-additions.yaml
  • test/sandbox-logs-terminal.test.ts
  • test/langchain-deepagents-code-image.test.ts

📝 Walkthrough

Walkthrough

Adds langchain-deepagents-code as an experimental terminal-runtime agent. Introduces terminal runtime contracts, binary availability checking, smoke command execution, and dashboard-gating throughout the onboarding, connect, logs, and status flows. New image assets include Dockerfiles, wrapper scripts, config generator, Python patch, and sandbox policy with comprehensive contract and E2E tests.

Changes

Terminal Agent Runtime Integration

Layer / File(s) Summary
Runtime manifest contracts and agent definition wiring
src/lib/agent/runtime-manifest.ts, src/lib/agent/defs.ts, src/lib/agent/defs.test.ts
Defines AgentRuntimeKind ("gateway" | "terminal"), AgentRuntime interface with command/smoke fields, and manifest parser readAgentRuntime; wires into loadAgent and exports helpers; updates AgentDefinition.healthProbe type to AgentHealthProbe | null and forwardPort to return 0 for terminal agents; adds terminal acceptance test and manifest validation rejection tests.
Runtime-aware command and recovery behavior
src/lib/agent/runtime.ts, src/lib/agent/runtime-terminal.test.ts, src/lib/agent/runtime.test.ts
Exports TERMINAL_AGENT_RECOVERY_SCRIPT sentinel, AgentRecoveryScript union type, hasGatewayRuntime(), and getTerminalCommand() helpers; injects guard-refusal command into recovery scripts via gatewayGuardRefusalCommand(); buildRecoveryScript early-returns terminal sentinel for terminal agents; buildManualRecoveryCommand returns terminal command for terminal agents with unit and integration tests.
Binary availability and smoke command primitives
src/lib/agent/binary-availability.ts, src/lib/agent/terminal-smoke.ts, src/lib/agent/onboard.test.ts
New verifyAgentBinaryAvailable performs sandboxed shell-based binary availability checks with marker parsing and structured failure reasons; describeAgentBinaryFailure formats human-readable errors; runAgentSmokeCommands iterates and executes smoke commands with exit-code marker extraction; test covers non-executable binary path scenario.
Terminal onboarding and setup flow
src/lib/agent/onboard.ts, src/lib/agent/onboard-terminal.test.ts, src/lib/agent/onboard-terminal-fixtures.ts
Routes terminal agents through binary checks and smoke commands instead of gateway curl polling in both fresh and resume modes; smoke failures truncate output and invoke failAgentSetup; removes prior in-file binary probing implementation; acceptance tests validate fresh setup, resume with binary check, and smoke failure scenarios.
Terminal connect probe dispatch
src/lib/actions/sandbox/connect.ts, test/cli/connect-terminal-agent.test.ts, src/lib/actions/sandbox/connect-flow.test.ts
runSandboxConnectProbe prefetches session agent; adds early-return branch for terminal agents that runs smoke checks, logs "terminal smoke checks passed", and returns without invoking gateway recovery logic; CLI integration test validates smoke command dispatch and absence of gateway recovery operations; flow test verifies terminal interactive command routing.
Dashboard runtime gating utilities
src/lib/onboard/dashboard-runtime.ts, src/lib/onboard/agent-dashboard-forward.ts, src/lib/onboard/dashboard-port.ts, src/lib/onboard/host-proxy-env.ts
Adds DashboardRuntimeAgent type, shouldManageDashboardForAgent() predicate, and forward-port validation/extraction helpers; ensureAgentDashboardForward early-returns 0 for terminal agents without declared ports; malformed CHAT_UI_URL falls back to local default instead of throwing; proxy env option to drop credential-bearing URLs; tests confirm terminal agents skip dashboard forwarding.
Dashboard-gated onboarding orchestration
src/lib/onboard.ts, src/lib/onboard/sandbox-create-launch.ts, src/lib/onboard/sandbox-reuse.ts, src/lib/onboard/sandbox-create-plan.ts, src/lib/onboard/machine/handlers/finalization.ts
Threads manageDashboard flag through create/reuse/launch/plan/finalization; conditionally skips dashboard port resolution, env injection, readiness wait, forwarding, and Hermes state reconciliation for terminal agents; finalization logs terminal-ready block with optional commands for non-dashboard agents; OTEL preset excluded for terminal agents in initial policy; comprehensive tests cover create/reuse scenarios and finalization paths.
Terminal-aware process recovery
src/lib/actions/sandbox/process-recovery.ts, test/process-recovery.test.ts
checkAndRecoverSandboxProcesses early-returns { runtime: "terminal", recovered: false, wasRunning: null } when agent exists but lacks gateway runtime; gateway health probes return null for terminal agents; resolveSandboxDashboardPort requires gateway runtime before using agent-declared ports; centralizes declared forward-port error logging via new helper.
Runtime-aware logs and status reporting
src/lib/actions/sandbox/logs.ts, src/lib/actions/sandbox/status.ts, src/lib/actions/sandbox/status-snapshot.ts, src/lib/actions/sandbox/status-lookup-rendering.ts, src/commands/sandbox/logs.ts
Gateway log source gated by hasGatewayRuntime predicate; SandboxStatusReport gains agent, agentDisplayName, agentRuntime metadata via new resolveSandboxStatusAgent helper; showSandboxStatus adds "Harness" section with agent runtime display and terminal-ready command output; gateway lookup rendering extracted to new module with per-state handlers; tests validate terminal log/status behavior and unknown-agent load error handling.
Agent-specific base image change detection
src/lib/sandbox-base-image.ts, src/lib/sandbox-base-image.test.ts
Adds normalizeBaseImageInputPaths helper; extends baseImageInputsChangedSinceMain with optional paths argument; resolveSandboxBaseImage passes agent Dockerfile path for change detection; tests confirm agent Dockerfile changes detected only when path is supplied and rejects traversal paths.
Deep Agents Code Docker images, config generator, wrapper, patch, manifest, and policy
agents/langchain-deepagents-code/Dockerfile.base, agents/langchain-deepagents-code/Dockerfile, agents/langchain-deepagents-code/generate-config.ts, agents/langchain-deepagents-code/dcode-wrapper.sh, agents/langchain-deepagents-code/start.sh, agents/langchain-deepagents-code/patch-managed-deepagents-code.py, agents/langchain-deepagents-code/manifest.yaml, agents/langchain-deepagents-code/policy-additions.yaml, agents/langchain-deepagents-code/requirements.in, agents/langchain-deepagents-code/dependency-review.md
Base image installs Python 3.13.5 and Deep Agents from hash-locked requirements.lock; final Dockerfile validates dcode binary, runs TypeScript config generator, installs managed wrapper; dcode-wrapper.sh enforces --sandbox none --no-mcp and rejects sandbox/MCP/allow-list override flags; start.sh sanitizes proxy exports and generates runtime env; Python patch injects managed posture defaults into deepagents module; manifest declares terminal runtime with interactive/headless commands and smoke checks; policy enforces default-deny filesystem/network rules with Landlock strict enforcement.
Image, config, and Landlock validation tests
test/langchain-deepagents-code-image.test.ts, test/langchain-deepagents-code-config.test.ts, test/e2e/e2e-cloud-experimental/checks/05-deepagents-code-landlock-readonly.sh, test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh
Contract tests validate Dockerfile blueprint hardening, proxy credential sanitization, wrapper boundary enforcement, hash-lock dependency pinning, patch application correctness, and policy baseline assertions; config tests verify OpenAI provider routing, model normalization, and rejection of credentials/query-strings in inference base URL; E2E scripts validate Landlock read-only enforcement for /usr, /etc and writability for /tmp, plus Python egress reachability rules.
Agent naming, scenario registration, and documentation
src/lib/onboard/sandbox-agent.ts, test/onboard-sandbox-name.test.ts, test/e2e-scenario/manifests/langchain-deepagents-code-nvidia.yaml, test/e2e-scenario/scenarios/expected-states.ts, test/e2e-scenario/scenarios/scenarios/baseline.ts, README.md, docs/get-started/quickstart-langchain-deepagents-code.mdx, docs/index.yml
Adds display name "LangChain Deep Agents Code" and default sandbox name "deepagents-code"; registers E2E scenario with NVIDIA provider, balanced policy tier, and expected state; documents experimental agent in README and navigation; quickstart covers onboarding flow, managed wrapper isolation constraints, state preservation boundaries, optional Tavily web search, and troubleshooting guidance.
State preservation and snapshot configuration
test/snapshot.test.ts
Updates sandbox registry helper to support agent field parameterization, adds Deep Agents Code durable state file backup test with credential file exclusion.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐇 A terminal agent hops into the ring,
dcode managed with wrapper—no sandbox escape!
Smoke checks dance, binary probes sing,
Proxy secrets scrubbed without a trace.
Hash-locked deps and Landlock's steady gate—
Deep Agents Code integrates, first-rate! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.40% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(agents): add Deep Agents Code harness' directly and clearly summarizes the main change—adding a new Deep Agents Code terminal agent harness to the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/4861-langchain-deepagents-code

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

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: ubuntu-repo-cloud-langchain-deepagents-code, cloud-e2e, sandbox-operations-e2e, network-policy-e2e
Optional E2E: inference-routing-e2e, cloud-onboard-vitest, credential-sanitization-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • ubuntu-repo-cloud-langchain-deepagents-code (medium): Primary coverage for the new supported agent: installs from repo, onboards LangChain Deep Agents Code with NVIDIA hosted inference, expects a running sandbox with agent=langchain-deepagents-code, and exercises the typed terminal-agent scenario path.
  • cloud-e2e (high): Broad install → onboard → sandbox verify → live inference → CLI operations coverage is required because the PR modifies core onboarding, sandbox lifecycle planning/reuse/finalization, status/logs/connect, and base-image selection code used by normal user flows.
  • sandbox-operations-e2e (high): Required for the touched sandbox operations surface: terminal connect probing, logs rendering, status JSON/text paths, process recovery, multiple sandbox lifecycle operations, and live OpenShell sandbox command boundaries.
  • network-policy-e2e (medium): Required because the PR adds a new agent policy with Landlock/read-only filesystem rules and process-scoped egress allowances. Existing network-policy E2E should validate that the live policy enforcement machinery still fails closed and honors allow/deny behavior.

Optional E2E

  • inference-routing-e2e (medium): Useful adjacent confidence for inference.local provider routing, credential absence from sandbox env/files, and error classification. The Deep Agents Code scenario is the required agent-specific inference path; this is broader OpenClaw routing regression coverage.
  • cloud-onboard-vitest (high): Optional public-install/onboard coverage. It runs the cloud-onboard Vitest replacement and the cloud experimental check directory, but the newly added Deep Agents Code checks currently skip unless the sandbox is a Deep Agents Code sandbox.
  • credential-sanitization-e2e (medium): Optional security confidence because the new agent config generator and wrapper intentionally avoid writing provider secrets into in-sandbox config/env; this existing suite checks broader credential stripping and sandbox secret-boundary behavior.

New E2E recommendations

  • deepagents-code-security-boundary (high): The new 05-deepagents-code-landlock-readonly.sh and 06-deepagents-code-python-egress.sh checks skip on the default OpenClaw cloud-onboard sandbox, and the typed Deep Agents Code registry scenario does not appear to run those check scripts. Add or wire a live Deep Agents Code security validation so Landlock read-only paths and Python egress allow/deny rules are actually exercised on a Deep Agents Code sandbox.
    • Suggested test: Add a Deep Agents Code live security E2E job, or extend ubuntu-repo-cloud-langchain-deepagents-code to run test/e2e/e2e-cloud-experimental/checks/05-deepagents-code-landlock-readonly.sh and 06-deepagents-code-python-egress.sh after onboarding.
  • deepagents-code-wrapper-hardening (high): The wrapper and build-time upstream patch enforce critical posture by rejecting MCP, nested sandbox, sandbox snapshot/setup, and shell allow-list overrides. Existing live coverage should verify these controls inside the built sandbox, including direct python -m deepagents_code execution if that bypass remains possible.
    • Suggested test: Add a Deep Agents Code terminal hardening E2E that runs dcode with forbidden flags and python3 -m deepagents_code with forbidden flags inside the sandbox and asserts deterministic rejection/no MCP/no nested sandbox.
  • deepagents-code-image-build (medium): The repository has image build coverage for the default and Hermes sandbox images, but the new LangChain Deep Agents Code Dockerfile/base image path and hash-locked Python dependency install are not represented as a distinct CI image build job in the inspected workflows.
    • Suggested test: Add a LangChain Deep Agents Code sandbox image build/smoke job that builds Dockerfile.base and Dockerfile, verifies dcode paths/version, generated config.toml, sandbox-user permissions, and absence of raw provider secrets.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: e2e-scenarios-all
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref>

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • e2e-scenarios-all: The PR changes typed Vitest scenario metadata and expected-state metadata under test/e2e-scenario/scenarios, plus a LangChain Deep Agents Code scenario manifest/onboarding surface. Per policy, registry/scenario expected-state metadata changes require the full live Vitest scenario fan-out rather than a targeted dispatch.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref>

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • agents/langchain-deepagents-code/Dockerfile
  • agents/langchain-deepagents-code/Dockerfile.base
  • agents/langchain-deepagents-code/dcode-wrapper.sh
  • agents/langchain-deepagents-code/generate-config.ts
  • agents/langchain-deepagents-code/manifest.yaml
  • agents/langchain-deepagents-code/patch-managed-deepagents-code.py
  • agents/langchain-deepagents-code/policy-additions.yaml
  • agents/langchain-deepagents-code/requirements.in
  • agents/langchain-deepagents-code/requirements.lock
  • agents/langchain-deepagents-code/start.sh
  • src/lib/agent/binary-availability.ts
  • src/lib/agent/defs.ts
  • src/lib/agent/onboard.ts
  • src/lib/agent/runtime-manifest.ts
  • src/lib/agent/runtime.ts
  • src/lib/agent/terminal-smoke.ts
  • src/lib/onboard.ts
  • src/lib/onboard/host-proxy-env.ts
  • src/lib/onboard/sandbox-agent.ts
  • src/lib/onboard/sandbox-create-launch.ts
  • src/lib/onboard/sandbox-create-plan.ts
  • src/lib/onboard/sandbox-reuse.ts
  • src/lib/sandbox-base-image.ts
  • test/e2e-scenario/manifests/langchain-deepagents-code-nvidia.yaml
  • test/e2e-scenario/scenarios/expected-states.ts
  • test/e2e-scenario/scenarios/scenarios/baseline.ts

@github-actions

github-actions Bot commented Jun 11, 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 · 5 test follow-ups
Since last review: 1 prior item resolved · 0 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
  • PRA-T5 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 — Validate a real Deep Agents Code sandbox starts, dcode --version succeeds, and /sandbox/.deepagents/config.toml contains the managed inference settings without NVIDIA_API_KEY, OPENAI_API_KEY, sk-, .env, or .mcp.json contents.. Static and unit coverage is broad and behavior-specific, but this PR changes Docker image construction, OpenShell sandbox policy, Landlock enforcement, Python egress, and terminal-agent connect/status/logs/recovery behavior. Those paths depend on live sandbox/runtime semantics that unit tests cannot fully prove.
  • PRA-T2 Runtime validation — Validate nemoclaw <sandbox> connect --probe-only on a live Deep Agents Code sandbox runs the terminal smoke commands and does not invoke gateway recovery or OpenClaw gateway curl probes.. Static and unit coverage is broad and behavior-specific, but this PR changes Docker image construction, OpenShell sandbox policy, Landlock enforcement, Python egress, and terminal-agent connect/status/logs/recovery behavior. Those paths depend on live sandbox/runtime semantics that unit tests cannot fully prove.
  • PRA-T3 Runtime validation — Validate nemoclaw <sandbox> logs on a live Deep Agents Code sandbox enables OpenShell audit logs and does not tail /tmp/gateway.log or merge an OpenClaw gateway log source.. Static and unit coverage is broad and behavior-specific, but this PR changes Docker image construction, OpenShell sandbox policy, Landlock enforcement, Python egress, and terminal-agent connect/status/logs/recovery behavior. Those paths depend on live sandbox/runtime semantics that unit tests cannot fully prove.
  • PRA-T4 Runtime validation — Validate the live Deep Agents Code Landlock policy denies writes under /usr and /etc while permitting writes under /sandbox/.deepagents and /tmp.. Static and unit coverage is broad and behavior-specific, but this PR changes Docker image construction, OpenShell sandbox policy, Landlock enforcement, Python egress, and terminal-agent connect/status/logs/recovery behavior. Those paths depend on live sandbox/runtime semantics that unit tests cannot fully prove.
  • PRA-T5 Runtime validation — Validate live Python egress from a Deep Agents Code sandbox can reach only policy-approved hosts such as GitHub/PyPI/inference and is denied for Tavily, LangSmith, MCP hosts, and example.com without explicit policy.. Static and unit coverage is broad and behavior-specific, but this PR changes Docker image construction, OpenShell sandbox policy, Landlock enforcement, Python egress, and terminal-agent connect/status/logs/recovery behavior. Those paths depend on live sandbox/runtime semantics that unit tests cannot fully prove.

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.

coderabbitai[bot]

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

Comment thread test/sandbox-status-json-stdout.test.ts Fixed

@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: 4

🤖 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/binary-availability.ts`:
- Around line 33-39: The health-check shell snippet misreports a non-executable
explicit binary_path as "not_found" when command -v fails; update the
constructed command in binary-availability.ts (the array building the shell
string that references binaryPath, executable and AGENT_BINARY_CHECK_PREFIX) to
first check existence without execute permission (e.g., test -e or [ -f ] and
not -x) and emit the AGENT_BINARY_CHECK_PREFIX + "not_executable" with the
resolved path before falling back to the command -v branch; apply the same fix
to the analogous block around the lines that reference the same variables (the
second occurrence noted in the comment).

In `@src/lib/agent/runtime-manifest.ts`:
- Around line 24-28: The readStringArray helper currently silently filters out
non-string elements which lets malformed runtime.smoke_commands pass; change
readStringArray (used for parsing RuntimeRecord) to fail fast: if record[key] is
undefined return undefined, but if it's present and not an array throw a
descriptive error, and if it is an array validate that every element is a
string—if any element is not a string throw a descriptive error (include the key
name like "runtime.smoke_commands" in the message) instead of returning a
filtered array so malformed manifests are rejected early.

In `@src/lib/agent/terminal-smoke.ts`:
- Around line 22-29: The smoke-check currently infers success from output text
(using runCaptureOpenshell result -> output and regex matches) which is
unreliable; update the logic to use the command's exit status from
runCaptureOpenshell (e.g., result.exitCode or equivalent) as the source of
truth: inspect the returned result object instead of testing output for
"error"/"failed", treat exitCode === 0 as success even if output is empty, treat
any non-zero exit code as failure and return { ok: false, command, output,
exitCode } (or include exitCode in the success return), and ensure
runCaptureOpenshell call still preserves ignoreError: true so you can read
exitCode from result.

In `@test/sandbox-status-json-stdout.test.ts`:
- Line 4: The import line currently brings in an unused symbol `vi` from Vitest;
remove `vi` from the named import list in the line that reads "import {
afterEach, beforeEach, describe, expect, it, vi } from 'vitest';" (or if the
symbol is intentionally reserved for future use, rename it to `_vi` to satisfy
the unused-variable rule) so the file no longer imports an unused identifier.
🪄 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: bc9db013-0833-44a5-8689-1877e1685cd3

📥 Commits

Reviewing files that changed from the base of the PR and between e8fa235 and 3a68260.

📒 Files selected for processing (16)
  • agents/langchain-deepagents-code/Dockerfile
  • agents/langchain-deepagents-code/generate-config.ts
  • agents/langchain-deepagents-code/start.sh
  • src/lib/actions/sandbox/connect.ts
  • src/lib/actions/sandbox/logs.ts
  • src/lib/actions/sandbox/status-snapshot.ts
  • src/lib/agent/binary-availability.ts
  • src/lib/agent/defs.ts
  • src/lib/agent/onboard.ts
  • src/lib/agent/runtime-manifest.ts
  • src/lib/agent/terminal-smoke.ts
  • src/lib/onboard.ts
  • test/cli/connect-terminal-agent.test.ts
  • test/langchain-deepagents-code-image.test.ts
  • test/sandbox-logs-terminal.test.ts
  • test/sandbox-status-json-stdout.test.ts
💤 Files with no reviewable changes (1)
  • src/lib/onboard.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/actions/sandbox/logs.ts
  • agents/langchain-deepagents-code/start.sh
  • agents/langchain-deepagents-code/Dockerfile
  • agents/langchain-deepagents-code/generate-config.ts
  • src/lib/agent/onboard.ts

Comment thread src/lib/agent/binary-availability.ts
Comment thread src/lib/agent/runtime-manifest.ts
Comment thread src/lib/agent/terminal-smoke.ts
Comment thread test/sandbox-status-json-stdout.test.ts Outdated
@github-actions

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 27322004615
Target ref: 7ad9d1dfa1243a87dd1ade18a592e1df8d511671
Workflow ref: main
Requested jobs: sandbox-operations-e2e,network-policy-e2e,inference-routing-e2e,state-backup-restore-e2e
Summary: 2 passed, 2 failed, 0 skipped

Job Result
inference-routing-e2e ✅ success
network-policy-e2e ❌ failure
sandbox-operations-e2e ❌ failure
state-backup-restore-e2e ✅ success

Failed jobs: network-policy-e2e, sandbox-operations-e2e. Check run artifacts for logs.

Comment thread src/lib/agent/onboard.ts Outdated
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@cv
cv merged commit f373889 into main Jun 23, 2026
39 checks passed
@cv
cv deleted the codex/4861-langchain-deepagents-code branch June 23, 2026 00:42
@wscurran wscurran added the integration: dcode LangChain Deep Code integration behavior label Jun 23, 2026
cjagwani added a commit that referenced this pull request Jun 23, 2026
PR #5197 landed Deep Agents Code as an experimental NemoClaw agent
runtime yesterday, but the canonical matrix's agents section still
only listed OpenClaw and Hermes. The advisor flagged the published
onboarding claim as absent from and contradicted by the matrix.

Add a row for LangChain Deep Agents Code that captures:

- Status experimental, matching the PR's own framing and the open
  acceptance epic #4861.
- Terminal runtime kind (no in-sandbox gateway or dashboard), so
  readers know the operational shape differs from OpenClaw/Hermes.
- Onboard command `$$nemoclaw onboard --agent deepagents-code` plus
  a pointer to the existing quickstart.
- Managed-harness posture (rejects unmanaged sandbox, MCP, and
  shell overrides; drops credential-bearing proxy URLs from
  persisted shell env) so the security boundary is on the page.
- Inference routes through `inference.local` via Deep Agents Code's
  OpenAI-compatible provider.
- Reference to issue #4861 for the broader live-runtime acceptance,
  launch material, and terminal-agent diagnostics work that is not
  in scope for this PR.

Regenerated docs/reference/platform-support.mdx and the .agents/
skills/ + skills/ trees.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
abhi-0906 added a commit to abhi-0906/NemoClaw that referenced this pull request Jun 24, 2026
NVIDIA#5621)

Deep Agents Code ships Tavily/LangSmith deny-by-default (PR NVIDIA#5197). This adds the
opt-in path for Tavily web search:

- New maintained policy preset nemoclaw-blueprint/policies/presets/tavily.yaml that
  opens egress to api.tavily.com:443 only, scoped to the python3/node/curl binaries
  (dcode traffic is attributed to the sandbox python3 interpreter).
- Quickstart now documents the concrete enable flow
  (`nemoclaw <name> policy-add tavily`), where the Tavily credential is supplied at
  runtime (never baked into managed config/image), and how to remove it.
- LangSmith is explicitly documented as not yet supported: no preset opens
  api.smith.langchain.com and no supported mechanism injects LANGSMITH_API_KEY.
- Test asserts the preset declares api.tavily.com and that the Deep Agents Code
  default policy still denies both Tavily and LangSmith, plus updates the known
  preset-name list.

Live egress validation (that enabling the preset actually reaches api.tavily.com
through OpenShell) and the formal decision on LangSmith support remain for the live
e2e environment and maintainers.

Signed-off-by: Abhimanyu Kumar <abhimanyukumar7290@gmail.com>
cv added a commit that referenced this pull request Jun 26, 2026
## Summary
Restore issue #5800 parity package `P0-E` for merged bash-suite deltas
only.

## Related Issues
Refs #5800
Refs #5098
Refs #5197
Refs #5245
Refs #5508
Refs #5587

## Scope gate
- Package: `P0-E — Platform, tunnel, cloud-experimental, and docs parity
decisions`
- Included PRs all merged and touched `test/e2e`: yes — #5197, #5245,
#5508, #5587
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR #5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| E1 | #5197 | Deep Agents Code cloud-experimental Landlock check:
`.deepagents` and `/tmp` writable, `/usr` and `/etc` read-only. |
`hosted-compatible capable` |
`ubuntu-repo-cloud-langchain-deepagents-code` live scenario now runs
`05-deepagents-code-landlock-readonly.sh` after onboarding. | covered |
| E2 | #5197 | Deep Agents Code arbitrary Python egress permits
GitHub/PyPI and blocks Tavily/LangSmith/MCP/example.com absent explicit
policy. | `hosted-compatible capable` |
`ubuntu-repo-cloud-langchain-deepagents-code` live scenario now runs
`06-deepagents-code-python-egress.sh` after onboarding. | covered |
| E3 | #5245 | Trace timing signal is trusted summary only; raw
target-controlled traces are not uploaded. | `none` | Existing
`test/e2e-script-workflow.test.ts` and sanitizer tests cover trusted
trace summary, scorecard comparison, and redaction boundary. | covered |
| E4 | #5508 | GPU Local Ollama small-context config carries reduced
OpenClaw compaction reserve. | `none` / local inference |
`test/e2e-scenario/live/gpu-e2e.test.ts` now reads
`/sandbox/.openclaw/openclaw.json` and asserts `reserveTokens` /
`reserveTokensFloor` for small windows. | covered |
| E5 | #5508 | Interactive OpenClaw TUI first turn must not fail
auto-compaction. | `none` / local inference | No Vitest TUI fixture
exists yet; config-level assertion covers the deterministic contract and
the interactive smoke remains platform/manual-runner follow-up. Owner:
NemoClaw maintainers; date: 2026-06-25; tracked in #5800 closeout. |
waived/follow-up |
| E6 | #5587 | Cloudflared exact-version override validates Debian
version syntax before APT install. | `hosted-compatible capable` for
live tunnel job; resolver itself `none` | Existing
`test/cloudflared-version-resolver.test.ts`; tunnel workflow boundary
already requires resolver use before `apt-get install
cloudflared=${cf_version}`. | covered |

## Inference mode support
- Default mode for touched live targets: `hosted-compatible capable` for
Deep Agents Code and tunnel lifecycle; local Ollama/GPU uses local
inference; trace/resolver tests are `none`.
- Real inference support preserved: yes for Deep Agents Code scenario
via `NVIDIA_INFERENCE_API_KEY`; yes for tunnel lifecycle via existing
hosted-compatible route; local Ollama GPU remains local inference.
- Modes validated in this PR: local unit/support tests plus live
scenario selection without secret; selective hosted/GPU workflow
dispatch required after PR opens.
- If not validated with real inference: local machine lacks
`NVIDIA_INFERENCE_API_KEY`, GPU runner, and Docker daemon; selective
GitHub Actions will validate runner/secret boundaries.

## Validation
- [x] `npm run build:cli`
- [x] `npx vitest run
test/e2e-scenario/support-tests/e2e-scenario-matrix.test.ts
test/e2e-scenario/support-tests/e2e-scenario-registry.test.ts
test/langchain-deepagents-code-image.test.ts
test/ollama-local-openclaw-config-propagation.test.ts
test/cloudflared-version-resolver.test.ts --silent=false
--reporter=default`
- [x] `NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project
e2e-scenarios-live test/e2e-scenario/live/registry-scenarios.test.ts -t
'^ubuntu-repo-cloud-langchain-deepagents-code$' --silent=false
--reporter=verbose` (local result: skipped due missing
`NVIDIA_INFERENCE_API_KEY`, confirms scenario wiring)
- [ ] hosted/public selective E2E workflow, if required by
classification: pending PR dispatch

## Follow-ups / waivers
- E5: Interactive TUI first-turn smoke remains waived until a Vitest TUI
fixture exists. Owner: NemoClaw maintainers; date: 2026-06-25;
deterministic config contract is covered here.


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

* **New Features**
* Added a new cloud onboarding path for LangChain Deep Agents Code,
including dedicated fixtures and live scenario coverage.
* Surfaced new “cloud experimental” checks in live run planning and
scenario matrix output.
* **Bug Fixes**
* Improved GPU live E2E validation by asserting the reserve-token
compaction policy.
* Updated Deep Agents Code expected gateway health handling to be
optional.
* **Security/Policy**
* Expanded Deep Agents Code Python egress allowlists for approved
GitHub/PyPI hosts.
* **Tests**
* Updated E2E checks and assertions (including Python egress probe
behavior) and adjusted scenario/support-matrix expectations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
Restore issue NVIDIA#5800 parity package `P0-E` for merged bash-suite deltas
only.

## Related Issues
Refs NVIDIA#5800
Refs NVIDIA#5098
Refs NVIDIA#5197
Refs NVIDIA#5245
Refs NVIDIA#5508
Refs NVIDIA#5587

## Scope gate
- Package: `P0-E — Platform, tunnel, cloud-experimental, and docs parity
decisions`
- Included PRs all merged and touched `test/e2e`: yes — NVIDIA#5197, NVIDIA#5245,
NVIDIA#5508, NVIDIA#5587
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR NVIDIA#5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| E1 | NVIDIA#5197 | Deep Agents Code cloud-experimental Landlock check:
`.deepagents` and `/tmp` writable, `/usr` and `/etc` read-only. |
`hosted-compatible capable` |
`ubuntu-repo-cloud-langchain-deepagents-code` live scenario now runs
`05-deepagents-code-landlock-readonly.sh` after onboarding. | covered |
| E2 | NVIDIA#5197 | Deep Agents Code arbitrary Python egress permits
GitHub/PyPI and blocks Tavily/LangSmith/MCP/example.com absent explicit
policy. | `hosted-compatible capable` |
`ubuntu-repo-cloud-langchain-deepagents-code` live scenario now runs
`06-deepagents-code-python-egress.sh` after onboarding. | covered |
| E3 | NVIDIA#5245 | Trace timing signal is trusted summary only; raw
target-controlled traces are not uploaded. | `none` | Existing
`test/e2e-script-workflow.test.ts` and sanitizer tests cover trusted
trace summary, scorecard comparison, and redaction boundary. | covered |
| E4 | NVIDIA#5508 | GPU Local Ollama small-context config carries reduced
OpenClaw compaction reserve. | `none` / local inference |
`test/e2e-scenario/live/gpu-e2e.test.ts` now reads
`/sandbox/.openclaw/openclaw.json` and asserts `reserveTokens` /
`reserveTokensFloor` for small windows. | covered |
| E5 | NVIDIA#5508 | Interactive OpenClaw TUI first turn must not fail
auto-compaction. | `none` / local inference | No Vitest TUI fixture
exists yet; config-level assertion covers the deterministic contract and
the interactive smoke remains platform/manual-runner follow-up. Owner:
NemoClaw maintainers; date: 2026-06-25; tracked in NVIDIA#5800 closeout. |
waived/follow-up |
| E6 | NVIDIA#5587 | Cloudflared exact-version override validates Debian
version syntax before APT install. | `hosted-compatible capable` for
live tunnel job; resolver itself `none` | Existing
`test/cloudflared-version-resolver.test.ts`; tunnel workflow boundary
already requires resolver use before `apt-get install
cloudflared=${cf_version}`. | covered |

## Inference mode support
- Default mode for touched live targets: `hosted-compatible capable` for
Deep Agents Code and tunnel lifecycle; local Ollama/GPU uses local
inference; trace/resolver tests are `none`.
- Real inference support preserved: yes for Deep Agents Code scenario
via `NVIDIA_INFERENCE_API_KEY`; yes for tunnel lifecycle via existing
hosted-compatible route; local Ollama GPU remains local inference.
- Modes validated in this PR: local unit/support tests plus live
scenario selection without secret; selective hosted/GPU workflow
dispatch required after PR opens.
- If not validated with real inference: local machine lacks
`NVIDIA_INFERENCE_API_KEY`, GPU runner, and Docker daemon; selective
GitHub Actions will validate runner/secret boundaries.

## Validation
- [x] `npm run build:cli`
- [x] `npx vitest run
test/e2e-scenario/support-tests/e2e-scenario-matrix.test.ts
test/e2e-scenario/support-tests/e2e-scenario-registry.test.ts
test/langchain-deepagents-code-image.test.ts
test/ollama-local-openclaw-config-propagation.test.ts
test/cloudflared-version-resolver.test.ts --silent=false
--reporter=default`
- [x] `NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project
e2e-scenarios-live test/e2e-scenario/live/registry-scenarios.test.ts -t
'^ubuntu-repo-cloud-langchain-deepagents-code$' --silent=false
--reporter=verbose` (local result: skipped due missing
`NVIDIA_INFERENCE_API_KEY`, confirms scenario wiring)
- [ ] hosted/public selective E2E workflow, if required by
classification: pending PR dispatch

## Follow-ups / waivers
- E5: Interactive TUI first-turn smoke remains waived until a Vitest TUI
fixture exists. Owner: NemoClaw maintainers; date: 2026-06-25;
deterministic config contract is covered here.


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

* **New Features**
* Added a new cloud onboarding path for LangChain Deep Agents Code,
including dedicated fixtures and live scenario coverage.
* Surfaced new “cloud experimental” checks in live run planning and
scenario matrix output.
* **Bug Fixes**
* Improved GPU live E2E validation by asserting the reserve-token
compaction policy.
* Updated Deep Agents Code expected gateway health handling to be
optional.
* **Security/Policy**
* Expanded Deep Agents Code Python egress allowlists for approved
GitHub/PyPI hosts.
* **Tests**
* Updated E2E checks and assertions (including Python egress probe
behavior) and adjusted scenario/support-matrix expectations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Carlos Villela <cvillela@nvidia.com>
cv pushed a commit that referenced this pull request Aug 10, 2026
)

## Summary

A fresh DCode sandbox has no `dos2unix`, while OpenClaw and Hermes
sandboxes do. This adds the package to the Deep Agents Code base image
with the same pinned form the other two images already use.

## Related Issue

Closes #8691

## Root Cause

`dos2unix` reached the OpenClaw and Hermes base images in #3091
(2026-05-07) as a plain-apt entry.
`agents/langchain-deepagents-code/Dockerfile.base` was created 46 days
later in #5197 (2026-06-22), so it never inherited that line. #7563 then
moved the DCode image onto the same reviewed-artifact boundary and
carried the snapshot-pinned `jq` and `vim-tiny` packages across — but
not the plain-apt `dos2unix`.

That is exactly the reported probe output: `vi: OK`, `jq: OK`,
`dos2unix: MISSING`. The two utilities that travelled arrive through the
checksum-pinned snapshot path; the one that did not travel is the only
one installed through plain apt.

## Changes

- `agents/langchain-deepagents-code/Dockerfile.base`: add
`"dos2unix=7.5.2-1*"` to the runtime apt layer, immediately after
`e2fsprogs`, mirroring the position and pin used at
`Dockerfile.base:130` and `agents/hermes/Dockerfile.base:105`.
- `test/sandbox-base-security-packages.test.ts`: run the runtime apt
layer of each managed base image and assert on the `apt-get install`
invocation it actually issues. Parameterized over all three images and
both architectures (6 cases), so it fails when an image stops installing
the utility rather than only when the literal string leaves the
Dockerfile. Verified to have teeth: deleting the pin from the Deep
Agents Code base fails exactly the two Deep Agents Code cases and leaves
the other four passing.

The version pin transfers verbatim because the DCode runtime stage uses
a base image digest byte-identical to OpenClaw's
(`node:22-trixie-slim@sha256:e6d9a389...`).

## The wildcard is required, not stylistic

Debian trixie ships `dos2unix` as `7.5.2-1` on amd64 but as the binNMU
`7.5.2-1+b1` on arm64. An exact `dos2unix=7.5.2-1` pin builds on amd64
and fails on arm64 — the reporter's own platform (Jetson Thor).

## Two-architecture install evidence

The patched runtime apt layer was built and run on both architectures
from the pinned base image. This is a real install and a real
conversion, not an `apt-get -s` simulation.

```text
# amd64 — reporter's exact probe command
ps: OK   top: OK   free: OK   uptime: OK   vmstat: OK   dos2unix: OK
dos2unix 7.5.2 (2024-01-22)
printf 'a\r\nb\r\n' | dos2unix  ->  od -c: 0000000   a  \n   b  \n

# arm64 — the reporter's platform
dpkg --print-architecture: arm64
command -v dos2unix: /usr/bin/dos2unix
installed version: 7.5.2-1+b1
printf 'x\r\ny\r\n' | dos2unix  ->  od -c: 0000000   x  \n   y  \n
```

For contrast, the exact pin fails on arm64 at resolution time:

```text
arm64: E: Version '7.5.2-1' for 'dos2unix' was not found
```

Both architectures report `0 upgraded, 1 newly installed` — the package
pulls no transitive dependencies, so image surface grows by `dos2unix`
alone.

## Deliberately not changed

- **Security-package inventory.** `dos2unix` is a plain apt package, not
one of the 10 snapshot/rebuilt debs. OpenClaw installs it yet omits it
from that inventory, and `test/sandbox-base-security-packages.test.ts`
asserts the inventory with an exact `toEqual` — adding an entry there
would break the contract.
- **Docs.** `docs/deployment/sandbox-hardening.mdx:20` is the repo's
only `dos2unix` prose. It declares `agent-variants: ["openclaw"]`, so it
does not formally cover DCode today. After this change that sentence is
true of all three images, so no doc text is left needing correction.
Extending the page's variant scope needs a matching `docs/index.yml`
entry and a new `configure-sandboxes` slug in the deepagents tree, or
`scripts/sync-agent-variant-docs.mts` hard-fails — a separate change
that equally affects Hermes.

## Type of Change

- [x] 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

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: the only `dos2unix` prose is
`docs/deployment/sandbox-hardening.mdx:20`, which is `agent-variants:
["openclaw"]` scoped. This change makes that existing sentence true of
all three images rather than requiring new or corrected text. Extending
the page to the deepagents variant is a separate change that equally
affects Hermes.
- [x] 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: requesting maintainer
review. The change adds one Debian-pinned utility to the DCode sandbox
base apt layer. It installs no setuid binaries and pulls no transitive
dependencies on either architecture; it does not touch the reviewed
snapshot/checksum path, the security-package inventory, capabilities, or
network policy.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [ ] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: no documentation paths changed. The repo's only `dos2unix`
prose is `docs/deployment/sandbox-hardening.mdx:20`, which this change
makes accurate for all three managed images rather than requiring an
edit.
- Agent: Claude Code

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed
- [x] Targeted behavior tests pass for the current change set — `npx
vitest run` over the base-image surface: 13 files, 184 tests passing
(`sandbox-base-runtime-tools`, `sandbox-base-security-packages`,
`dcode-base-image-workflow`,
`langchain-deepagents-code-profile-build-gate`,
`base-image-publication`, `src/lib/sandbox-base-image/**`,
`deep-agents-code-base-image`)
- [ ] Applicable broad gate passed — not applicable; this is a
single-package Dockerfile change, not a broad runtime or test-harness
change
- [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)
- [ ] Doc pages follow the style guide (doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

Additional checks run locally:

- `hadolint 2.14.0` (the checksum-pinned CI version) on the edited
Dockerfile: exit 0, zero findings. `DL3008` is active — the quoted
wildcard satisfies it.
- `npm run typecheck`: clean.
- Two-architecture build and probe of the patched apt layer, as quoted
above.

**CI timing note for reviewers:** PR CI does not build the edited file.
`base-image.yaml` triggers on push-to-main, `v*` tags, and
`workflow_dispatch` only. The `managed-images.yaml` pull_request lane
fires on `agents/**` but resolves the already-published
`langchain-deepagents-code-sandbox-base:latest` and builds only
`agents/langchain-deepagents-code/Dockerfile` — it completed in about a
minute on this PR, which is consistent with no base build. The
`pr-self-hosted.yaml` `build-sandbox-images` jobs likewise resolve the
published base and build the production `Dockerfile`. The
two-architecture evidence above stands in for that gap; happy to trigger
a `workflow_dispatch` base build if you want a real in-CI build before
merge.

Signed-off-by: Dongni Yang <dongniy@nvidia.com>


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

## Summary by CodeRabbit

* **New Features**
* Added `dos2unix` to the runtime environment for supported security
images and architectures.

* **Tests**
* Added coverage to verify successful installation of the expected
`dos2unix` package version.

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

---------

Signed-off-by: Dongni Yang <dongniy@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration: dcode LangChain Deep Code integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants