Skip to content

fix(snapshot): verify idle dcode without ps - #6617

Merged
cv merged 7 commits into
NVIDIA:mainfrom
HOYALIM:codex/issue-6180-dcode-snapshot-idle
Jul 11, 2026
Merged

fix(snapshot): verify idle dcode without ps#6617
cv merged 7 commits into
NVIDIA:mainfrom
HOYALIM:codex/issue-6180-dcode-snapshot-idle

Conversation

@HOYALIM

@HOYALIM HOYALIM commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move the dcode snapshot activity probe into a focused helper module so the probe script can be tested directly.
  • Fall back to scanning /proc/*/cmdline when ps -eo pid=,args= is unavailable inside the sandbox.
  • Keep the existing fail-closed behavior when neither ps nor /proc can verify a dcode runtime, while allowing confirmed-idle dcode sandboxes to snapshot.

Validation

  • npx vitest run --project cli src/lib/actions/sandbox/snapshot.test.ts src/lib/actions/sandbox/dcode-activity-probe.test.ts
  • npm run typecheck
  • git diff --check
  • npx prek run --files src/lib/actions/sandbox/snapshot.ts src/lib/actions/sandbox/snapshot.test.ts src/lib/actions/sandbox/dcode-activity-probe.ts src/lib/actions/sandbox/dcode-activity-probe.test.ts --stage pre-commit
  • npm run check:diff
  • npm --prefix nemoclaw ci

Refs #6180

Signed-off-by: Ho Lim subhoya@gmail.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved dcode activity detection when process details are unavailable, using fail-closed “unverifiable runtime” results.
    • Hardened probe output parsing to avoid incorrect idle/active classification when sentinels are ambiguous or contradictory.
  • New Features
    • Added a sandboxed dcode activity probe that reports a single machine-readable status/state (including active, idle, unverifiable, and no-runtime).
  • Tests
    • Expanded sandbox tests with simulated process environments to cover ps failures, incomplete visibility, and conflicting sentinel scenarios.
  • Refactor
    • Centralized dcode probe parsing and state constants for reuse in snapshot-creation eligibility checks.

Copilot AI review requested due to automatic review settings July 9, 2026 23:42
@copy-pr-bot

copy-pr-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

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

Use the following commands to manage reviews:

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

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The dcode activity probe was extracted into a dedicated module containing its shell script, state constants, type, and output parser. Snapshot logic now imports these definitions, with tests covering process fallback, fail-closed behavior, and sentinel parsing.

Changes

Dcode activity probe

Layer / File(s) Summary
Probe script and state parser
src/lib/actions/sandbox/dcode-activity-probe.ts
Defines probe states, emits activity status from runtime and process checks, and parses exactly one probe sentinel from output.
Snapshot integration
src/lib/actions/sandbox/snapshot.ts
Snapshot handling imports the extracted probe implementation and uses its constants and parser for dcode activity gating.
Fallback and parser validation
src/lib/actions/sandbox/dcode-activity-probe.test.ts, src/lib/actions/sandbox/snapshot.test.ts
Tests cover process fallback, fail-closed detection, sentinel parsing, and a return-type formatting update.

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

Suggested labels: bug-fix, refactor

Suggested reviewers: cv, jyaunches

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: snapshotting idle dcode sandboxes without relying on ps.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@HOYALIM
HOYALIM force-pushed the codex/issue-6180-dcode-snapshot-idle branch from 3c5c3dc to 53909f8 Compare July 9, 2026 23:45

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

🧹 Nitpick comments (1)
src/lib/actions/sandbox/dcode-activity-probe.test.ts (1)

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

No test covers the fail-closed branch when /proc scanning finds no readable processes at all.

The PR objective states the existing fail-closed behavior "remains when neither ps nor /proc can verify a dcode runtime," but no test exercises saw_proc_process == 0 (e.g. an empty/inaccessible procRoot) to assert unverifiable/no-runtime sentinel output. Given this is the safety-critical branch protecting snapshot consistency, it's worth locking in with a regression test.

🤖 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/dcode-activity-probe.test.ts` around lines 16 - 88,
Add a regression test in the “dcode activity probe” suite using
runProbeScriptWithProcessSources with psExitCode nonzero and no procCmdlines,
then assert the probe exits successfully and emits the expected
unverifiable/no-runtime sentinel for the fail-closed path when neither ps nor
/proc verifies a runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.test.ts`:
- Around line 33-35: Remove the conditional statement in the test setup around
homeHasDcodeRuntime. In the relevant test initialization, build an array
containing the .deepagents directory only when the condition is true, then
iterate over that array to call fs.mkdirSync, preserving behavior without adding
an if statement.

In `@src/lib/actions/sandbox/dcode-activity-probe.ts`:
- Around line 41-58: Normalize each `/proc/*/cmdline` value in the fallback scan
before appending it to `processes`: update the transformation in the
`command_line` assignment within the fallback block to replace or remove literal
newlines after converting NUL separators to spaces. Preserve one process per
line so `detect_dcode_processes` cannot interpret crafted argv content as a
separate fake process.

---

Nitpick comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.test.ts`:
- Around line 16-88: Add a regression test in the “dcode activity probe” suite
using runProbeScriptWithProcessSources with psExitCode nonzero and no
procCmdlines, then assert the probe exits successfully and emits the expected
unverifiable/no-runtime sentinel for the fail-closed path when neither ps nor
/proc verifies a runtime.
🪄 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: 205316f7-fe33-4543-b57b-0d4936b33918

