Skip to content

fix(snapshot): strip OpenShell exec framing in dcode idleness probe - #6190

Closed
laitingsheng wants to merge 5 commits into
mainfrom
fix/dcode-snapshot-idle-probe
Closed

fix(snapshot): strip OpenShell exec framing in dcode idleness probe#6190
laitingsheng wants to merge 5 commits into
mainfrom
fix/dcode-snapshot-idle-probe

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

On OpenShell 0.0.71 the nemoclaw <name> snapshot create preflight refused every idle LangChain Deep Agents Code sandbox with Cannot verify whether sandbox '<name>' is actively running a dcode task, blocking snapshot creation entirely. The dcode idleness guard parsed the raw openshell sandbox exec output with an anchored sentinel regex, but this OpenShell build frames child stdout as stdout: <line>, so the sentinel never matched and the guard failed closed on an idle sandbox.

Related Issue

Fixes #6180

Changes

  • src/lib/actions/sandbox/snapshot.ts: route the dcode idleness probe through the shared marked-command and stdout-normalization helpers so OpenShell framing is removed before parsing. Probe output is parsed only after a zero-status exec completion; non-zero status, transport errors, missing or duplicate markers, and active or unverifiable results all fail closed.
  • src/lib/actions/sandbox/snapshot.test.ts: emit the exec-started marker in probe fixtures and cover framed idle as allowed, framed active as refused, and idle output with a non-zero wrapper status as refused.

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: restores the already-documented snapshot create behaviour for idle dcode sandboxes; no new command, flag, default, or output.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification:
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

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

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved sandbox snapshot validation to correctly interpret framed stdout probe output and reliably determine idle vs active vs failed states.
    • Hardened parsing logic to use the proper exec “started” marker boundary and fail safely when stdout framing is ambiguous or exec output indicates failure.
  • Tests
    • Added new test coverage for sandbox exec command framing and stdout extraction, including sentinel-boundary edge cases and snapshot creation allow/deny scenarios under framed output.

The dcode snapshot-create guard matched the raw `openshell sandbox exec`
output with an anchored sentinel regex, so an OpenShell build that frames
child stdout as `stdout: <line>` never matched and every idle terminal
runtime sandbox was refused with "cannot verify". Route the probe through
the shared marked-command and stdout-frame-stripping helpers, and decide
on the extracted sentinel instead of the exec wrapper's exit status.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The dcode snapshot preflight now uses marked OpenShell exec output extraction to detect dcode activity from framed stdout, and the parser rejects ambiguous sentinel boundaries. Tests cover framed probe output and non-zero exec status handling.

Changes

Snapshot probe fix

Layer / File(s) Summary
Marked exec probe and stdout extraction
src/lib/actions/sandbox/snapshot.ts
Uses marked sandbox exec commands for the dcode probe and parses probe state only from extracted stdout after successful exec completion.
Sentinel parsing rules
src/lib/actions/sandbox/sandbox-exec-output.ts
Requires a single exact started-marker boundary after optional stdout framing and returns null when additional sentinel lines make the boundary ambiguous.
Framed probe test coverage
src/lib/actions/sandbox/snapshot.test.ts, src/lib/actions/sandbox/sandbox-exec-output.test.ts
Adds framed probe fixtures and tests for idle/active snapshot decisions, non-zero exec wrapper status, command framing, framed stdout extraction, and sentinel boundary handling.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: ericksoa, cjagwani

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address #6180 by allowing idle dcode snapshots, still refusing active ones, and failing closed on probe/transport errors.
Out of Scope Changes check ✅ Passed The added helper hardening and tests support the framing fix and do not introduce clearly unrelated changes.
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: handling OpenShell exec framing in the dcode snapshot idleness probe.
✨ 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-snapshot-idle-probe

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

@github-code-quality

github-code-quality Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the fix/dcode-snapshot-i... 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-snapshot-i... e429ac5 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/blueprint/ssrf.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-snapshot-i... branch is 69%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix/dcode-snapshot-i... e429ac5 +/-
src/lib/actions...dbox/rebuild.ts 82%
src/lib/actions...all/run-plan.ts 80%
src/lib/state/o...oard-session.ts 79%
src/lib/shields/index.ts 75%
src/lib/state/sandbox.ts 73%
src/lib/onboard...er-gpu-patch.ts 69%
src/lib/onboard/preflight.ts 69%
src/lib/policy/index.ts 67%
src/lib/actions...licy-channel.ts 59%
src/lib/onboard.ts 20%

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

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: snapshot-commands, sandbox-operations, hermes-sandbox-secret-boundary
Optional E2E: sandbox-survival

Dispatch hint: snapshot-commands,sandbox-operations,hermes-sandbox-secret-boundary

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • snapshot-commands (about 40 minutes): Required because this PR changes live snapshot create safety checks and the OpenShell sandbox exec parsing used before backup. The job drives install.sh, a real onboarded sandbox, snapshot create/list/restore, OpenShell sandbox exec verification, and backup artifact inspection.
  • sandbox-operations (about 60 minutes): Required because the shared sandbox-exec stdout parser is also used by sandbox process recovery/status paths, so a live sandbox operations run should verify the real OpenShell command/recovery lifecycle still works.
  • hermes-sandbox-secret-boundary (about 60 minutes): Required because the changed marked-command/parser boundary is shared with the Hermes secret-boundary enforcement path. This job validates the real sandbox secret boundary over live OpenShell execution.

Optional E2E

  • sandbox-survival (about 30 minutes): Optional adjacent confidence for OpenShell sandbox exec and gateway restart/state-survival behavior after the shared exec-output parser change.

New E2E recommendations

  • snapshot lifecycle / dcode quiescence guard (high): Existing snapshot-commands covers general snapshot create/list/restore but does not appear to prove the new dcode active-task guard against real OpenShell sandbox exec framing or duplicate/ambiguous sentinel output. The PR relies on unit tests for this state before backup side effects.
    • Suggested test: Add a live dcode snapshot quiescence E2E that creates or onboards a dcode-capable sandbox, starts a long-running deepagents_code/dcode-like process, verifies nemoclaw <sandbox> snapshot create refuses before creating a backup, then verifies the idle/no-runtime path succeeds with the OpenShell version used in CI.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: snapshot-commands,sandbox-operations,hermes-sandbox-secret-boundary

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: snapshot-commands, ubuntu-repo-docker-post-reboot-recovery
Optional E2E targets: ubuntu-repo-cloud-langchain-deepagents-code

Dispatch required E2E targets:

  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=snapshot-commands
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field targets=ubuntu-repo-docker-post-reboot-recovery

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: origin/main
Head: HEAD
Confidence: medium

Required E2E targets

  • snapshot-commands: The PR changes the production snapshot command path and its OpenShell sandbox-exec stdout boundary. The free-standing snapshot-commands job is the live E2E lane wired in e2e.yaml for real install/onboard plus snapshot create/list/restore coverage.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=snapshot-commands
  • ubuntu-repo-docker-post-reboot-recovery: The shared sandbox-exec stdout parser is also used by sandbox process recovery/status code. This live-supported typed target exercises the status/recovery path after simulated post-reboot container disruption.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field targets=ubuntu-repo-docker-post-reboot-recovery

