Skip to content

fix(dcode): enforce empty prompt exit contract - #6441

Merged
cv merged 2 commits into
mainfrom
fix/dcode-empty-prompt-exit-6440
Jul 8, 2026
Merged

fix(dcode): enforce empty prompt exit contract#6441
cv merged 2 commits into
mainfrom
fix/dcode-empty-prompt-exit-6440

Conversation

@ericksoa

@ericksoa ericksoa commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Enforces the existing dcode -n "" exit-code contract across final image assembly, terminal-agent readiness, and live login/direct execution. Clean v0.0.75 and current arm64 builds already return the canonical diagnostic with exit 2, so this change closes the acceptance gap by rejecting stale or misassembled images instead of rewriting the wrapper's existing exit 2 guard.

Related Issue

Fixes #6440

Changes

  • Fail the DCode image build and terminal-agent smoke check unless dcode -n "" returns exit 2 with the canonical diagnostic, with bounded timeouts.
  • Exercise the wrapper through the installed launcher chain and model the reported correct-message/exit-0 regression explicitly.
  • Require both login-shell and direct-exec empty-prompt rejection in the live DCode E2E check.

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: this restores the established invalid-input exit contract; no command, flag, configuration, or workflow changed.
  • 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: pending maintainer review; no waiver claimed.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: no acceptance claimed; required CI must pass.

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: 38 CLI tests and 88 integration tests passed; focused live ubuntu-repo-cloud-langchain-deepagents-code E2E passed on exact head in run 28917811899, attempt 2.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: exact-head GitHub CI passed all five CLI test shards, installer integration, plugin tests, static checks, build/typecheck, and the cli-tests aggregate at 2a8d0cac.
  • 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)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Aaron Erickson aerickson@nvidia.com

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa added NV QA Bugs found by the NVIDIA QA Team area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior labels Jul 8, 2026
@ericksoa ericksoa self-assigned this Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an "empty non-interactive prompt" exit-code contract check for dcode -n "" across the Deep Agents Code image build, manifest smoke commands, onboarding fixtures, CLI sandbox stubs, and e2e/unit tests, verifying exit code 2 and the exact error message are preserved end-to-end.

Changes

Empty-prompt exit contract enforcement

Layer / File(s) Summary
Build-time and manifest probes
agents/langchain-deepagents-code/Dockerfile, agents/langchain-deepagents-code/manifest.yaml
Dockerfile build step and manifest smoke command both run dcode -n "" and assert exit code 2 with the expected error message.
Onboarding smoke marker propagation
src/lib/agent/onboard-terminal-fixtures.ts, src/lib/agent/onboard-terminal-fixtures.test.ts, src/lib/agent/defs.test.ts
Fixture handler recognizes a new NEMOCLAW_DCODE_EMPTY_PROMPT_OK marker returning a NEMOCLAW_AGENT_SMOKE_EXIT:0 contract, and tests assert this behavior plus the new manifest smoke command entry.
CLI sandbox smoke assertion
test/cli/connect-terminal-agent.test.ts
Updates openshell stub and adds an assertion that probe-only connect calls include the empty-prompt smoke check.
Wrapper and launcher exit-code tests
test/dcode-wrapper-empty-prompt.test.ts, test/langchain-deepagents-code-proxy-launcher.test.ts
Replaces platform-gated fixture detection with a bash/python3 availability check, adds a stubbed dcode/timeout suite validating smoke-command acceptance logic, and adds a launcher test confirming exit 2 and expected stderr through the installed launcher/wrapper chain.
E2E headless inference verification
test/e2e/e2e-cloud-experimental/checks/07-deepagents-code-headless-inference.sh, test/langchain-deepagents-code-image.test.ts
E2E script checks empty-prompt rejection via login-shell and direct-exec paths, includes captured output in the secret leak scan, and the image test asserts the generated script contains the new exit-code assertions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: area: integrations, area: e2e