📥 Commits

Reviewing files that changed from the base of the PR and between ad518b3 and 3c5c3dc.

📒 Files selected for processing (4)
  • src/lib/actions/sandbox/dcode-activity-probe.test.ts
  • src/lib/actions/sandbox/dcode-activity-probe.ts
  • src/lib/actions/sandbox/snapshot.test.ts
  • src/lib/actions/sandbox/snapshot.ts

Comment thread src/lib/actions/sandbox/dcode-activity-probe.test.ts Outdated
Comment thread src/lib/actions/sandbox/dcode-activity-probe.ts

@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

♻️ Duplicate comments (1)
src/lib/actions/sandbox/dcode-activity-probe.ts (1)

48-52: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Normalize embedded newlines in /proc/*/cmdline.

tr '\000' ' ' preserves literal newlines in argv. A crafted argument such as \n123 dcode can create a synthetic matching process-list line and falsely report active, unnecessarily blocking snapshots. Replace or reject embedded newlines before appending the command line, and add a regression test.

🤖 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/dcode-activity-probe.ts` around lines 48 - 52,
Normalize or reject embedded newline characters in the command line produced by
the process scan before appending it to processes, preventing crafted argv
values from creating synthetic process-list entries and false active matches.
Update the scan logic around saw_proc_process and command_line, and add a
regression test covering an argument containing a newline such as “\n123 dcode”.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.ts`:
- Around line 45-68: Update the process scan around detect_dcode_processes to
track unreadable cmdline entries and failed reads separately from readable
processes, including glob entries that cannot be inspected. If any process entry
is skipped or its cmdline read fails, mark the scan incomplete and emit dcode
probe state unverifiable before allowing idle or no-runtime; only classify the
sandbox as idle when the /proc scan completed without omissions and no active
process was detected.

---

Duplicate comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.ts`:
- Around line 48-52: Normalize or reject embedded newline characters in the
command line produced by the process scan before appending it to processes,
preventing crafted argv values from creating synthetic process-list entries and
false active matches. Update the scan logic around saw_proc_process and
command_line, and add a regression test covering an argument containing a
newline such as “\n123 dcode”.
🪄 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: cd309e70-e163-4053-98c1-21f1513c0442

📥 Commits

Reviewing files that changed from the base of the PR and between 3c5c3dc and 53909f8.

📒 Files selected for processing (4)
  • src/lib/actions/sandbox/dcode-activity-probe.test.ts
  • src/lib/actions/sandbox/dcode-activity-probe.ts
  • src/lib/actions/sandbox/snapshot.test.ts
  • src/lib/actions/sandbox/snapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/actions/sandbox/snapshot.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/actions/sandbox/snapshot.ts

Comment thread src/lib/actions/sandbox/dcode-activity-probe.ts
@HOYALIM
HOYALIM force-pushed the codex/issue-6180-dcode-snapshot-idle branch from 53909f8 to aa8ad26 Compare July 9, 2026 23:56

@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

♻️ Duplicate comments (1)
src/lib/actions/sandbox/dcode-activity-probe.ts (1)

45-57: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Fail closed when /proc visibility is incomplete.

Unreadable cmdline files and read failures are silently skipped. If any other process is readable, the scan can report idle even though an active dcode process was hidden, allowing a running sandbox to be snapshotted. Track skipped, failed, and empty reads as an incomplete scan and emit unverifiable before allowing idle; add regression coverage for partial visibility.

This is the same unresolved incomplete-visibility failure mode reported in the previous review and conflicts with the PR’s fail-closed snapshot invariant.

Proposed fix
   processes=""
   saw_proc_process=0
+  proc_scan_incomplete=0
   for cmdline in "$proc_root"/[0-9]*/cmdline; do
