Skip to content

fix(cli): mirror installed Deep Agents skill into agent skills dir - #7724

Closed
rluo8 wants to merge 13 commits into
mainfrom
fix/7634-dcode-skill-mirror
Closed

fix(cli): mirror installed Deep Agents skill into agent skills dir#7724
rluo8 wants to merge 13 commits into
mainfrom
fix/7634-dcode-skill-mirror

Conversation

@rluo8

@rluo8 rluo8 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

skill install uploaded Deep Agents skills to /sandbox/.deepagents/skills/<name>, which Deep Agents Code never reads — its user skill directory is ~/.deepagents/<agent>/skills. The CLI reported success while the skill was never registered: absent from dcode skills list and from the agent's skill index. Install now mirrors into /sandbox/.deepagents/agent/skills/<name> and fails verification if that mirror is missing; remove deletes it. This is the Deep Agents counterpart of the OpenClaw mirror added in #4848.

Related Issue

Fixes #7634

Changes

  • src/lib/skill-install.ts: replace the OpenClaw-only mirrorDir special case with an AGENT_SKILL_MIRRORS table keyed by agent name. postInstall() and verifyInstall() branch on paths.mirrorDir instead of paths.isOpenClaw, so the existing fix(cli): mirror installed OpenClaw skill into agent home dir (Fixes #4819) #4848 mirror copy and verification apply to any agent that declares one. No new mechanism.
  • src/lib/skill-install.ts: the "Restart the agent gateway" hint now fires only when the agent has neither a mirror nor a session file — Deep Agents is a terminal runtime with no gateway.
  • src/lib/skill-remote.ts: removeSkill() and verifyRemove() branch on mirrorDir too, so remove stays symmetric with install.
  • src/lib/skill-remote.ts: checkExisting() deliberately does not probe a shared mirror. It gates skill remove, so it must answer "did NemoClaw install this?" — uploadDir is the ownership marker. dcode's skill-creator authors user skills straight into agent/skills ([All Platforms][Agent&Skills][GitHub Issue #5753] Deep Agents skill-creator does not persist custom skills into ~/.deepagents/agent/skills, so skills like note-summarizer are lost and cannot survive NemoClaw rebuild #5753); counting that as an install would let skill remove X delete a skill the user created in-sandbox. SkillPaths gains mirrorSharedWithAgent to make this explicit rather than incidental to the agent name.
  • src/lib/actions/sandbox/skill-install.ts: the verification-failure message names the mirror for any agent that has one.
  • docs/reference/commands.mdx: four corrections. The deepagents install variant promised a mirror no code implemented. Shared install prose claimed the session index refreshes "for new installs" — it actually refreshes on every install and update, and only for OpenClaw (sessionFile is null elsewhere); that clause moved into the openclaw block. Shared remove prose had the same scoping bug. The deepagents remove variant claimed a session-index refresh that does not exist.
  • docs/manage-sandboxes/workspace-files.mdx: /sandbox/.deepagents/skills/ was labelled "User-level skills available to Deep Agents Code"; it is the upload/snapshot directory, and agent/skills/ is what the agent loads.
  • Tests: 5 new cases covering path resolution, the install mirror, verification requiring the mirror, remove deleting it, and the agent-authored-skill guard.

Type of Change

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

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification:
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated | no-docs-needed | blocked
  • Evidence:
  • Agent:

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification:
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • 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: Rui Luo ruluo@nvidia.com

Summary by CodeRabbit

  • New Features
    • Added a fresh shared-skill installation flow for Deep Agents, installing directly into the agent’s active skills directory.
  • Bug Fixes
    • Tightened skill install validation to reject symlinks and unsupported/non-regular paths.
    • Prevented automatic removal of agent-owned/shared Deep Agents skills (with clearer operator guidance).
    • Improved mirrored-skill verification and session index/mirror validation behavior; refreshed OpenClaw session index after installs.
    • Refined install/remove collision handling, failure messaging, and exit codes.
  • Documentation
    • Updated skill install/remove command docs for OpenClaw and Deep Agents; clarified Deep Agents workspace state semantics.
  • Tests
    • Expanded Deep Agents install/remove, symlink rejection, snapshot/digest, and remote verification coverage.

@coderabbitai

coderabbitai Bot commented Jul 28, 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

Skill lifecycle handling now supports Deep Agents shared skill directories, atomic fresh installs, stricter path validation, ownership-aware removal, and agent-specific mirror/session behavior. Documentation and tests cover OpenClaw, Hermes, and Deep Agents flows.

Changes

Shared-agent skill lifecycle

Layer / File(s) Summary
Atomic shared-skill installation
src/lib/skill-install.ts, src/lib/skill-install.test.ts, src/lib/skill-install-shared.test.ts
Skill paths identify shared Deep Agents destinations; installation snapshots, hashes, validates, and atomically activates fresh skills without overwriting existing destinations.
Install and verification orchestration
src/lib/actions/sandbox/skill-install.ts, src/lib/actions/sandbox/skill-install.test.ts, src/lib/skill-install.ts
Sandbox installation rejects symlinks and unsupported paths, routes shared destinations through fresh installation, and applies configured mirror and session behavior.
Ownership-aware removal lifecycle
src/lib/skill-remote.ts, src/lib/skill-remote.test.ts, src/lib/actions/sandbox/skill-install.ts, src/lib/actions/sandbox/skill-install.test.ts
Removal probes configured mirrors but refuses automatic mutation of shared agent-authored directories; tests cover these outcomes.
Documented agent-specific behavior
docs/manage-sandboxes/workspace-files.mdx, docs/reference/commands.mdx
Documentation describes Deep Agents directories, fresh-name installation, OpenClaw refresh behavior, and manual removal of shared skills.

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

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant installSandboxSkill
  participant installFreshSharedSkill
  participant DeepAgentsSkills
  Operator->>installSandboxSkill: install skill
  installSandboxSkill->>installFreshSharedSkill: use shared destination flow
  installFreshSharedSkill->>DeepAgentsSkills: verify and atomically activate fresh skill
  DeepAgentsSkills-->>installSandboxSkill: return installation result
  Operator->>installSandboxSkill: remove skill
  installSandboxSkill-->>Operator: refuse automatic removal for shared content
Loading

Suggested labels: bug-fix

Suggested reviewers: cv, brandonpelfrey

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 is concise and matches the main Deep Agents skill-mirroring change.
Linked Issues check ✅ Passed The PR mirrors Deep Agents skills into the agent directory, addressing the #7634 hot-reload failure.
Out of Scope Changes check ✅ Passed The OpenClaw/Hermes and test/doc updates support the same install/remove flow and do not appear unrelated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/7634-dcode-skill-mirror

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

@github-code-quality

github-code-quality Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 7f7dea6 in the fix/7634-dcode-skill... branch remains at 96%, unchanged from commit 125ca30 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 7f7dea6 in the fix/7634-dcode-skill... branch remains at 81%, unchanged from commit cf34b72 in the main branch.

Show a code coverage summary of the most impacted files.
File main cf34b72 fix/7634-dcode-skill... 7f7dea6 +/-
src/lib/onboard...ndbox-create.ts 83% 33% -50%
src/lib/onboard...-create-plan.ts 88% 75% -13%
src/lib/onboard...ndbox-create.ts 91% 83% -8%
src/lib/onboard...etson-groups.ts 100% 96% -4%
src/lib/messagi...nnels/policy.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 88% 88% 0%
src/lib/skill-remote.ts 88% 93% +5%
src/lib/platform.ts 84% 89% +5%
src/lib/skill-install.ts 79% 85% +6%
src/lib/actions...kill-install.ts 48% 55% +7%

Updated July 29, 2026 00:48 UTC

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: Review the warnings below.
Findings: 0 blockers · 1 warning · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · medium confidence · 0 blockers · 1 warning · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 1 fewer warning, the same number of suggestions.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: onboard-repair, onboard-resume

2 optional E2E recommendations
  • skill-agent
  • ubuntu-repo-cloud-langchain-deepagents-code
1 warning · 0 suggestions

Warnings

Warnings do not block.

PRA-1 Warning — Prevent directory-swap symlink traversal during archive creation

  • Location: src/lib/skill-install.ts:318
  • Category: security
  • Problem: The shared Deep Agents install collects safe relative paths, then starts `tar` on those mutable paths. An attacker who replaces an intermediate selected directory with a symlink after collection can cause `tar` to archive a readable host file outside the skill directory. The extracted archive contains regular files and passes the later validation, so its content is uploaded to the sandbox.
  • Impact: A local attacker who can modify the supplied skill tree concurrently can exfiltrate host-readable file content into the sandbox through `skill install`.
  • Recommendation: Create the archive from descriptor-anchored traversal that refuses symlinked directories and files at read time, or revalidate every archive input with no-follow descriptor operations immediately before adding it.
  • Verification: Inspect the archive-creation path and add an injected filesystem race that swaps `scripts/` for a symlink before `tar` opens `scripts/<file>`; assert the operation returns `snapshot_failed`.
  • Test coverage: Add a deterministic test that replaces a selected nested directory with a symlink between collection and archive creation, then proves installation fails and the external target bytes are absent from SSH input.
  • Simplification (native): Remove The mutable pathname-based tar input path.; use Use descriptor-anchored no-follow file reads or a no-follow archive builder for the already selected entries.. Net: 0 lines.
  • Keep: Preserve the regular-file-only and exact-content attestation checks while preventing traversal outside the selected skill tree.
  • Evidence: src/lib/skill-install.ts:318-323 builds the archive from mutable relative path names after `collectFiles()` completes. src/lib/skill-install.ts:331-339 validates the extracted archive only after tar has read its input, so a dereferenced external file appears as a regular file. src/lib/skill-install.test.ts covers a visible symlink but not replacement of an intermediate directory after collection.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@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

Caution

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

⚠️ Outside diff range comments (1)
src/lib/skill-install.ts (1)

267-320: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

postInstall can silently clobber agent-authored content in a shared mirror.

For agents with sharedWithAgent: true (Deep Agents), mirrorDir is the same path the agent's own tooling (skill-creator) writes user-authored skills into — that's exactly why checkExisting/removeSkill in src/lib/skill-remote.ts special-case mirrorSharedWithAgent to avoid treating that directory as NemoClaw-owned. postInstall doesn't apply the same protection: whenever paths.mirrorDir is set it unconditionally runs rm -rf ${dst} && cp -a ${src} ${dst}, even when a fresh (non-update) install happens to collide in name with a skill the user authored directly in agent/skills via dcode. That silently destroys the user's content with no warning.

installSandboxSkill already computes isUpdate/existingCheck before calling postInstall — plumbing that through (or re-probing mirror existence for mirrorSharedWithAgent agents) would let postInstall warn instead of blindly overwriting when it's a fresh install colliding with existing mirror content.

🛡️ Sketch of a guard against clobbering agent-authored mirrors
 export function postInstall(
   ctx: SshContext,
   paths: SkillPaths,
   _localSkillDir: string,
   opts: {
     skipRefresh?: boolean;
     sshExecImpl?: typeof sshExec;
+    isUpdate?: boolean;
   } = {},
 ): { success: boolean; messages: string[] } {
   const messages: string[] = [];
   const runSsh = opts.sshExecImpl ?? sshExec;

   if (paths.mirrorDir) {
     const src = shellQuote(paths.uploadDir);
     const dst = `"${paths.mirrorDir}"`;
+    if (paths.mirrorSharedWithAgent && !opts.isUpdate) {
+      const mirrorExists = runSsh(ctx, `test -e ${dst}`);
+      if (mirrorExists && mirrorExists.status === 0) {
+        messages.push(
+          `Warning: ${paths.mirrorDir} already exists and may be agent-authored; skipping mirror to avoid overwriting it`,
+        );
+        return { success: true, messages };
+      }
+    }
     const mirrorParent = `"${paths.mirrorDir.slice(0, paths.mirrorDir.lastIndexOf("/"))}"`;
     ...
🤖 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/skill-install.ts` around lines 267 - 320, Update installSandboxSkill
and postInstall to propagate the existing fresh-install/update state and mirror
ownership information, using the existing existingCheck or mirrorSharedWithAgent
symbols. In postInstall, when a shared mirror already exists during a fresh
install, do not run the rm -rf/cp overwrite; emit a warning and preserve the
agent-authored content, while retaining replacement behavior for legitimate
updates and unchanged behavior for non-shared mirrors.
🤖 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 `@docs/manage-sandboxes/workspace-files.mdx`:
- Line 173: Update the command example in the workspace-files documentation
table to use the shared $$nemoclaw placeholder instead of nemoclaw, preserving
the existing skill install arguments and description.

---

Outside diff comments:
In `@src/lib/skill-install.ts`:
- Around line 267-320: Update installSandboxSkill and postInstall to propagate
the existing fresh-install/update state and mirror ownership information, using
the existing existingCheck or mirrorSharedWithAgent symbols. In postInstall,
when a shared mirror already exists during a fresh install, do not run the rm
-rf/cp overwrite; emit a warning and preserve the agent-authored content, while
retaining replacement behavior for legitimate updates and unchanged behavior for
non-shared mirrors.
🪄 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: 3933447c-b6b1-4975-a795-a92c96c3a6cd

📥 Commits

Reviewing files that changed from the base of the PR and between 45da24e and d4609ff.

📒 Files selected for processing (8)
  • docs/manage-sandboxes/workspace-files.mdx
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/skill-install.test.ts
  • src/lib/actions/sandbox/skill-install.ts
  • src/lib/skill-install.test.ts
  • src/lib/skill-install.ts
  • src/lib/skill-remote.test.ts
  • src/lib/skill-remote.ts

Comment thread docs/manage-sandboxes/workspace-files.mdx Outdated
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@cjagwani cjagwani added v0.0.98 and removed v0.0.97 labels Jul 28, 2026
Comment thread src/lib/skill-install-shared.test.ts Fixed
Comment thread src/lib/skill-install-shared.test.ts Fixed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/lib/skill-install-shared.test.ts (1)

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

These command-text assertions lock in the script's wording rather than its behavior.

toContain('mv -nT -- "$payload" "$leaf"') and friends fail on any harmless rewrite of the generated script, while the Linux-gated tests below already prove the properties that matter (exact bytes installed, no-clobber, staging cleaned up). The two negative assertions on Line 88 and Line 90 guard against constructs this PR never emits, so they don't protect a contract.

Consider keeping only the assertion that the input is a streamed buffer plus the outcome assertions, and dropping the substring matching.

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

🤖 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/skill-install-shared.test.ts` around lines 83 - 90, The test
over-specifies generated script wording through brittle substring assertions. In
the relevant test, remove the command-text checks for implementation details
such as tar flags, sha256sum, move commands, cleanup markers, and negative
path/command substrings; retain the streamed-buffer assertion and observable
installation outcome assertions, including the Linux-gated behavior tests.

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.

Inline comments:
In `@src/lib/actions/sandbox/skill-install.ts`:
- Around line 348-350: Update the shared-install success path in the skill
installation flow before its return to print explicit reload guidance, matching
the existing agent-specific or postInstall messaging so Deep Agents users know
when dcode will recognize the newly installed skill.

In `@src/lib/skill-install.ts`:
- Around line 402-408: Update the extraction and manifest flow in the skill
installation logic to preserve executable file modes instead of using
--no-same-permissions. If permissions are normalized for safety, apply an
explicit normalization that retains user execute bits and ensure the manifest
records each file’s mode alongside its content hash so mode changes are attested
consistently with uploadDirectory/scp installs.

---

Nitpick comments:
In `@src/lib/skill-install-shared.test.ts`:
- Around line 83-90: The test over-specifies generated script wording through
brittle substring assertions. In the relevant test, remove the command-text
checks for implementation details such as tar flags, sha256sum, move commands,
cleanup markers, and negative path/command substrings; retain the
streamed-buffer assertion and observable installation outcome assertions,
including the Linux-gated behavior tests.
🪄 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: 0a2385d5-88ba-4c3a-8e3f-b4203481e3aa

📥 Commits

Reviewing files that changed from the base of the PR and between d4609ff and 0427877.

📒 Files selected for processing (9)
  • docs/manage-sandboxes/workspace-files.mdx
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/skill-install.test.ts
  • src/lib/actions/sandbox/skill-install.ts
  • src/lib/skill-install-shared.test.ts
  • src/lib/skill-install.test.ts
  • src/lib/skill-install.ts
  • src/lib/skill-remote.test.ts
  • src/lib/skill-remote.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/manage-sandboxes/workspace-files.mdx
  • src/lib/skill-remote.ts

Comment thread src/lib/actions/sandbox/skill-install.ts
Comment thread src/lib/skill-install.ts Outdated
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior labels Jul 28, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for the PR. This fixes the Deep Agents skill mirror so installed skills appear in dcode skills list and the agent's skill index. Maintainers will review the CLI integration, mirror path, and verification logic.


Related open issues:


Related open PRs:


Related open issues:

cv pushed a commit that referenced this pull request Jul 29, 2026
…7850)

<!-- markdownlint-disable MD041 -->
## Summary

This credited replacement for #7724 installs Deep Agents Code skills
into the directory the agent actually loads while preserving
agent-authored content.
Rui Luo authored the original fix; commit `165325267` preserves Rui as
the author, and the follow-up commits incorporate the maintainer and
automated-review hardening.

## Related Issue

Fixes #7634

## Changes

- Install fresh Deep Agents Code skills directly under
`/sandbox/.deepagents/agent/skills/<name>`.
- Refuse automatic update or removal when the destination is shared with
agent-authored content.
- Copy regular files into a private no-follow host snapshot, attest
paths, normalized modes, and SHA-256 digests, and reject identity
changes.
- Stage and verify the exact archive inside the sandbox before an atomic
no-clobber move.
- Cover fresh install, collisions, corrupt archives, mode normalization,
unsupported paths, and local path races.
- Document the supported Deep Agents Code lifecycle and manual
confirm-ownership recovery path.

## Type of Change

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

## Quality Gates

- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: Exact-head
nine-category maintainer security review passed at `a84264939`; diff
fingerprint
`4128a6d3c613892f96aa22013e24e2d8f80363c35c552245f2592fba0f84f10d`;
review:
#7850 (review).
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: The exact-head root-identity hardening does not change CLI
usage, output, configuration, defaults, or supported workflows. Existing
docs already state that identity changes and symlinks are rejected, so
no docs build was needed.
- Agent: Codex Desktop
<!-- docs-review-head-sha: a842649 -->
<!-- docs-review-agents-blob-sha: c052d60 -->

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run validate:pr` passed after refreshing `origin/main` when hooks
were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — skill-install-focused set at reviewed
code parent `7b4ce366a`: 52 passed, 7 Linux-only skipped; CLI typecheck
and normal hooks passed. The exact-head merge adds current `main` with
no skill-install overlap.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>


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

* **New Features**
* Added integrity-verified, no-clobber “fresh” installs for Deep Agents
shared skill directories, with stronger collision protection and safer
ownership expectations.
* **Bug Fixes**
* Hardened skill install/remove to reject symlinks and unsafe paths,
improve fail-closed handling, and align mirror/session cleanup and
verification across configurations.
* Improved OpenClaw behavior to refresh session indexing after skill
installs/updates and better recover missing gateway components.
* **Documentation**
* Clarified Deep Agents skill directory semantics and tightened `skill
install/remove` rules around `SKILL.md`, ownership, and removal safety.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Rui Luo <ruluo@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Rui Luo <ruluo@nvidia.com>
Co-authored-by: cjagwani <cjagwani@nvidia.com>
@cjagwani

Copy link
Copy Markdown
Collaborator

Queue handoff (comment only; no changes-requested review): #7850 has now merged into main with the same Deep Agents skill-install objective and the symlink-safe, non-clobbering behavior required for this path. This PR is also currently dirty against main, so it should not be refreshed as a competing implementation. Please close it as superseded; I’ll keep the merged implementation under release validation rather than duplicate the fix here.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Closing as superseded by merged #7850. The replacement preserves Rui Luo's original authored commit and co-author credit, and includes the additional no-clobber and race-safety hardening needed for the Deep Agents skill lifecycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output 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.

[macOS][Agent&Skills] dcode skill hot-reload fails to customize SKILL.MD inside sandbox — exit 1

7 participants