Suggested reviewers: cv, brandonpelfrey

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address #6440 by making empty-prompt dcode runs return exit code 2 and preserving the canonical error message across runtime paths.
Out of Scope Changes check ✅ Passed The added tests and image/runtime plumbing all support the same empty-prompt regression fix, with no unrelated changes evident.
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 The title clearly matches the main change: enforcing the dcode empty-prompt exit contract.
✨ 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 fix/dcode-empty-prompt-exit-6440

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

@github-code-quality

github-code-quality Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the fix/dcode-empty-prom... 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 fix/dcode-empty-prom... 2a8d0ca +/-
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 fix/dcode-empty-prom... branch is 76%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix/dcode-empty-prom... 2a8d0ca +/-
src/lib/onboard/preflight.ts 82%
src/lib/state/o...oard-session.ts 82%
src/lib/actions...all/run-plan.ts 81%
src/lib/actions...licy-channel.ts 79%
src/lib/actions...box/snapshot.ts 79%
src/lib/state/sandbox.ts 75%
src/lib/onboard...er-gpu-patch.ts 69%
src/lib/policy/index.ts 65%
src/lib/shields/index.ts 61%
src/lib/onboard.ts 28%

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

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Consider PRA-1: Manifest smoke command uses complex inline shell that could be brittle.
Open items: 0 required · 0 warnings · 1 suggestion · 0 test follow-ups
Since last review: 1 prior item resolved · 0 still apply · 3 new items found

Action checklist

  • PRA-1 In-scope improvement: Manifest smoke command uses complex inline shell that could be brittle in agents/langchain-deepagents-code/manifest.yaml:18

Findings index

ID Severity Category Location Required action
PRA-1 Improvement correctness agents/langchain-deepagents-code/manifest.yaml:18 Extract this to a small helper script in the agent directory (e.g., `check-empty-prompt.sh`) and call it from the manifest. This improves readability and debuggability. Not a blocker for merge.
Review findings by urgency: 0 required fixes, 0 items to resolve/justify, 1 in-scope improvement

⚠️ 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.

  • None.

💡 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-1 Improvement — Manifest smoke command uses complex inline shell that could be brittle

  • Location: agents/langchain-deepagents-code/manifest.yaml:18
  • Category: correctness
  • Problem: The new smoke command `empty_prompt=; output="$(timeout 10 dcode -n "$empty_prompt" 2>&1)"; status=$?; [ "$status" -eq 2 ] && [ "$output" = "NemoClaw: empty non-interactive prompt for -n; provide prompt text." ] && echo NEMOCLAW_DCODE_EMPTY_PROMPT_OK` is a long inline shell pipeline. While it works, it's harder to debug and maintain than a dedicated script. The existing smoke commands are simpler.
  • Impact: Maintainability risk — complex inline shell is harder to debug when the smoke check fails in CI or during onboarding. A dedicated helper script would improve readability and allow independent testing.
  • Suggested action: Extract this to a small helper script in the agent directory (e.g., `check-empty-prompt.sh`) and call it from the manifest. This improves readability and debuggability. Not a blocker for merge.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Inspect manifest.yaml line 18-19 and compare with the simpler smoke commands above it.
  • Missing regression test: The e2e check (07-deepagents-code-headless-inference.sh lines 105-125) and proxy-launcher test (test/langchain-deepagents-code-proxy-launcher.test.ts lines 70-100) already cover the behavior more robustly than the manifest smoke command.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: manifest.yaml line 18: 'empty_prompt=; output="$(timeout 10 dcode -n "$empty_prompt" 2>&1)"; status=$?; [ "$status" -eq 2 ] && [ "$output" = "NemoClaw: empty non-interactive prompt for -n; provide prompt text." ] && echo NEMOCLAW_DCODE_EMPTY_PROMPT_OK'
Simplification opportunities: 1 possible cut