-    [ -r "$cmdline" ] || continue
+    if [ ! -r "$cmdline" ]; then
+      proc_scan_incomplete=1
+      continue
+    fi
     pid="$(basename "$(dirname "$cmdline")")"
-    command_line="$(tr '\000\n\r' '   ' < "$cmdline" 2>/dev/null)" || continue
-    [ -n "$command_line" ] || continue
+    if ! command_line="$(tr '\000\n\r' '   ' < "$cmdline" 2>/dev/null)"; then
+      proc_scan_incomplete=1
+      continue
+    fi
+    if [ -z "$command_line" ]; then
+      proc_scan_incomplete=1
+      continue
+    fi
     saw_proc_process=1
...
   done
+  [ "$proc_scan_incomplete" -eq 0 ] || {
+    [ "$has_dcode_runtime" -eq 1 ] && emit_dcode_probe_state unverifiable
+    emit_dcode_probe_state no-runtime
+  }
🤖 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/dcode-activity-probe.ts` around lines 45 - 57, Update
the `/proc` scan around the process-discovery loop and `emit_dcode_probe_state`
handling to track unreadable, failed, and empty `cmdline` entries as an
incomplete scan instead of silently skipping them. When visibility is
incomplete, emit `unverifiable` before any `idle` result, while preserving the
existing `no-runtime` behavior where appropriate. Add regression coverage for
partial `/proc` visibility, including skipped and failed reads.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.test.ts`:
- Around line 39-46: Update the test setup around DCODE_BUSY_PROBE_SCRIPT to
avoid replacing shell source with the temporary procRoot path. Pass procRoot via
an environment variable or an explicit script-builder parameter, update the
probe invocation accordingly, and exercise the public probe boundary with a path
containing a single quote to verify behavior without relying on source-text
formatting.

---

Duplicate comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.ts`:
- Around line 45-57: Update the `/proc` scan around the process-discovery loop
and `emit_dcode_probe_state` handling to track unreadable, failed, and empty
`cmdline` entries as an incomplete scan instead of silently skipping them. When
visibility is incomplete, emit `unverifiable` before any `idle` result, while
preserving the existing `no-runtime` behavior where appropriate. Add regression
coverage for partial `/proc` visibility, including skipped and failed reads.
🪄 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: cd51ce16-90e7-4c40-af3d-5f018381fb7e

📥 Commits

Reviewing files that changed from the base of the PR and between 53909f8 and aa8ad26.

📒 Files selected for processing (4)
  • src/lib/actions/sandbox/dcode-activity-probe.test.ts
  • src/lib/actions/sandbox/dcode-activity-probe.ts
  • src/lib/actions/sandbox/snapshot.test.ts
  • src/lib/actions/sandbox/snapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/actions/sandbox/snapshot.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/actions/sandbox/snapshot.ts

Comment thread src/lib/actions/sandbox/dcode-activity-probe.test.ts Outdated
@HOYALIM
HOYALIM force-pushed the codex/issue-6180-dcode-snapshot-idle branch from aa8ad26 to 00d9e1e Compare July 10, 2026 00:05

@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

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

Inline comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.test.ts`:
- Around line 62-80: Update the fallback tests in
runProbeScriptWithProcessSources to assert the complete observable output rather
than searching for a substring: compare output.trim() exactly with the expected
DCODE_PROBE_PREFIX plus idleDcodeRuntime or active sentinel, or parse the output
and assert the single returned state. Apply the same exact-result assertion to
the additional fallback cases around the referenced later block.
🪄 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: 26784327-0704-44da-8f23-6bf07249acc6