Optional E2E targets

  • ubuntu-repo-cloud-langchain-deepagents-code: Adjacent coverage for the Deep Agents Code sandbox type affected by the new dcode snapshot activity probe; useful to confirm the live dcode onboarding/runtime remains healthy, though it does not directly run the snapshot command lifecycle.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field targets=ubuntu-repo-cloud-langchain-deepagents-code

Relevant changed files

  • src/lib/actions/sandbox/sandbox-exec-output.ts
  • src/lib/actions/sandbox/snapshot.ts

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Changes requested

Merge posture: Do not merge yet
Primary next action: Fix PRA-1: Issue-level dcode snapshot workflow remains only partially evidenced by mocked unit coverage; then add or justify PRA-T1.
Open items: 1 required · 0 warnings · 1 suggestion · 8 test follow-ups
Since last review: 3 prior items resolved · 1 still applies · 1 new item found

Action checklist

  • PRA-1 Fix: Issue-level dcode snapshot workflow remains only partially evidenced by mocked unit coverage
  • 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: Acceptance clause
  • PRA-T5 Add or justify test follow-up: Acceptance clause
  • PRA-T6 Add or justify test follow-up: Acceptance clause
  • PRA-T7 Add or justify test follow-up: Acceptance clause
  • PRA-T8 Add or justify test follow-up: Acceptance clause
  • PRA-2 In-scope improvement: Shrink unused frame metadata from the stdout-frame parser in src/lib/actions/sandbox/sandbox-exec-output.ts:20

Findings index

ID Severity Category Location Required action
PRA-1 Required acceptance Add or identify focused runtime/integration validation for the reported idle dcode sandbox path, or explicitly narrow the PR acceptance evidence to the parser/preflight unit fix and identify where the full issue workflow is validated.
PRA-2 Improvement architecture src/lib/actions/sandbox/sandbox-exec-output.ts:20 Return only the normalized text string from `parseSandboxExecStdoutFrame`, or remove the `framed` property until a caller needs it for an explicit policy decision.

🚨 Required before merge

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

PRA-1 Required — Issue-level dcode snapshot workflow remains only partially evidenced by mocked unit coverage

  • Location: not file-specific
  • Category: acceptance
  • Problem: The linked issue's acceptance path is a real LangChain Deep Agents Code sandbox workflow: onboard, create a skill, confirm no dcode process, run `snapshot create --name pre-rebuild`, then confirm `snapshot list` shows the snapshot. This PR adds strong parser and snapshot unit coverage, but those tests mock `captureOpenshell`, registry state, backup creation, and lookup behavior instead of exercising the OpenShell 0.0.71 framed transport and real dcode runtime/process table that produced the failure.
  • Impact: The parser can be correct in unit tests while the reported P0 workflow remains blocked by a real OpenShell framing/status variation, dcode runtime state difference, registry/onboarding behavior, or create-then-list integration issue.
  • Required action: Add or identify focused runtime/integration validation for the reported idle dcode sandbox path, or explicitly narrow the PR acceptance evidence to the parser/preflight unit fix and identify where the full issue workflow is validated.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Compare issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180's Steps to Reproduce and Expected Result with `src/lib/actions/sandbox/snapshot.test.ts` tests named `allows dcode snapshot creation when OpenShell frames the probe stdout`, `refuses an active dcode task when OpenShell frames the probe stdout`, and `renders a stable snapshot list with versions, names, timestamps, and paths`; the changed tests use mocks and do not create/list a real snapshot after a real framed OpenShell exec.
  • Missing regression test: Add or reference a focused runtime test such as `creates and lists --name pre-rebuild for an idle OpenShell-framed LangChain Deep Agents Code sandbox`, covering a prepared/onboarded dcode sandbox, no active dcode process, `snapshot create --name pre-rebuild`, and `snapshot list` showing the created snapshot.
  • Done when: The required change is committed and verification passes: Compare issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180's Steps to Reproduce and Expected Result with `src/lib/actions/sandbox/snapshot.test.ts` tests named `allows dcode snapshot creation when OpenShell frames the probe stdout`, `refuses an active dcode task when OpenShell frames the probe stdout`, and `renders a stable snapshot list with versions, names, timestamps, and paths`; the changed tests use mocks and do not create/list a real snapshot after a real framed OpenShell exec.
  • Evidence: `snapshot.ts` now parses framed probe output after a zero-status exec, and `snapshot.test.ts` covers framed idle/active/nonzero-status paths with mocked OpenShell results. The linked issue's `nemoclaw onboard`, `nemoclaw dcode-snap connect`, `docker exec ... ps`, `snapshot create --name pre-rebuild`, and `snapshot list` workflow is not exercised by the changed tests.
Review findings by urgency: 1 required fix, 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-2 Improvement — Shrink unused frame metadata from the stdout-frame parser

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:20
  • Category: architecture
  • Problem: `parseSandboxExecStdoutFrame` returns `{ text, framed }`, but all callers only read `text`; the `framed` boolean is currently dead metadata inside a sensitive parser.
  • Impact: Keeping unused state in a trust-boundary parser makes future changes harder to audit and suggests behavior that is not actually enforced or observed.
  • Suggested action: Return only the normalized text string from `parseSandboxExecStdoutFrame`, or remove the `framed` property until a caller needs it for an explicit policy decision.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Read `src/lib/actions/sandbox/sandbox-exec-output.ts` and confirm every `lines[i]` access uses only `.text`; no code path reads `.framed`.
  • Missing regression test: Existing parser tests in `src/lib/actions/sandbox/sandbox-exec-output.test.ts` already cover the required raw, framed, duplicate-marker, and substring behaviors; no additional behavioral test is needed if this is a pure shrink refactor.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: `parseSandboxExecStdoutFrame` constructs `{ text, framed }`, while `extractSandboxExecCommandStdout` only checks `lines[i].text` and maps `line.text` after the marker.