These are safe simplification checks only. Do not remove validation, security controls, data-loss prevention, or required tests.

  • PRA-1 shrink (agents/langchain-deepagents-code/manifest.yaml:18): Inline shell pipeline in manifest.yaml smoke_commands array
    • Replacement: Dedicated helper script `agents/langchain-deepagents-code/check-empty-prompt.sh` called from manifest
    • Net: 5 lines
    • Safety boundary: Must preserve exact exit code 2 and exact error message validation; helper script must be copied into image and made executable
Since last review details

Current findings, using the urgency labels above:

PRA-1 Improvement — Manifest smoke command uses complex inline shell that could be brittle

  • Location: agents/langchain-deepagents-code/manifest.yaml:18
  • Category: correctness
  • Problem: The new smoke command `empty_prompt=; output="$(timeout 10 dcode -n "$empty_prompt" 2>&1)"; status=$?; [ "$status" -eq 2 ] && [ "$output" = "NemoClaw: empty non-interactive prompt for -n; provide prompt text." ] && echo NEMOCLAW_DCODE_EMPTY_PROMPT_OK` is a long inline shell pipeline. While it works, it's harder to debug and maintain than a dedicated script. The existing smoke commands are simpler.
  • Impact: Maintainability risk — complex inline shell is harder to debug when the smoke check fails in CI or during onboarding. A dedicated helper script would improve readability and allow independent testing.
  • Suggested action: Extract this to a small helper script in the agent directory (e.g., `check-empty-prompt.sh`) and call it from the manifest. This improves readability and debuggability. Not a blocker for merge.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Inspect manifest.yaml line 18-19 and compare with the simpler smoke commands above it.
  • Missing regression test: The e2e check (07-deepagents-code-headless-inference.sh lines 105-125) and proxy-launcher test (test/langchain-deepagents-code-proxy-launcher.test.ts lines 70-100) already cover the behavior more robustly than the manifest smoke command.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: manifest.yaml line 18: 'empty_prompt=; output="$(timeout 10 dcode -n "$empty_prompt" 2>&1)"; status=$?; [ "$status" -eq 2 ] && [ "$output" = "NemoClaw: empty non-interactive prompt for -n; provide prompt text." ] && echo NEMOCLAW_DCODE_EMPTY_PROMPT_OK'

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.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: ubuntu-repo-cloud-langchain-deepagents-code
Optional E2E: None

Dispatch hint: targets=ubuntu-repo-cloud-langchain-deepagents-code

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • ubuntu-repo-cloud-langchain-deepagents-code (high): Required because the PR changes the Deep Agents Code image, manifest smoke commands, terminal-agent readiness behavior, and the live headless inference acceptance check. This target builds/onboards a real LangChain Deep Agents Code sandbox and runs the Deep Agents policy/terminal/inference checks, including 07-deepagents-code-headless-inference.sh.

Optional E2E

  • None.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: targets=ubuntu-repo-cloud-langchain-deepagents-code

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: ubuntu-repo-cloud-langchain-deepagents-code
Optional E2E targets: None

Dispatch required E2E targets:

  • gh workflow run e2e.yaml --ref <pr-head-ref> --field targets=ubuntu-repo-cloud-langchain-deepagents-code

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E targets

  • ubuntu-repo-cloud-langchain-deepagents-code: The PR changes the LangChain Deep Agents Code Docker image, agent manifest smoke contract, terminal-agent onboarding fixture behavior, and the Deep Agents Code headless inference E2E check. The live-supported typed target ubuntu-repo-cloud-langchain-deepagents-code is the smallest registry target that builds/onboards the Deep Agents Code sandbox and exercises its terminal-agent, policy, and inference acceptance surface.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field targets=ubuntu-repo-cloud-langchain-deepagents-code

Optional E2E targets

  • None.

Relevant changed files

  • agents/langchain-deepagents-code/Dockerfile
  • agents/langchain-deepagents-code/manifest.yaml
  • src/lib/agent/onboard-terminal-fixtures.ts
  • test/e2e/e2e-cloud-experimental/checks/07-deepagents-code-headless-inference.sh

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: No advisor follow-up required beyond maintainer review.
Open items: 0 required · 0 warnings · 0 suggestions · 0 test follow-ups
Since last review: 0 prior items resolved · 0 still apply · 0 new items found

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 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28917811899
Workflow ref: fix/dcode-empty-prompt-exit-6440
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: 0 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
live ❌ failure