📥 Commits

Reviewing files that changed from the base of the PR and between aa8ad26 and 00d9e1e.

📒 Files selected for processing (4)
  • src/lib/actions/sandbox/dcode-activity-probe.test.ts
  • src/lib/actions/sandbox/dcode-activity-probe.ts
  • src/lib/actions/sandbox/snapshot.test.ts
  • src/lib/actions/sandbox/snapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/actions/sandbox/snapshot.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/actions/sandbox/snapshot.ts

Comment thread src/lib/actions/sandbox/dcode-activity-probe.test.ts Outdated
@HOYALIM
HOYALIM force-pushed the codex/issue-6180-dcode-snapshot-idle branch from 00d9e1e to 4b39b6c Compare July 10, 2026 00:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/actions/sandbox/dcode-activity-probe.ts (1)

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

Derive the parser's state alternation from DCODE_PROBE_STATE instead of duplicating literals.

The regex hardcodes active|idle|unverifiable|no-runtime, duplicating the values already defined in DCODE_PROBE_STATE. If a state is renamed or added later, this regex can silently drift out of sync and either fail to parse a valid sentinel or (with a careless edit) widen the match unexpectedly.

♻️ Proposed fix deriving alternation from the state map
 export function parseDcodeProbeState(output: string): DcodeProbeState | null {
   const escapedPrefix = DCODE_PROBE_PREFIX.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+  const stateAlternation = Object.values(DCODE_PROBE_STATE).join("|");
   const matches = [
-    ...output.matchAll(new RegExp(`^${escapedPrefix}(active|idle|unverifiable|no-runtime)$`, "gm")),
+    ...output.matchAll(new RegExp(`^${escapedPrefix}(${stateAlternation})$`, "gm")),
   ];
   if (matches.length !== 1) return null;
   return (matches[0][1] as DcodeProbeState | undefined) ?? null;
 }
🤖 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/dcode-activity-probe.ts` around lines 86 - 93, Derive
the state alternation in parseDcodeProbeState from the keys or values of
DCODE_PROBE_STATE rather than hardcoding active, idle, unverifiable, and
no-runtime. Escape each derived state for regex safety, construct the
alternation dynamically, and preserve the existing single-match and
DcodeProbeState return behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/actions/sandbox/dcode-activity-probe.ts`:
- Around line 86-93: Derive the state alternation in parseDcodeProbeState from
the keys or values of DCODE_PROBE_STATE rather than hardcoding active, idle,
unverifiable, and no-runtime. Escape each derived state for regex safety,
construct the alternation dynamically, and preserve the existing single-match
and DcodeProbeState return behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a5a306aa-29b7-4ed2-b899-18f7903fc139

📥 Commits

Reviewing files that changed from the base of the PR and between 00d9e1e and 4b39b6c.

📒 Files selected for processing (4)
  • src/lib/actions/sandbox/dcode-activity-probe.test.ts
  • src/lib/actions/sandbox/dcode-activity-probe.ts
  • src/lib/actions/sandbox/snapshot.test.ts
  • src/lib/actions/sandbox/snapshot.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/actions/sandbox/snapshot.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/actions/sandbox/snapshot.ts