Simplification opportunities: 1 possible cut, net -3 lines possible

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

  • PRA-2 shrink (src/lib/actions/sandbox/sandbox-exec-output.ts:20): The unused `framed` boolean in `parseSandboxExecStdoutFrame`'s return object.
    • Replacement: Return a normalized string and let `extractSandboxExecCommandStdout` operate on `string[]`, preserving exact-marker and duplicate-marker fail-closed behavior.
    • Net: -3 lines
    • Safety boundary: Do not weaken exact sentinel matching, duplicate sentinel rejection, or recognized stdout-prefix normalization.
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 — Creates and lists `--name pre-rebuild` for an idle OpenShell-framed LangChain Deep Agents Code sandbox.. Changed code sits on a sandbox/OpenShell runtime boundary. Unit coverage is strong for parser and fail-closed branches, but the linked issue was observed in a real OpenShell 0.0.71 dcode sandbox workflow and create-then-list behavior is not exercised by the changed tests.
  • PRA-T2 Runtime validation — Refuses `snapshot create` before backup when a real dcode process is active under framed OpenShell `sandbox exec` output.. Changed code sits on a sandbox/OpenShell runtime boundary. Unit coverage is strong for parser and fail-closed branches, but the linked issue was observed in a real OpenShell 0.0.71 dcode sandbox workflow and create-then-list behavior is not exercised by the changed tests.
  • PRA-T3 Runtime validation — Refuses `snapshot create` when real OpenShell `sandbox exec` returns a nonzero wrapper status even if stdout contains an idle probe sentinel.. Changed code sits on a sandbox/OpenShell runtime boundary. Unit coverage is strong for parser and fail-closed branches, but the linked issue was observed in a real OpenShell 0.0.71 dcode sandbox workflow and create-then-list behavior is not exercised by the changed tests.
  • PRA-T4 Acceptance clause — `nemoclaw dcode-snap snapshot create --name pre-rebuild` fails with EXIT:1 and the error "Cannot verify whether sandbox 'dcode-snap' is actively running a dcode task. Refusing to create snapshot." even when the sandbox is completely idle (no dcode process running, confirmed via `docker exec`). — add test evidence or identify existing coverage. `snapshot.ts` now wraps the dcode probe with `buildSandboxExecMarkedCommand` and parses normalized child stdout only after a successful OpenShell exec; `snapshot.test.ts` allows mocked framed idle output. No real `dcode-snap` sandbox or `docker exec` process table is exercised.
  • PRA-T5 Acceptance clause — This blocks P0 DevTest 6159206 ([DeepAgents] snapshot create preserves dcode app state and user skills across rebuild). — add test evidence or identify existing coverage. The preflight parser regression is addressed locally, but the full DevTest path including real dcode skill state across rebuild is not validated by the changed tests.
  • PRA-T6 Acceptance clause — The `openshell sandbox exec` process probe fails to confirm idleness even on a fully idle terminal runtime sandbox, causing snapshot to be permanently blocked. — add test evidence or identify existing coverage. `sandbox-exec-output.ts` normalizes `stdout:` and `[stdout]` framing, and parser tests cover those formats. The exact failure on a real OpenShell 0.0.71 terminal runtime sandbox is not reproduced in an integration test.
  • PRA-T7 Acceptance clause — 1. Onboard a LangChain Deep Agents Code sandbox: ```bash nemoclaw onboard --agent langchain-deepagents-code --no-gpu --name dcode-snap ``` — add test evidence or identify existing coverage. The changed tests mock registry/OpenShell state and do not run onboarding for a real LangChain Deep Agents Code sandbox.
  • PRA-T8 Acceptance clause — 2. Connect and create a custom skill, then exit: ```bash nemoclaw dcode-snap connect # Inside sandbox: dcode skills create report-writer dcode skills list # confirms report-writer is present exit ``` — add test evidence or identify existing coverage. No changed test connects to dcode or creates/lists a real `report-writer` skill.
Since last review details

Current findings, using the urgency labels above:

PRA-1 Required — Issue-level dcode snapshot workflow remains only partially evidenced by mocked unit coverage

  • Location: not file-specific
  • Category: acceptance
  • Problem: The linked issue's acceptance path is a real LangChain Deep Agents Code sandbox workflow: onboard, create a skill, confirm no dcode process, run `snapshot create --name pre-rebuild`, then confirm `snapshot list` shows the snapshot. This PR adds strong parser and snapshot unit coverage, but those tests mock `captureOpenshell`, registry state, backup creation, and lookup behavior instead of exercising the OpenShell 0.0.71 framed transport and real dcode runtime/process table that produced the failure.
  • Impact: The parser can be correct in unit tests while the reported P0 workflow remains blocked by a real OpenShell framing/status variation, dcode runtime state difference, registry/onboarding behavior, or create-then-list integration issue.
  • Required action: Add or identify focused runtime/integration validation for the reported idle dcode sandbox path, or explicitly narrow the PR acceptance evidence to the parser/preflight unit fix and identify where the full issue workflow is validated.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Compare issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180's Steps to Reproduce and Expected Result with `src/lib/actions/sandbox/snapshot.test.ts` tests named `allows dcode snapshot creation when OpenShell frames the probe stdout`, `refuses an active dcode task when OpenShell frames the probe stdout`, and `renders a stable snapshot list with versions, names, timestamps, and paths`; the changed tests use mocks and do not create/list a real snapshot after a real framed OpenShell exec.
  • Missing regression test: Add or reference a focused runtime test such as `creates and lists --name pre-rebuild for an idle OpenShell-framed LangChain Deep Agents Code sandbox`, covering a prepared/onboarded dcode sandbox, no active dcode process, `snapshot create --name pre-rebuild`, and `snapshot list` showing the created snapshot.
  • Done when: The required change is committed and verification passes: Compare issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180's Steps to Reproduce and Expected Result with `src/lib/actions/sandbox/snapshot.test.ts` tests named `allows dcode snapshot creation when OpenShell frames the probe stdout`, `refuses an active dcode task when OpenShell frames the probe stdout`, and `renders a stable snapshot list with versions, names, timestamps, and paths`; the changed tests use mocks and do not create/list a real snapshot after a real framed OpenShell exec.
  • Evidence: `snapshot.ts` now parses framed probe output after a zero-status exec, and `snapshot.test.ts` covers framed idle/active/nonzero-status paths with mocked OpenShell results. The linked issue's `nemoclaw onboard`, `nemoclaw dcode-snap connect`, `docker exec ... ps`, `snapshot create --name pre-rebuild`, and `snapshot list` workflow is not exercised by the changed tests.

PRA-2 Improvement — Shrink unused frame metadata from the stdout-frame parser

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:20
  • Category: architecture
  • Problem: `parseSandboxExecStdoutFrame` returns `{ text, framed }`, but all callers only read `text`; the `framed` boolean is currently dead metadata inside a sensitive parser.
  • Impact: Keeping unused state in a trust-boundary parser makes future changes harder to audit and suggests behavior that is not actually enforced or observed.
  • Suggested action: Return only the normalized text string from `parseSandboxExecStdoutFrame`, or remove the `framed` property until a caller needs it for an explicit policy decision.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Read `src/lib/actions/sandbox/sandbox-exec-output.ts` and confirm every `lines[i]` access uses only `.text`; no code path reads `.framed`.
  • Missing regression test: Existing parser tests in `src/lib/actions/sandbox/sandbox-exec-output.test.ts` already cover the required raw, framed, duplicate-marker, and substring behaviors; no additional behavioral test is needed if this is a pure shrink refactor.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: `parseSandboxExecStdoutFrame` constructs `{ text, framed }`, while `extractSandboxExecCommandStdout` only checks `lines[i].text` and maps `line.text` after the marker.

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

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — Changes requested

Merge posture: Do not merge yet
Primary next action: Fix PRA-2: Compatibility shim removal condition lacks OpenShell issue tracker link; then add or justify PRA-T1.
Open items: 4 required · 4 warnings · 3 suggestions · 5 test follow-ups
Since last review: 3 prior items resolved · 3 still apply · 2 new items found