Failed jobs: live. Check run artifacts for logs.

@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 (1)
src/lib/agent/onboard-terminal-fixtures.test.ts (1)

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

Consider adding the local issue-reference suffix to the test title.

The sibling contract test in this PR stack (test/dcode-wrapper-empty-prompt.test.ts) tags its empty-prompt describe block with (#6440). This new test title omits that reference, which is inconsistent with the established convention for this feature.

As per coding guidelines, "Write behavior-oriented test titles, and put local issue references in a final (#1234) suffix."

🤖 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/onboard-terminal-fixtures.test.ts` at line 158, The
empty-prompt smoke test title in the on-board terminal fixtures suite is missing
the local issue-reference suffix, which should match the established naming
convention used by the sibling empty-prompt contract test. Update the `it(...)`
title in `onboard-terminal-fixtures.test.ts` to include the final
`(`#1234`)`-style suffix, keeping the title behavior-oriented and consistent with
the existing `test/dcode-wrapper-empty-prompt.test.ts` pattern.

Source: Coding guidelines

🤖 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 `@test/dcode-wrapper-empty-prompt.test.ts`:
- Around line 20-37: Add a Bash 4+ availability check in wrapperFixtureCanRun
before enabling the fixture, because dcode-wrapper.sh relies on Bash-specific
lowercase expansion and can break on older macOS bash 3.2. Update the helper to
validate the version returned by bash --version (or equivalent) is at least 4,
alongside the existing python3 check, and only set canRun when both
prerequisites are satisfied.

---

Nitpick comments:
In `@src/lib/agent/onboard-terminal-fixtures.test.ts`:
- Line 158: The empty-prompt smoke test title in the on-board terminal fixtures
suite is missing the local issue-reference suffix, which should match the
established naming convention used by the sibling empty-prompt contract test.
Update the `it(...)` title in `onboard-terminal-fixtures.test.ts` to include the
final `(`#1234`)`-style suffix, keeping the title behavior-oriented and consistent
with the existing `test/dcode-wrapper-empty-prompt.test.ts` pattern.
🪄 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: d3634e5a-f7e6-4e30-8d79-b30c9afece37

📥 Commits

Reviewing files that changed from the base of the PR and between be3e7cc and 5cb86b4.

📒 Files selected for processing (10)
  • agents/langchain-deepagents-code/Dockerfile
  • agents/langchain-deepagents-code/manifest.yaml
  • src/lib/agent/defs.test.ts
  • src/lib/agent/onboard-terminal-fixtures.test.ts
  • src/lib/agent/onboard-terminal-fixtures.ts
  • test/cli/connect-terminal-agent.test.ts
  • test/dcode-wrapper-empty-prompt.test.ts
  • test/e2e/e2e-cloud-experimental/checks/07-deepagents-code-headless-inference.sh
  • test/langchain-deepagents-code-image.test.ts
  • test/langchain-deepagents-code-proxy-launcher.test.ts

Comment thread test/dcode-wrapper-empty-prompt.test.ts Outdated
Comment on lines +20 to +37
import { loadAgent } from "../src/lib/agent/defs";

const AGENT_DIR = path.join(import.meta.dirname, "..", "agents", "langchain-deepagents-code");
const WRAPPER = path.join(AGENT_DIR, "dcode-wrapper.sh");
const EMPTY_PROMPT_DIAGNOSTIC =
"NemoClaw: empty non-interactive prompt for -n; provide prompt text.";

function python3Available(): boolean {
function wrapperFixtureCanRun(): boolean {
try {
return spawnSync("python3", ["--version"], { timeout: 5000 }).status === 0;
return (
spawnSync("bash", ["--version"], { timeout: 5000 }).status === 0 &&
spawnSync("python3", ["--version"], { timeout: 5000 }).status === 0
);
} catch {
return false;
}
}
const canRun = process.platform === "linux" && python3Available();
const canRun = wrapperFixtureCanRun();

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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check dcode-wrapper.sh for bash4+-only constructs
fd dcode-wrapper.sh agents/langchain-deepagents-code --exec rg -n 'mapfile|readarray|declare -A|local -n|\$\{[A-Za-z_]+,,\}|\$\{[A-Za-z_]+\^\^\}' {}

Repository: NVIDIA/NemoClaw

Length of output: 212


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the relevant wrapper section and any other bash-4+ syntax in the script.
script=agents/langchain-deepagents-code/dcode-wrapper.sh

printf '\n== around lowercasing usages ==\n'
sed -n '620,670p' "$script" | cat -n

printf '\n== broader bash-4+ feature search ==\n'
rg -n '\$\{[A-Za-z_][A-Za-z0-9_]*,,\}|\$\{[A-Za-z_][A-Za-z0-9_]*\^\^\}|mapfile|readarray|declare -A|local -n' "$script"

Repository: NVIDIA/NemoClaw

Length of output: 2353


Require a bash 4+ check here. dcode-wrapper.sh already uses ${var,,}, so this fixture can fail on macOS’s stock bash 3.2 unless a newer bash is guaranteed on PATH.

🤖 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 `@test/dcode-wrapper-empty-prompt.test.ts` around lines 20 - 37, Add a Bash 4+
availability check in wrapperFixtureCanRun before enabling the fixture, because
dcode-wrapper.sh relies on Bash-specific lowercase expansion and can break on
older macOS bash 3.2. Update the helper to validate the version returned by bash
--version (or equivalent) is at least 4, alongside the existing python3 check,
and only set canRun when both prerequisites are satisfied.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 28917811899
Workflow ref: fix/dcode-empty-prompt-exit-6440
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

@ericksoa ericksoa added v0.0.77 platform: dgx-spark Affects DGX Spark hardware or workflows area: packaging Packages, images, registries, installers, or distribution labels Jul 8, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the current head. The empty-prompt exit-2 contract is enforced across image build, manifest smoke, direct-exec, and login-shell acceptance paths with focused regression coverage. The previously cancelled commit-lint run was rerun successfully; current-head CI, live E2E, advisors, and contributor-compliance gates are green.

@ericksoa ericksoa added v0.0.78 and removed v0.0.77 labels Jul 8, 2026
@cv
cv merged commit a5150a1 into main Jul 8, 2026
207 of 209 checks passed
@cv
cv deleted the fix/dcode-empty-prompt-exit-6440 branch July 8, 2026 19:12
@cv cv mentioned this pull request Jul 8, 2026
21 tasks
cv added a commit that referenced this pull request Jul 9, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Adds a shared deterministic regression risk plan for the PR head commit
and changed-file set to PR Review Advisor and E2E Advisor. Known
high-risk runtime surfaces now restore a reviewed floor of required E2E
jobs even when a model omits or downgrades them.

Execution is intentionally separated from plan generation: stacked
follow-up #6447 consumes this contract in a trusted post-merge shadow
gate without exposing repository secrets to unmerged code.

PR Review Advisor analysis is split into seven bounded, evidence-focused
turns with completion logs and per-turn response artifacts, improving
review visibility and traceability while preserving one read-only
session and the existing final JSON/comment contract.

The seven stages now live in one ordered array. Stage names, evidence,
prompt text, runtime numbering, and artifact ordering derive from that
single declaration instead of parallel hard-coded topology.

## Changes

- Add a stable risk-plan contract with lifecycle, upgrade, agent,
inference, messaging, platform, credential, and security invariants.
- Keep the canonical cloud-onboard live target in the platform-install
floor through an explicit test-file allowlist, while ordinary tests
remain excluded.
- Feed the plan into PR Review Advisor scope/risk, security/trust, and
tests/regressions contexts and both E2E Advisor normalizers.\n-
Deduplicate optional recommendations against deterministic required jobs
by both selector ID and workflow job.
- Clarify commit references in advisor, E2E, and security-review
documentation.
- Emit `risk-plan.json` from both E2E Advisor lanes with a plan hash,
required jobs, capped automatic candidates, and manual-expansion state;
PR Review Advisor exposes the same plan through its scoped context
artifacts.
- Replace four uneven advisor turns with seven bounded stages:
scope/risk, correctness/state, security/trust, tests/regressions,
CI/operations, reconciliation, and final synthesis.
- Derive turn numbering and prompt-artifact ordering from the ordered
stage declaration, and remove five duplicate standalone context JSONs
while retaining the same evidence in per-stage synthetic-tool artifacts.
- Log every turn boundary and persist each settled response immediately,
including partial output and failure/timeout status, while treating
missing trace artifacts as fatal.
- Leave live enforcement to stacked follow-up #6447 so this PR remains a
reviewable deterministic planning primitive.
- Remove unused PR-advisor check-wait configuration and align
contributor-facing documentation with actual workflow behavior.
- Add focused normalization, prompt, risk-mapping, workflow-inventory,
and review-depth regression tests.

## 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
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [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: Internal CI/advisor behavior
only; contributor-facing tool and E2E documentation was updated, with no
Fern user documentation required.
- [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: Automated and local
security review confirmed the deterministic floor is additive, bound to
the PR head commit and changed-file set, capped, and does not itself
execute secret-bearing live E2E work; enforcement is isolated in #6447.
- [ ] 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 — 112 focused risk-plan, PR-advisor,
E2E-advisor, workflow-boundary, and maintainer-policy tests passed; the
E2E-advisor suite was rerun after the final normalization fix (7/7); CLI
typechecking, Biome, test-size, and Vitest project-membership checks
passed
- [ ] Applicable broad gate passed — CI for PR head commit `9700a6ba`
has 39 successful checks and 2 expected skips. `static-checks` fails
only because merged #6441 left
`test/langchain-deepagents-code-image.test.ts` at 1501 lines against the
1500-line mainline ceiling; aggregate `checks` mirrors that failure. The
repair is tracked in #6493.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [x] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.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: Carlos Villela <cvillela@nvidia.com>

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
<!-- 1-3 sentences: what this PR does and why. -->
Enforces the existing `dcode -n ""` exit-code contract across final
image assembly, terminal-agent readiness, and live login/direct
execution. Clean v0.0.75 and current arm64 builds already return the
canonical diagnostic with exit 2, so this change closes the acceptance
gap by rejecting stale or misassembled images instead of rewriting the
wrapper's existing `exit 2` guard.

## Related Issue
<!-- Fixes #NNN or Closes #NNN. Remove this section if none. -->
Fixes NVIDIA#6440

## Changes
<!-- Bullet list of key changes. -->

- Fail the DCode image build and terminal-agent smoke check unless
`dcode -n ""` returns exit 2 with the canonical diagnostic, with bounded
timeouts.
- Exercise the wrapper through the installed launcher chain and model
the reported correct-message/exit-0 regression explicitly.
- Require both login-shell and direct-exec empty-prompt rejection in the
live DCode E2E check.

## 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
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [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: this restores the established
invalid-input exit contract; no command, flag, configuration, or
workflow changed.
- [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: pending maintainer
review; no waiver claimed.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue: no acceptance claimed;
required CI must pass.

## 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: 38
CLI tests and 88 integration tests passed; focused live
`ubuntu-repo-cloud-langchain-deepagents-code` E2E passed on exact head
in [run 28917811899, attempt
2](https://github.com/NVIDIA/NemoClaw/actions/runs/28917811899/attempts/2).
- [x] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: exact-head GitHub CI
passed all five CLI test shards, installer integration, plugin tests,
static checks, build/typecheck, and the `cli-tests` aggregate at
`2a8d0cac`.
- [ ] 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](https://github.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>

---------

Signed-off-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
Adds a shared deterministic regression risk plan for the PR head commit
and changed-file set to PR Review Advisor and E2E Advisor. Known
high-risk runtime surfaces now restore a reviewed floor of required E2E
jobs even when a model omits or downgrades them.

Execution is intentionally separated from plan generation: stacked
follow-up NVIDIA#6447 consumes this contract in a trusted post-merge shadow
gate without exposing repository secrets to unmerged code.

PR Review Advisor analysis is split into seven bounded, evidence-focused
turns with completion logs and per-turn response artifacts, improving
review visibility and traceability while preserving one read-only
session and the existing final JSON/comment contract.

The seven stages now live in one ordered array. Stage names, evidence,
prompt text, runtime numbering, and artifact ordering derive from that
single declaration instead of parallel hard-coded topology.

## Changes

- Add a stable risk-plan contract with lifecycle, upgrade, agent,
inference, messaging, platform, credential, and security invariants.
- Keep the canonical cloud-onboard live target in the platform-install
floor through an explicit test-file allowlist, while ordinary tests
remain excluded.
- Feed the plan into PR Review Advisor scope/risk, security/trust, and
tests/regressions contexts and both E2E Advisor normalizers.\n-
Deduplicate optional recommendations against deterministic required jobs
by both selector ID and workflow job.
- Clarify commit references in advisor, E2E, and security-review
documentation.
- Emit `risk-plan.json` from both E2E Advisor lanes with a plan hash,
required jobs, capped automatic candidates, and manual-expansion state;
PR Review Advisor exposes the same plan through its scoped context
artifacts.
- Replace four uneven advisor turns with seven bounded stages:
scope/risk, correctness/state, security/trust, tests/regressions,
CI/operations, reconciliation, and final synthesis.
- Derive turn numbering and prompt-artifact ordering from the ordered
stage declaration, and remove five duplicate standalone context JSONs
while retaining the same evidence in per-stage synthetic-tool artifacts.
- Log every turn boundary and persist each settled response immediately,
including partial output and failure/timeout status, while treating
missing trace artifacts as fatal.
- Leave live enforcement to stacked follow-up NVIDIA#6447 so this PR remains a
reviewable deterministic planning primitive.
- Remove unused PR-advisor check-wait configuration and align
contributor-facing documentation with actual workflow behavior.
- Add focused normalization, prompt, risk-mapping, workflow-inventory,
and review-depth regression tests.

## 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
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [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: Internal CI/advisor behavior
only; contributor-facing tool and E2E documentation was updated, with no
Fern user documentation required.
- [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: Automated and local
security review confirmed the deterministic floor is additive, bound to
the PR head commit and changed-file set, capped, and does not itself
execute secret-bearing live E2E work; enforcement is isolated in NVIDIA#6447.
- [ ] 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 — 112 focused risk-plan, PR-advisor,
E2E-advisor, workflow-boundary, and maintainer-policy tests passed; the
E2E-advisor suite was rerun after the final normalization fix (7/7); CLI
typechecking, Biome, test-size, and Vitest project-membership checks
passed
- [ ] Applicable broad gate passed — CI for PR head commit `9700a6ba`
has 39 successful checks and 2 expected skips. `static-checks` fails
only because merged NVIDIA#6441 left
`test/langchain-deepagents-code-image.test.ts` at 1501 lines against the
1500-line mainline ceiling; aggregate `checks` mirrors that failure. The
repair is tracked in NVIDIA#6493.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [x] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.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: Carlos Villela <cvillela@nvidia.com>

---------

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

Labels

area: cli Command line interface, flags, terminal UX, or output area: packaging Packages, images, registries, installers, or distribution bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior NV QA Bugs found by the NVIDIA QA Team platform: dgx-spark Affects DGX Spark hardware or workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DGX Spark][CLI&UX] dcode -n "" exits 0 instead of non-zero — regression of #5752

3 participants