@HOYALIM
HOYALIM force-pushed the codex/issue-6180-dcode-snapshot-idle branch from 4b39b6c to 9667ea5 Compare July 10, 2026 00:21
Signed-off-by: Ho Lim <subhoya@gmail.com>
@HOYALIM
HOYALIM force-pushed the codex/issue-6180-dcode-snapshot-idle branch from 9667ea5 to 8ad4bd6 Compare July 10, 2026 00:28
@HOYALIM

HOYALIM commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@prekshivyas prekshivyas self-assigned this Jul 11, 2026
@cv cv added the v0.0.81 label Jul 11, 2026
@prekshivyas

prekshivyas commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

E2E Advisor Recommendation

Required E2E: onboard-repair, onboard-resume, state-backup-restore, upgrade-stale-sandbox, snapshot-commands
Optional E2E: sandbox-operations, inference-routing

Dispatch hint: onboard-repair,onboard-resume,state-backup-restore,upgrade-stale-sandbox,snapshot-commands

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: target/main
Head: HEAD
Confidence: high

Required E2E

  • onboard-repair: Required by the deterministic lifecycle-state risk plan: sandbox and onboarding state must converge across persisted metadata, reported status, and live runtime after repair paths.
  • onboard-resume: Required by the deterministic lifecycle-state risk plan: resume paths validate recovery from partial lifecycle state and guard against stale resources after retry.
  • state-backup-restore: Required by the deterministic upgrade-rebuild risk plan: snapshot and restore operations must preserve workspace, credentials, policy, messaging, and gateway state through backup and restore.
  • upgrade-stale-sandbox: Required by the deterministic upgrade-rebuild risk plan: stale sandbox upgrade/rebuild flows must preserve user state while replacing stale runtime state and remain retryable after failures.
  • snapshot-commands: Direct coverage for the modified snapshot command path: exercises live install, snapshot create/list/restore, OpenShell sandbox exec, backup directory inspection, and credential redaction boundaries.

Optional E2E

  • sandbox-operations: Adjacent confidence for live sandbox lifecycle operations and OpenShell interaction, but less direct than the required snapshot and backup/restore jobs.
  • inference-routing: Optional adjacent coverage for deepagents-code runtime execution through the live inference route; useful because the changed probe classifies dcode activity, but it does not directly validate snapshot quiescence.

New E2E recommendations

  • dcode snapshot quiescence guard (high): Existing unit tests cover proc/ps parsing and snapshot-commands covers ordinary snapshot lifecycle, but there does not appear to be a live E2E that starts or simulates an active deepagents-code task and asserts nemoclaw <sandbox> snapshot create fails closed before backup side effects.
    • Suggested test: Add a live E2E target for dcode snapshot quiescence that onboards a langchain-deepagents-code sandbox, makes the dcode runtime detectable as active or unverifiable, attempts snapshot creation, and verifies the command fails closed without creating a backup.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: onboard-repair,onboard-resume,state-backup-restore,upgrade-stale-sandbox,snapshot-commands

@prekshivyas

prekshivyas commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

E2E Target Recommendation

Required E2E targets: onboard-repair, onboard-resume, state-backup-restore, upgrade-stale-sandbox
Optional E2E targets: None

Dispatch required E2E targets:

  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=state-backup-restore
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=upgrade-stale-sandbox

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: target/main
Head: HEAD
Confidence: high

Required E2E targets

  • onboard-repair: Onboarding and sandbox state must converge across persisted metadata, reported status, and the live runtime.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • onboard-resume: Onboarding and sandbox state must converge across persisted metadata, reported status, and the live runtime.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume
  • state-backup-restore: Upgrade, rebuild, snapshot, and restore operations must preserve user state while replacing stale runtime state.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=state-backup-restore
  • upgrade-stale-sandbox: Upgrade, rebuild, snapshot, and restore operations must preserve user state while replacing stale runtime state.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=upgrade-stale-sandbox

Optional E2E targets

  • None.