Action checklist

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-2 Required correctness src/lib/actions/sandbox/sandbox-exec-output.ts:44 Add TODO comment with OpenShell issue tracker URL (e.g., 'TODO: Remove when openshell/issues/XXXX lands --json exec output'). If no issue exists, file one in OpenShell repo and reference it.
PRA-3 Required architecture src/lib/actions/sandbox/sandbox-exec-output.ts:35 Document the full source-of-truth analysis in the workaround comment (invalid state, source boundary, why source can't be fixed, regression test, removal condition with tracker link). Satisfied if PRA-4 is fixed with tracker link.
PRA-4 Resolve/justify correctness src/lib/actions/sandbox/snapshot.test.ts:1 Coordinate with authors of #6050 and #6086. Consider rebasing after those land, or ensure new integration tests are in non-overlapping describe blocks.
PRA-5 Resolve/justify correctness src/lib/actions/sandbox/snapshot.test.ts:1 Extract the new dcode probe framing tests into a separate test file (e.g., snapshot-dcode-probe.test.ts) or offset the growth by removing obsolete tests.
PRA-6 Improvement tests src/lib/actions/sandbox/sandbox-exec-output.ts:20 Export parseSandboxExecStdoutFrame and add direct unit tests for edge cases (e.g., '[STDOUT] hello', 'StdOut: world'). Low priority but improves test precision.
PRA-7 Improvement security src/lib/actions/sandbox/sandbox-exec-output.ts:51 No action needed — security fix implemented and tested.
PRA-8 Improvement tests src/lib/actions/sandbox/sandbox-exec-output.test.ts:1 Add or justify runtime validation tests that exercise the actual openshell sandbox exec command with various framing modes. If out of scope for this PR, document the gap.
PRA-9 Resolve/justify correctness src/lib/actions/sandbox/snapshot.ts:1 Coordinate with author of #6215. Determine if this PR supersedes #6215 or if they address different aspects. Avoid landing conflicting changes.
PRA-10 Required acceptance src/lib/actions/sandbox/snapshot.ts:441 No action needed — acceptance clause satisfied by implementation and test.
PRA-11 Required acceptance src/lib/actions/sandbox/snapshot.ts:450 No action needed — acceptance clause satisfied by implementation and tests.

🚨 Required before merge

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

PRA-2 Required — Compatibility shim removal condition lacks OpenShell issue tracker link

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:44
  • Category: correctness
  • Problem: Comment states 'Remove this compatibility shim once supported OpenShell versions expose stable machine-readable exec output' but provides no verifiable upstream issue URL. Without a tracker link, there is no condition to trigger shim removal.
  • Impact: Security-sensitive compatibility shim persists indefinitely without accountability; future maintainers cannot verify when upstream fix lands.
  • Required action: Add TODO comment with OpenShell issue tracker URL (e.g., 'TODO: Remove when openshell/issues/XXXX lands --json exec output'). If no issue exists, file one in OpenShell repo and reference it.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: grep -n 'TODO.*openshell\|openshell.*issue\|openshell/issues' src/lib/actions/sandbox/sandbox-exec-output.ts
  • Missing regression test: Not testable — requires documentation update with tracker link.
  • Done when: The required change is committed and verification passes: grep -n 'TODO.*openshell\|openshell.*issue\|openshell/issues' src/lib/actions/sandbox/sandbox-exec-output.ts.
  • Evidence: sandbox-exec-output.ts:28-44 comment mentions removal condition but no issue reference.

PRA-3 Required — Source-of-truth review incomplete for compatibility shim

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:35
  • Category: architecture
  • Problem: The compatibility shim handles OpenShell's human-readable exec framing (stdout:, [stdout] prefixes) and login-shell preamble. Invalid state: OpenShell lacks machine-readable exec output. Source boundary: OpenShell sandbox exec stdout. Source cannot be fixed here (separate upstream project). Regression tests: sandbox-exec-output.test.ts covers framing variants and preamble injection. Removal condition: needs OpenShell tracker link (PRA-4).
  • Impact: Without documented source-of-truth analysis, future maintainers may incorrectly modify or remove the shim, or the workaround may persist indefinitely without accountability.
  • Required action: Document the full source-of-truth analysis in the workaround comment (invalid state, source boundary, why source can't be fixed, regression test, removal condition with tracker link). Satisfied if PRA-4 is fixed with tracker link.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read sandbox-exec-output.ts lines 30-45 — verify comment documents invalid state, source boundary, source-fix constraint, regression test, and removal condition with OpenShell issue URL.
  • Missing regression test: sandbox-exec-output.test.ts covers frame-prefix stripping, preamble injection, last-sentinel logic, base64 encoding
  • Done when: The required change is committed and verification passes: Read sandbox-exec-output.ts lines 30-45 — verify comment documents invalid state, source boundary, source-fix constraint, regression test, and removal condition with OpenShell issue URL.
  • Evidence: sandbox-exec-output.ts:30-44 JSDoc describes source-of-truth boundary but lacks complete removal condition with tracker link.

PRA-10 Required — Issue #6180: snapshot create refuses for idle dcode sandbox — FIXED

  • Location: src/lib/actions/sandbox/snapshot.ts:441
  • Category: acceptance
  • Problem: Issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180 acceptance clause: 'snapshot create refuses for idle LangChain Deep Agents Code sandbox' — FIXED. The fix routes dcode idleness probe through marked-command helpers so OpenShell framing is stripped before parsing. New test 'allows dcode snapshot creation when OpenShell frames the probe stdout' (snapshot.test.ts:414) verifies framed idle is allowed.
  • Impact: Previously, idle dcode sandboxes were incorrectly refused because the probe output was framed (stdout: prefix) and the sentinel never matched. Now framed output is normalized.
  • Required action: No action needed — acceptance clause satisfied by implementation and test.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Run snapshot.test.ts test 'allows dcode snapshot creation when OpenShell frames the probe stdout' — passes with framed output.
  • Missing regression test: Already covered: snapshot.test.ts:414-442 test 'allows dcode snapshot creation when OpenShell frames the probe stdout'
  • Done when: The required change is committed and verification passes: Run snapshot.test.ts test 'allows dcode snapshot creation when OpenShell frames the probe stdout' — passes with framed output.
  • Evidence: snapshot.ts:441-451 routes probe through buildSandboxExecMarkedCommand and extractSandboxExecCommandStdout; snapshot.test.ts:414-442 test passes.

PRA-11 Required — Issue #6180: fail-closed on non-zero status, transport errors, missing/duplicate markers, active/unverifiable — IMPLEMENTED

  • Location: src/lib/actions/sandbox/snapshot.ts:450
  • Category: acceptance
  • Problem: Issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180 acceptance clause: 'non-zero status, transport errors, missing or duplicate markers, and active or unverifiable results all fail closed' — IMPLEMENTED. The code checks probeCompleted (status === 0 && !error && !signal) before extracting stdout; extractSandboxExecCommandStdout returns null for missing/duplicate sentinels; parseDcodeProbeState returns null for unverifiable; active state logs error and returns false.
  • Impact: All failure modes correctly refuse snapshot creation rather than allowing potentially inconsistent backup of .deepagents directory.
  • Required action: No action needed — acceptance clause satisfied by implementation and tests.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Run snapshot.test.ts tests: 'refuses an idle dcode snapshot when the exec wrapper reports a non-zero status' (line 460), 'refuses registered dcode snapshots when raw status 1 has no idle sentinel' (line 476), 'refuses registered dcode snapshots when the probe times out' (line 492), 'refuses dcode snapshot creation before backup when task state cannot be verified' (line 513), 'refuses an active dcode task when OpenShell frames the probe stdout' (line 444).
  • Missing regression test: Already covered by 5 negative-path tests in snapshot.test.ts
  • Done when: The required change is committed and verification passes: Run snapshot.test.ts tests: 'refuses an idle dcode snapshot when the exec wrapper reports a non-zero status' (line 460), 'refuses registered dcode snapshots when raw status 1 has no idle sentinel' (line 476), 'refuses registered dcode snapshots when the probe times out' (line 492), 'refuses dcode snapshot creation before backup when task state cannot be verified' (line 513), 'refuses an active dcode task when OpenShell frames the probe stdout' (line 444).
  • Evidence: snapshot.ts:448-451 probeCompleted check; extractSandboxExecCommandStdout returns null for missing/duplicate sentinels; 5 negative-path tests verify fail-closed behavior.
Review findings by urgency: 4 required fixes, 4 items to resolve/justify, 3 in-scope improvements

⚠️ Resolve or justify before merge

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

PRA-1 Resolve/justify — Source-of-truth review needed: sandbox-exec-output.ts compatibility shim

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: sandbox-exec-output.test.ts covers frame-prefix stripping (stdout:, [stdout], case-insensitive), preamble injection, child stdout sentinel repeat, embedded sentinel substring, base64 encoding for hermes boundary script.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: sandbox-exec-output.ts:30-44 JSDoc; sandbox-exec-output.test.ts:11 tests covering all framing/preamble cases

PRA-4 Resolve/justify — Merge conflict risk with overlapping PRs #6050 and #6086

PRA-5 Resolve/justify — Monolith growth: snapshot.test.ts grew by 67 lines

  • Location: src/lib/actions/sandbox/snapshot.test.ts:1
  • Category: correctness
  • Problem: snapshot.test.ts grew by 67 lines (from 818 to 885). This file is already a large-file hotspot. New integration tests added without extraction.
  • Impact: Increasing test file size reduces maintainability and slows test execution. Large files are harder to navigate and review.
  • Recommended action: Extract the new dcode probe framing tests into a separate test file (e.g., snapshot-dcode-probe.test.ts) or offset the growth by removing obsolete tests.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: wc -l src/lib/actions/sandbox/snapshot.test.ts
  • Missing regression test: N/A — architectural concern.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: wc -l src/lib/actions/sandbox/snapshot.test.ts.
  • Evidence: Drift context monolithDeltas shows snapshot.test.ts delta +67 with severity blocker.

PRA-9 Resolve/justify — Duplicate/overlapping work with PR #6215

💡 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-6 Improvement — parseSandboxExecStdoutFrame not exported for direct unit testing

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:20
  • Category: tests
  • Problem: parseSandboxExecStdoutFrame is not exported, preventing direct unit tests for case-insensitive edge cases (STDOUT:, [STDOUT], etc.).
  • Impact: Case-insensitive frame prefix stripping logic can only be tested indirectly through extractSandboxExecCommandStdout, reducing test precision for edge cases.
  • Suggested action: Export parseSandboxExecStdoutFrame and add direct unit tests for edge cases (e.g., '[STDOUT] hello', 'StdOut: world'). Low priority but improves test precision.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: grep -n 'export.*parseSandboxExecStdoutFrame' src/lib/actions/sandbox/sandbox-exec-output.ts
  • Missing regression test: Add unit tests for parseSandboxExecStdoutFrame covering case-insensitive prefixes, malformed frames, and empty lines.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Function defined at line 20 but not exported; only tested indirectly via extractSandboxExecCommandStdout tests.

PRA-7 Improvement — Sentinel parser correctly uses single-exact-sentinel validation

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:51
  • Category: security
  • Problem: Sentinel parser correctly uses last-match (single exact sentinel) to prevent preamble injection. Case-insensitive frame prefix stripping added. Tests cover preamble injection, child stdout sentinel repeat, and embedded sentinel substring.
  • Impact: Policy bypass prevented: a compromised sandbox can no longer inject a fake sentinel in login-shell preamble followed by 'NEMOCLAW_DCODE_PROBE=idle' to bypass the dcode activity guard.
  • Suggested action: No action needed — security fix implemented and tested.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: grep -n 'exactMarkerIndex' src/lib/actions/sandbox/sandbox-exec-output.ts shows single-sentinel validation; sandbox-exec-output.test.ts:52-61 preamble injection test passes.
  • Missing regression test: Already covered: sandbox-exec-output.test.ts test 'returns null when a preamble repeats the sentinel before the authentic boundary' and 'returns null when child stdout repeats the sentinel after the authentic boundary'.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: sandbox-exec-output.ts:51-58 single-sentinel validation loop; sandbox-exec-output.test.ts:52-61 preamble injection test passes.

PRA-8 Improvement — Runtime validation of OpenShell exec transport framing not covered

  • Location: src/lib/actions/sandbox/sandbox-exec-output.test.ts:1
  • Category: tests
  • Problem: New test file covers buildSandboxExecMarkedCommand and extractSandboxExecCommandStdout comprehensively. However, runtime validation of the actual OpenShell exec transport (framing behavior across versions) is not covered by unit tests.
  • Impact: Unit tests verify parser logic but not the actual OpenShell transport behavior across versions. If OpenShell changes framing, parser may need updates that unit tests won't catch.
  • Suggested action: Add or justify runtime validation tests that exercise the actual openshell sandbox exec command with various framing modes. If out of scope for this PR, document the gap.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check if test/e2e/ or integration tests exercise openshell sandbox exec with framed output.
  • Missing regression test: Integration test that runs `openshell sandbox exec` and verifies framed stdout parsing end-to-end.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: sandbox-exec-output.test.ts has 11 unit tests covering parser logic; no integration test with actual openshell binary.
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 — Integration test that runs `openshell sandbox exec` with framed output and verifies end-to-end parsing. Runtime/sandbox/infrastructure paths need behavioral runtime validation: src/lib/actions/sandbox/sandbox-exec-output.ts, src/lib/actions/sandbox/snapshot.ts. Unit tests cover parser logic comprehensively but actual OpenShell transport framing across versions is not exercised.
  • PRA-T2 Runtime validation — Runtime test with actual OpenShell 0.0.71+ to confirm framed stdout behavior matches parser assumptions. Runtime/sandbox/infrastructure paths need behavioral runtime validation: src/lib/actions/sandbox/sandbox-exec-output.ts, src/lib/actions/sandbox/snapshot.ts. Unit tests cover parser logic comprehensively but actual OpenShell transport framing across versions is not exercised.
  • PRA-T3 parseSandboxExecStdoutFrame not exported for direct unit testing — Export parseSandboxExecStdoutFrame and add direct unit tests for edge cases (e.g., '[STDOUT] hello', 'StdOut: world'). Low priority but improves test precision.
  • PRA-T4 Runtime validation of OpenShell exec transport framing not covered — Add or justify runtime validation tests that exercise the actual openshell sandbox exec command with various framing modes. If out of scope for this PR, document the gap.
  • PRA-T5 sandbox-exec-output.ts compatibility shim — sandbox-exec-output.test.ts covers frame-prefix stripping (stdout:, [stdout], case-insensitive), preamble injection, child stdout sentinel repeat, embedded sentinel substring, base64 encoding for hermes boundary script.. sandbox-exec-output.ts:30-44 JSDoc; sandbox-exec-output.test.ts:11 tests covering all framing/preamble cases
Since last review details

Current findings, using the urgency labels above:

PRA-1 Resolve/justify — Source-of-truth review needed: sandbox-exec-output.ts compatibility shim

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: sandbox-exec-output.test.ts covers frame-prefix stripping (stdout:, [stdout], case-insensitive), preamble injection, child stdout sentinel repeat, embedded sentinel substring, base64 encoding for hermes boundary script.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: sandbox-exec-output.ts:30-44 JSDoc; sandbox-exec-output.test.ts:11 tests covering all framing/preamble cases

PRA-2 Required — Compatibility shim removal condition lacks OpenShell issue tracker link

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:44
  • Category: correctness
  • Problem: Comment states 'Remove this compatibility shim once supported OpenShell versions expose stable machine-readable exec output' but provides no verifiable upstream issue URL. Without a tracker link, there is no condition to trigger shim removal.
  • Impact: Security-sensitive compatibility shim persists indefinitely without accountability; future maintainers cannot verify when upstream fix lands.
  • Required action: Add TODO comment with OpenShell issue tracker URL (e.g., 'TODO: Remove when openshell/issues/XXXX lands --json exec output'). If no issue exists, file one in OpenShell repo and reference it.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: grep -n 'TODO.*openshell\|openshell.*issue\|openshell/issues' src/lib/actions/sandbox/sandbox-exec-output.ts
  • Missing regression test: Not testable — requires documentation update with tracker link.
  • Done when: The required change is committed and verification passes: grep -n 'TODO.*openshell\|openshell.*issue\|openshell/issues' src/lib/actions/sandbox/sandbox-exec-output.ts.
  • Evidence: sandbox-exec-output.ts:28-44 comment mentions removal condition but no issue reference.

PRA-3 Required — Source-of-truth review incomplete for compatibility shim

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:35
  • Category: architecture
  • Problem: The compatibility shim handles OpenShell's human-readable exec framing (stdout:, [stdout] prefixes) and login-shell preamble. Invalid state: OpenShell lacks machine-readable exec output. Source boundary: OpenShell sandbox exec stdout. Source cannot be fixed here (separate upstream project). Regression tests: sandbox-exec-output.test.ts covers framing variants and preamble injection. Removal condition: needs OpenShell tracker link (PRA-4).
  • Impact: Without documented source-of-truth analysis, future maintainers may incorrectly modify or remove the shim, or the workaround may persist indefinitely without accountability.
  • Required action: Document the full source-of-truth analysis in the workaround comment (invalid state, source boundary, why source can't be fixed, regression test, removal condition with tracker link). Satisfied if PRA-4 is fixed with tracker link.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read sandbox-exec-output.ts lines 30-45 — verify comment documents invalid state, source boundary, source-fix constraint, regression test, and removal condition with OpenShell issue URL.
  • Missing regression test: sandbox-exec-output.test.ts covers frame-prefix stripping, preamble injection, last-sentinel logic, base64 encoding
  • Done when: The required change is committed and verification passes: Read sandbox-exec-output.ts lines 30-45 — verify comment documents invalid state, source boundary, source-fix constraint, regression test, and removal condition with OpenShell issue URL.
  • Evidence: sandbox-exec-output.ts:30-44 JSDoc describes source-of-truth boundary but lacks complete removal condition with tracker link.

PRA-4 Resolve/justify — Merge conflict risk with overlapping PRs #6050 and #6086

PRA-5 Resolve/justify — Monolith growth: snapshot.test.ts grew by 67 lines

  • Location: src/lib/actions/sandbox/snapshot.test.ts:1
  • Category: correctness
  • Problem: snapshot.test.ts grew by 67 lines (from 818 to 885). This file is already a large-file hotspot. New integration tests added without extraction.
  • Impact: Increasing test file size reduces maintainability and slows test execution. Large files are harder to navigate and review.
  • Recommended action: Extract the new dcode probe framing tests into a separate test file (e.g., snapshot-dcode-probe.test.ts) or offset the growth by removing obsolete tests.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: wc -l src/lib/actions/sandbox/snapshot.test.ts
  • Missing regression test: N/A — architectural concern.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: wc -l src/lib/actions/sandbox/snapshot.test.ts.
  • Evidence: Drift context monolithDeltas shows snapshot.test.ts delta +67 with severity blocker.

PRA-6 Improvement — parseSandboxExecStdoutFrame not exported for direct unit testing

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:20
  • Category: tests
  • Problem: parseSandboxExecStdoutFrame is not exported, preventing direct unit tests for case-insensitive edge cases (STDOUT:, [STDOUT], etc.).
  • Impact: Case-insensitive frame prefix stripping logic can only be tested indirectly through extractSandboxExecCommandStdout, reducing test precision for edge cases.
  • Suggested action: Export parseSandboxExecStdoutFrame and add direct unit tests for edge cases (e.g., '[STDOUT] hello', 'StdOut: world'). Low priority but improves test precision.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: grep -n 'export.*parseSandboxExecStdoutFrame' src/lib/actions/sandbox/sandbox-exec-output.ts
  • Missing regression test: Add unit tests for parseSandboxExecStdoutFrame covering case-insensitive prefixes, malformed frames, and empty lines.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Function defined at line 20 but not exported; only tested indirectly via extractSandboxExecCommandStdout tests.

PRA-7 Improvement — Sentinel parser correctly uses single-exact-sentinel validation

  • Location: src/lib/actions/sandbox/sandbox-exec-output.ts:51
  • Category: security
  • Problem: Sentinel parser correctly uses last-match (single exact sentinel) to prevent preamble injection. Case-insensitive frame prefix stripping added. Tests cover preamble injection, child stdout sentinel repeat, and embedded sentinel substring.
  • Impact: Policy bypass prevented: a compromised sandbox can no longer inject a fake sentinel in login-shell preamble followed by 'NEMOCLAW_DCODE_PROBE=idle' to bypass the dcode activity guard.
  • Suggested action: No action needed — security fix implemented and tested.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: grep -n 'exactMarkerIndex' src/lib/actions/sandbox/sandbox-exec-output.ts shows single-sentinel validation; sandbox-exec-output.test.ts:52-61 preamble injection test passes.
  • Missing regression test: Already covered: sandbox-exec-output.test.ts test 'returns null when a preamble repeats the sentinel before the authentic boundary' and 'returns null when child stdout repeats the sentinel after the authentic boundary'.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: sandbox-exec-output.ts:51-58 single-sentinel validation loop; sandbox-exec-output.test.ts:52-61 preamble injection test passes.

PRA-8 Improvement — Runtime validation of OpenShell exec transport framing not covered

  • Location: src/lib/actions/sandbox/sandbox-exec-output.test.ts:1
  • Category: tests
  • Problem: New test file covers buildSandboxExecMarkedCommand and extractSandboxExecCommandStdout comprehensively. However, runtime validation of the actual OpenShell exec transport (framing behavior across versions) is not covered by unit tests.
  • Impact: Unit tests verify parser logic but not the actual OpenShell transport behavior across versions. If OpenShell changes framing, parser may need updates that unit tests won't catch.
  • Suggested action: Add or justify runtime validation tests that exercise the actual openshell sandbox exec command with various framing modes. If out of scope for this PR, document the gap.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check if test/e2e/ or integration tests exercise openshell sandbox exec with framed output.
  • Missing regression test: Integration test that runs `openshell sandbox exec` and verifies framed stdout parsing end-to-end.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: sandbox-exec-output.test.ts has 11 unit tests covering parser logic; no integration test with actual openshell binary.

PRA-9 Resolve/justify — Duplicate/overlapping work with PR #6215

PRA-10 Required — Issue #6180: snapshot create refuses for idle dcode sandbox — FIXED

  • Location: src/lib/actions/sandbox/snapshot.ts:441
  • Category: acceptance
  • Problem: Issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180 acceptance clause: 'snapshot create refuses for idle LangChain Deep Agents Code sandbox' — FIXED. The fix routes dcode idleness probe through marked-command helpers so OpenShell framing is stripped before parsing. New test 'allows dcode snapshot creation when OpenShell frames the probe stdout' (snapshot.test.ts:414) verifies framed idle is allowed.
  • Impact: Previously, idle dcode sandboxes were incorrectly refused because the probe output was framed (stdout: prefix) and the sentinel never matched. Now framed output is normalized.
  • Required action: No action needed — acceptance clause satisfied by implementation and test.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Run snapshot.test.ts test 'allows dcode snapshot creation when OpenShell frames the probe stdout' — passes with framed output.
  • Missing regression test: Already covered: snapshot.test.ts:414-442 test 'allows dcode snapshot creation when OpenShell frames the probe stdout'
  • Done when: The required change is committed and verification passes: Run snapshot.test.ts test 'allows dcode snapshot creation when OpenShell frames the probe stdout' — passes with framed output.
  • Evidence: snapshot.ts:441-451 routes probe through buildSandboxExecMarkedCommand and extractSandboxExecCommandStdout; snapshot.test.ts:414-442 test passes.

PRA-11 Required — Issue #6180: fail-closed on non-zero status, transport errors, missing/duplicate markers, active/unverifiable — IMPLEMENTED

  • Location: src/lib/actions/sandbox/snapshot.ts:450
  • Category: acceptance
  • Problem: Issue [Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state #6180 acceptance clause: 'non-zero status, transport errors, missing or duplicate markers, and active or unverifiable results all fail closed' — IMPLEMENTED. The code checks probeCompleted (status === 0 && !error && !signal) before extracting stdout; extractSandboxExecCommandStdout returns null for missing/duplicate sentinels; parseDcodeProbeState returns null for unverifiable; active state logs error and returns false.
  • Impact: All failure modes correctly refuse snapshot creation rather than allowing potentially inconsistent backup of .deepagents directory.
  • Required action: No action needed — acceptance clause satisfied by implementation and tests.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Run snapshot.test.ts tests: 'refuses an idle dcode snapshot when the exec wrapper reports a non-zero status' (line 460), 'refuses registered dcode snapshots when raw status 1 has no idle sentinel' (line 476), 'refuses registered dcode snapshots when the probe times out' (line 492), 'refuses dcode snapshot creation before backup when task state cannot be verified' (line 513), 'refuses an active dcode task when OpenShell frames the probe stdout' (line 444).
  • Missing regression test: Already covered by 5 negative-path tests in snapshot.test.ts
  • Done when: The required change is committed and verification passes: Run snapshot.test.ts tests: 'refuses an idle dcode snapshot when the exec wrapper reports a non-zero status' (line 460), 'refuses registered dcode snapshots when raw status 1 has no idle sentinel' (line 476), 'refuses registered dcode snapshots when the probe times out' (line 492), 'refuses dcode snapshot creation before backup when task state cannot be verified' (line 513), 'refuses an active dcode task when OpenShell frames the probe stdout' (line 444).
  • Evidence: snapshot.ts:448-451 probeCompleted check; extractSandboxExecCommandStdout returns null for missing/duplicate sentinels; 5 negative-path tests verify fail-closed behavior.

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: Tinson Lai <tinsonl@nvidia.com>
@laitingsheng laitingsheng added NV QA Bugs found by the NVIDIA QA Team area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression labels Jul 2, 2026
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/actions/sandbox/sandbox-exec-output.ts (1)

1-65: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

File location conflicts with documented layering map.

This file contains pure parsing/decision helpers (parseSandboxExecStdoutFrame, extractSandboxExecCommandStdout, buildSandboxExecMarkedCommand) with no host/process/OpenShell calls. Per the src/lib/README.md layering map, sandbox command/output framing & execution helpers should live under src/lib/sandbox/**, and the stack description itself refers to this file as sandbox/sandbox-exec-output.ts (implying src/lib/sandbox/), yet it's actually placed at src/lib/actions/sandbox/sandbox-exec-output.ts. Actions should orchestrate, not own parsing/policy logic.

Consider moving this file to src/lib/sandbox/sandbox-exec-output.ts and updating the import in snapshot.ts accordingly.

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

In `@src/lib/actions/sandbox/sandbox-exec-output.ts` around lines 1 - 65, The
sandbox exec parsing/command-framing helpers are in the wrong layer:
`buildSandboxExecMarkedCommand`, `parseSandboxExecStdoutFrame`, and
`extractSandboxExecCommandStdout` are pure sandbox utilities and should live
under `src/lib/sandbox/**` instead of the `actions` tree. Move
`sandbox-exec-output.ts` to the sandbox layer, then update the `snapshot.ts`
import to the new location so the layering map stays consistent and actions
remain orchestration-only.

Source: Path instructions

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

Outside diff comments:
In `@src/lib/actions/sandbox/sandbox-exec-output.ts`:
- Around line 1-65: The sandbox exec parsing/command-framing helpers are in the
wrong layer: `buildSandboxExecMarkedCommand`, `parseSandboxExecStdoutFrame`, and
`extractSandboxExecCommandStdout` are pure sandbox utilities and should live
under `src/lib/sandbox/**` instead of the `actions` tree. Move
`sandbox-exec-output.ts` to the sandbox layer, then update the `snapshot.ts`
import to the new location so the layering map stays consistent and actions
remain orchestration-only.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2b06c1c3-e654-46d3-989e-c705859225e7

📥 Commits

Reviewing files that changed from the base of the PR and between a691fb6 and bd89d88.

📒 Files selected for processing (4)
  • src/lib/actions/sandbox/sandbox-exec-output.test.ts
  • src/lib/actions/sandbox/sandbox-exec-output.ts
  • src/lib/actions/sandbox/snapshot.test.ts
  • src/lib/actions/sandbox/snapshot.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/actions/sandbox/snapshot.ts

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Target Results — ✅ All requested jobs passed

Run: 28592106601
Workflow ref: fix/dcode-snapshot-idle-probe
Requested targets: (default — all supported)
Requested jobs: snapshot-commands
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
snapshot-commands ✅ success

@wscurran wscurran added integration: dcode LangChain Deep Code integration behavior v0.0.74 and removed v0.0.73 labels Jul 2, 2026
@cjagwani cjagwani self-assigned this Jul 2, 2026
@wscurran
wscurran requested a review from cv July 2, 2026 22:12
cv added 2 commits July 2, 2026 22:27
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Target Results — ✅ All selected jobs passed

Run: 28641617259
Workflow ref: fix/dcode-snapshot-idle-probe
Requested targets: snapshot-commands,hermes-sandbox-secret-boundary,ubuntu-repo-docker-post-reboot-recovery
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs hermes-gpu-startup, openshell-gateway-auth-contract, jetson-nvmap-gpu, and sandbox-rlimits-connect are skipped unless selected)
Summary: 3 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
hermes-sandbox-secret-boundary ✅ success
live ✅ success
snapshot-commands ✅ success

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Target Results — ✅ All requested jobs passed

Run: 28641754179
Workflow ref: fix/dcode-snapshot-idle-probe
Requested targets: (default — all supported)
Requested jobs: sandbox-operations
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
sandbox-operations ✅ success

cv added a commit that referenced this pull request Jul 3, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This PR fixes the dcode snapshot idle-probe regression caused by
OpenShell output framing and hardens the exec-output trust boundary
against injected, duplicated, or conflicting marker/state output. It
builds on and supersedes Tinson Lai's original implementation in #6190,
with Tinson retained as a co-author on the hardening commit.

## Related Issue
Fixes #6180

Supersedes #6190.

## Changes
- Preserve stdout and stderr separately while accepting OpenShell-framed
child output from either stream.
- Generate a fresh marker per exec and require exactly one marker and
one valid dcode probe state across both streams.
- Use a non-login shell so profile startup output cannot influence the
probe.
- Fail closed on duplicate markers, duplicate/conflicting states,
nonzero status, signals, or exec errors.
- Add focused parser and snapshot tests for framing, cross-stream
output, injection, ambiguity, and failure cases.
- Credit Tinson Lai for the original fix: the #6190 commits remain
intact and the new hardening commit includes `Co-authored-by: Tinson Lai
<tinsonl@nvidia.com>`.

Validation performed locally:
- 37 focused snapshot/parser tests passed.
- 23 process-recovery unit tests passed.
- 23 process-recovery integration/primitives tests passed.
- CLI type checking, Biome, diff checks, commit lint, and pre-push
checks passed.
- The broad CLI hook was attempted but encountered 105 unrelated local
environment/baseline failures (including Node 26 deprecation stderr and
missing packaged JSON5 tooling); none were in the four changed files.

## 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 all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [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 existing
documented snapshot contract and changes only internal probe parsing and
validation.
- [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: local security-focused
review covered marker ambiguity, cross-stream parsing,
duplicate/conflicting states, login-shell startup output, and
fail-closed outcomes; no blocking findings.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [ ] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [x] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] 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: Apurv Kumaria
<36614+apurvvkumaria@users.noreply.github.com>


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

* **New Features**
* Added randomized execution markers for sandbox command wrapping and
improved boundary validation during output detection.
* Snapshot runtime checks now use marker-aware probing across captured
streams to determine idle vs active more accurately.

* **Bug Fixes**
* Reduced false positives by requiring an exact single marker occurrence
and rejecting missing, duplicate, or ambiguous matches.
* Improved handling of framed stdout/stderr output, including correct
extraction even when content spans streams.

* **Tests**
* Expanded sandbox execution output, stream parsing, and snapshot probe
coverage with additional edge cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <36614+apurvvkumaria@users.noreply.github.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Co-authored-by: Apurv Kumaria <36614+apurvvkumaria@users.noreply.github.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #6215, which merged the hardened fix for #6180 as c7a4728. The merged change preserves Tinson Lai as a co-author and credits #6190 as the original implementation.

@cv cv closed this Jul 3, 2026
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This PR fixes the dcode snapshot idle-probe regression caused by
OpenShell output framing and hardens the exec-output trust boundary
against injected, duplicated, or conflicting marker/state output. It
builds on and supersedes Tinson Lai's original implementation in NVIDIA#6190,
with Tinson retained as a co-author on the hardening commit.

## Related Issue
Fixes NVIDIA#6180

Supersedes NVIDIA#6190.

## Changes
- Preserve stdout and stderr separately while accepting OpenShell-framed
child output from either stream.
- Generate a fresh marker per exec and require exactly one marker and
one valid dcode probe state across both streams.
- Use a non-login shell so profile startup output cannot influence the
probe.
- Fail closed on duplicate markers, duplicate/conflicting states,
nonzero status, signals, or exec errors.
- Add focused parser and snapshot tests for framing, cross-stream
output, injection, ambiguity, and failure cases.
- Credit Tinson Lai for the original fix: the NVIDIA#6190 commits remain
intact and the new hardening commit includes `Co-authored-by: Tinson Lai
<tinsonl@nvidia.com>`.

Validation performed locally:
- 37 focused snapshot/parser tests passed.
- 23 process-recovery unit tests passed.
- 23 process-recovery integration/primitives tests passed.
- CLI type checking, Biome, diff checks, commit lint, and pre-push
checks passed.
- The broad CLI hook was attempted but encountered 105 unrelated local
environment/baseline failures (including Node 26 deprecation stderr and
missing packaged JSON5 tooling); none were in the four changed files.

## 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 all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [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 existing
documented snapshot contract and changes only internal probe parsing and
validation.
- [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: local security-focused
review covered marker ambiguity, cross-stream parsing,
duplicate/conflicting states, login-shell startup output, and
fail-closed outcomes; no blocking findings.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [ ] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [x] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] 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: Apurv Kumaria
<36614+apurvvkumaria@users.noreply.github.com>


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

* **New Features**
* Added randomized execution markers for sandbox command wrapping and
improved boundary validation during output detection.
* Snapshot runtime checks now use marker-aware probing across captured
streams to determine idle vs active more accurately.

* **Bug Fixes**
* Reduced false positives by requiring an exact single marker occurrence
and rejecting missing, duplicate, or ambiguous matches.
* Improved handling of framed stdout/stderr output, including correct
extraction even when content spans streams.

* **Tests**
* Expanded sandbox execution output, stream parsing, and snapshot probe
coverage with additional edge cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <36614+apurvvkumaria@users.noreply.github.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Co-authored-by: Apurv Kumaria <36614+apurvvkumaria@users.noreply.github.com>
Co-authored-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: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior NV QA Bugs found by the NVIDIA QA Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ubuntu 24.04][Sandbox] nemoclaw snapshot create refuses for idle LangChain Deep Agents Code sandbox — Cannot verify dcode task state

4 participants