Relevant changed files

  • src/lib/actions/sandbox/dcode-activity-probe.ts
  • src/lib/actions/sandbox/snapshot.ts

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

@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.

Exact-head maintainer gate passed at e5ab98d. The sandbox-controlled proc-root redirect is removed: production hard-codes /proc, the hostile legacy env is ignored in tests, and GPT returned merge_as_is with all security categories passing. Ordinary CI, CodeRabbit, Verified commits, 52 focused tests, state-backup-restore, onboard-repair, and onboard-resume are green. upgrade-stale-sandbox is explicitly waived because it failed before PR behavior while the unchanged base image requested Debian’s unavailable curl=8.14.1-2+deb13u3 pin.

@cv
cv merged commit 43a39e2 into NVIDIA:main Jul 11, 2026
37 checks passed
@cv cv mentioned this pull request Jul 12, 2026
21 tasks
cv added a commit that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Release-prep documentation for v0.0.81 now summarizes user-facing
changes merged since v0.0.80.
It also closes the Hermes dashboard-profile backup gap and distinguishes
direct blueprint-runner actions from public host CLI commands.

## Changes

- Add the `v0.0.81` section to `docs/about/release-notes.mdx` with links
to the detailed user guides.
- Document that Hermes rebuilds preserve `.hermes/dashboard-home/`,
including Dashboard `MEMORY.md` and `USER.md`.
- Update Hermes manual backup and restore examples to transfer those two
profile files without copying generated configuration or the
secret-bearing dashboard `.env`.
- Explain the new per-item backup failure causes.
- Clarify that migration snapshot retention fragments are direct-runner
arguments and are not exposed by the host `nemoclaw` CLI.

### Source summary

- #6445 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Summarize manifest-owned
key-level restore and current-config authority.
- #6617 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Record the fail-closed
`/proc` fallback used to verify an idle Deep Agents runtime before
snapshot creation.
- #6685 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Document Hermes Web
Dashboard profile persistence and safe manual transfer.
- #6649 -> `docs/about/release-notes.mdx`: Summarize host-validated
loopback compatible-endpoint routing through the sandbox gateway.
- #6643 -> `docs/about/release-notes.mdx`: Summarize automatic
`max_completion_tokens` handling for GPT-5 and o-series models.
- #6661 -> `docs/about/release-notes.mdx`: Summarize bounded connection
reuse for eligible provider-validation probes.
- #6704 -> `docs/about/release-notes.mdx`: Record that direct blueprint
apply stops instead of persisting incomplete state after provider or
inference setup fails.
- #6677 -> `docs/about/release-notes.mdx`: Summarize transactional
recovery for legacy Docker containers whose managed supervisor
disappeared after restart.
- #6625 -> `docs/about/release-notes.mdx`: Record Hermes managed-startup
persistence across direct Docker restarts.
- #6597 -> `docs/about/release-notes.mdx`: Record final-sandbox gateway
cleanup on macOS.
- #6680 -> `docs/about/release-notes.mdx`: Summarize managed Deep Agents
first-run and process-tree cleanup improvements.
- #6647 -> `docs/about/release-notes.mdx`: Record fail-closed validation
for the managed Deep Agents fetch CA bundle.
- #6645 -> `docs/about/release-notes.mdx`: Summarize WhatsApp loopback
pairing and trusted npm plugin provenance.
- #6673 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document stopped-sandbox
backup remediation.
- #6631 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document per-item backup
failure causes.
- #6620 -> `docs/about/release-notes.mdx`: Record the
created-but-not-ready sandbox lifecycle receipt.
- #6664 -> `docs/about/release-notes.mdx`: Record prompt-aware
onboarding progress output.
- #6598 -> `docs/about/release-notes.mdx`: Summarize stale replay-result
invalidation during resumed onboarding.
- #6593 -> `docs/about/release-notes.mdx`: Summarize contextual OpenClaw
audit findings for managed dashboard compatibility settings.
- #6650 -> `docs/about/release-notes.mdx`: Record redaction of
token-shaped URL query values.
- #6638 -> `docs/about/release-notes.mdx`: Record the exact-path MCP
`DELETE` policy recipe for session termination.
- #5453 -> `docs/reference/host-files-and-state.mdx`: Clarify that
snapshot retention actions belong to direct runner integrations and are
not standalone host CLI commands.

### Skipped from docs-skip

- #6633 matched the `openclaw-sandbox-permissive.yaml` path in
`docs/.docs-skip` and produced no documentation in this update.

## Type of Change

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

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This is a documentation-only
release-prep update; behavior is protected by the merged source PRs, and
the documentation build validates the changed examples and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [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 — tests are not applicable for this
documentation-only change; `npm run docs` completed successfully.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: not run for this
documentation-only change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — 0
errors; two existing Fern warnings remain.
- [x] 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)
— no new pages.

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


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

## Summary by CodeRabbit

- **Documentation**
- Added release notes for v0.0.81 covering state preservation, inference
setup, sandbox recovery, session setup, pairing, diagnostics, and
security policy updates.
- Expanded backup and restore guidance to include dashboard profile
files and clarify files that must not be copied.
- Added dashboard profile persistence details to workspace and rebuild
documentation.
- Clarified snapshot retention guidance and the distinction between host
CLI capabilities and direct runner actions.
  - Added more detailed backup failure reporting information.

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

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

- Move the dcode snapshot activity probe into a focused helper module so
the probe script can be tested directly.
- Fall back to scanning `/proc/*/cmdline` when `ps -eo pid=,args=` is
unavailable inside the sandbox.
- Keep the existing fail-closed behavior when neither `ps` nor `/proc`
can verify a dcode runtime, while allowing confirmed-idle dcode
sandboxes to snapshot.

## Validation

- `npx vitest run --project cli src/lib/actions/sandbox/snapshot.test.ts
src/lib/actions/sandbox/dcode-activity-probe.test.ts`
- `npm run typecheck`
- `git diff --check`
- `npx prek run --files src/lib/actions/sandbox/snapshot.ts
src/lib/actions/sandbox/snapshot.test.ts
src/lib/actions/sandbox/dcode-activity-probe.ts
src/lib/actions/sandbox/dcode-activity-probe.test.ts --stage pre-commit`
- `npm run check:diff`
- `npm --prefix nemoclaw ci`

Refs NVIDIA#6180

Signed-off-by: Ho Lim <subhoya@gmail.com>


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

- **Bug Fixes**
- Improved dcode activity detection when process details are
unavailable, using fail-closed “unverifiable runtime” results.
- Hardened probe output parsing to avoid incorrect idle/active
classification when sentinels are ambiguous or contradictory.
- **New Features**
- Added a sandboxed dcode activity probe that reports a single
machine-readable status/state (including active, idle, unverifiable, and
no-runtime).
- **Tests**
- Expanded sandbox tests with simulated process environments to cover
`ps` failures, incomplete visibility, and conflicting sentinel
scenarios.
- **Refactor**
- Centralized dcode probe parsing and state constants for reuse in
snapshot-creation eligibility checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Ho Lim <subhoya@gmail.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-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

Release-prep documentation for v0.0.81 now summarizes user-facing
changes merged since v0.0.80.
It also closes the Hermes dashboard-profile backup gap and distinguishes
direct blueprint-runner actions from public host CLI commands.

## Changes

- Add the `v0.0.81` section to `docs/about/release-notes.mdx` with links
to the detailed user guides.
- Document that Hermes rebuilds preserve `.hermes/dashboard-home/`,
including Dashboard `MEMORY.md` and `USER.md`.
- Update Hermes manual backup and restore examples to transfer those two
profile files without copying generated configuration or the
secret-bearing dashboard `.env`.
- Explain the new per-item backup failure causes.
- Clarify that migration snapshot retention fragments are direct-runner
arguments and are not exposed by the host `nemoclaw` CLI.

### Source summary

- NVIDIA#6445 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Summarize manifest-owned
key-level restore and current-config authority.
- NVIDIA#6617 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Record the fail-closed
`/proc` fallback used to verify an idle Deep Agents runtime before
snapshot creation.
- NVIDIA#6685 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Document Hermes Web
Dashboard profile persistence and safe manual transfer.
- NVIDIA#6649 -> `docs/about/release-notes.mdx`: Summarize host-validated
loopback compatible-endpoint routing through the sandbox gateway.
- NVIDIA#6643 -> `docs/about/release-notes.mdx`: Summarize automatic
`max_completion_tokens` handling for GPT-5 and o-series models.
- NVIDIA#6661 -> `docs/about/release-notes.mdx`: Summarize bounded connection
reuse for eligible provider-validation probes.
- NVIDIA#6704 -> `docs/about/release-notes.mdx`: Record that direct blueprint
apply stops instead of persisting incomplete state after provider or
inference setup fails.
- NVIDIA#6677 -> `docs/about/release-notes.mdx`: Summarize transactional
recovery for legacy Docker containers whose managed supervisor
disappeared after restart.
- NVIDIA#6625 -> `docs/about/release-notes.mdx`: Record Hermes managed-startup
persistence across direct Docker restarts.
- NVIDIA#6597 -> `docs/about/release-notes.mdx`: Record final-sandbox gateway
cleanup on macOS.
- NVIDIA#6680 -> `docs/about/release-notes.mdx`: Summarize managed Deep Agents
first-run and process-tree cleanup improvements.
- NVIDIA#6647 -> `docs/about/release-notes.mdx`: Record fail-closed validation
for the managed Deep Agents fetch CA bundle.
- NVIDIA#6645 -> `docs/about/release-notes.mdx`: Summarize WhatsApp loopback
pairing and trusted npm plugin provenance.
- NVIDIA#6673 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document stopped-sandbox
backup remediation.
- NVIDIA#6631 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document per-item backup
failure causes.
- NVIDIA#6620 -> `docs/about/release-notes.mdx`: Record the
created-but-not-ready sandbox lifecycle receipt.
- NVIDIA#6664 -> `docs/about/release-notes.mdx`: Record prompt-aware
onboarding progress output.
- NVIDIA#6598 -> `docs/about/release-notes.mdx`: Summarize stale replay-result
invalidation during resumed onboarding.
- NVIDIA#6593 -> `docs/about/release-notes.mdx`: Summarize contextual OpenClaw
audit findings for managed dashboard compatibility settings.
- NVIDIA#6650 -> `docs/about/release-notes.mdx`: Record redaction of
token-shaped URL query values.
- NVIDIA#6638 -> `docs/about/release-notes.mdx`: Record the exact-path MCP
`DELETE` policy recipe for session termination.
- NVIDIA#5453 -> `docs/reference/host-files-and-state.mdx`: Clarify that
snapshot retention actions belong to direct runner integrations and are
not standalone host CLI commands.

### Skipped from docs-skip

- NVIDIA#6633 matched the `openclaw-sandbox-permissive.yaml` path in
`docs/.docs-skip` and produced no documentation in this update.

## Type of Change

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

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This is a documentation-only
release-prep update; behavior is protected by the merged source PRs, and
the documentation build validates the changed examples and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [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 — tests are not applicable for this
documentation-only change; `npm run docs` completed successfully.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: not run for this
documentation-only change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — 0
errors; two existing Fern warnings remain.
- [x] 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)
— no new pages.

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


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

## Summary by CodeRabbit

- **Documentation**
- Added release notes for v0.0.81 covering state preservation, inference
setup, sandbox recovery, session setup, pairing, diagnostics, and
security policy updates.
- Expanded backup and restore guidance to include dashboard profile
files and clarify files that must not be copied.
- Added dashboard profile persistence details to workspace and rebuild
documentation.
- Clarified snapshot retention guidance and the distinction between host
CLI capabilities and direct runner actions.
  - Added more detailed backup failure reporting information.

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

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior labels Jul 30, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants