Skip to content

fix(sandbox): resolve workspace templates from package#3917

Merged
ericksoa merged 2 commits into
mainfrom
maintainer/pr-3449-signed-squash
May 20, 2026
Merged

fix(sandbox): resolve workspace templates from package#3917
ericksoa merged 2 commits into
mainfrom
maintainer/pr-3449-signed-squash

Conversation

@jyaunches

@jyaunches jyaunches commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Carries forward PR #3449 as a maintainer-signed squash commit so the sandbox workspace template fix can pass the repository verified-signature merge rule. The change resolves OpenClaw workspace templates from the installed package instead of relying on mutable source checkout paths.

Related Issue

Fixes #3240

Changes

  • Update scripts/nemoclaw-start.sh to resolve workspace templates from the installed package location.
  • Add regression coverage in test/nemoclaw-start.test.ts for sandbox template seeding and step-down wrapper behavior.
  • Preserve original author attribution via Co-authored-by on the signed squash commit.

Type of Change

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

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make 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: Julie Yaunches jyaunches@nvidia.com

Summary by CodeRabbit

  • Improvements

    • More reliable default workspace template discovery and seeding across installation layouts, including sandboxed start flows; emits clearer diagnostics when no templates are found.
  • Tests

    • Added comprehensive tests covering template seeding behavior, edge cases (skip bootstrap, existing content, symlinked workspaces), multiple template layouts, and sandboxed invocation.

Review Change Stack

Carry forward PR #3449 in a maintainer-signed squash commit so the change can pass the repository verified-signature merge rule.

Co-authored-by: IronLung7 <IronLung7@users.noreply.github.com>

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
@jyaunches jyaunches added the v0.0.47 Release target label May 20, 2026
@jyaunches jyaunches self-assigned this May 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This repository limits contributors to 10 open pull requests. Please close or merge existing PRs before opening new ones.

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d892fd8c-5607-48f4-a24c-d73bedeb7d9d

📥 Commits

Reviewing files that changed from the base of the PR and between fbc2e62 and 2cf8787.

📒 Files selected for processing (2)
  • scripts/nemoclaw-start.sh
  • test/nemoclaw-start.test.ts

📝 Walkthrough

Walkthrough

Expands template discovery to probe multiple OpenClaw package roots and subpaths, adds a sandbox step-down wrapper to run seeding under the sandbox context, replaces the inline sandbox invocation with the wrapper, and adds tests covering discovery, gating, non-clobbering, symlink refusal, and sandbox execution.

Changes

Template Seeding Robustness

Layer / File(s) Summary
Template directory search expansion
scripts/nemoclaw-start.sh
seed_default_workspace_templates now discovers candidate OpenClaw roots (global npm root, hardcoded global install path, and the openclaw binary package directory) and checks both docs/reference/templates and dist/docs/reference/templates subdirectories, tracking attempted paths and improving diagnostics when templates are missing.
Sandbox wrapper helper and invocation
scripts/nemoclaw-start.sh
Adds seed_default_workspace_templates_as_sandbox which exports the seeding function into a bash -c subshell and invokes it under STEP_DOWN_PREFIX_SANDBOX; the previous inline sandbox invocation in root-mode is replaced with a call to this helper.
Template seeding test coverage
test/nemoclaw-start.test.ts
New Vitest suite exercises template discovery from multiple root/subpath candidates (including binary-resolved package root), verifies bootstrap skipping, non-clobbering, symlink refusal, error on missing templates, and validates execution via the sandbox wrapper; also stubs the wrapper in the Telegram diagnostics harness.

Sequence Diagram(s)

No sequence diagram necessary.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

NemoClaw CLI, fix

Suggested reviewers

  • ericksoa

Poem

🐰 In sandbox soil the tiny seeds are sown,

We search through roots where hidden templates grown,
From docs or dist the guarded files we find,
Skip the BOOTSTRAP.md and leave old files kind,
Tests hop in place — the workspace springs to life.

🚥 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 describes the main change: resolving workspace templates from the installed package instead of relying on mutable source checkout paths.
Linked Issues check ✅ Passed The PR implements the required fix for issue #3240 by updating template resolution logic and adding comprehensive test coverage for sandbox template seeding behavior.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving issue #3240: script updates for template discovery/seeding and corresponding test coverage with no unrelated modifications.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch maintainer/pr-3449-signed-squash

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

@github-actions github-actions Bot closed this May 20, 2026
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Recommendation: info only
Confidence: low
Analyzed HEAD: 2cf8787b3a76103ebf4fda5a03813d6ebb6db896
Findings: 0 blocker(s), 1 warning(s), 0 suggestion(s)

This is an automated advisory review. A human maintainer must make the final merge decision.

Limitations: Advisor execution failed: Could not configure advisor model openai/openai/gpt-5.5

Workflow run

Full advisor summary

PR Review Advisor

Base: origin/main
Head: HEAD
Analyzed SHA: 2cf8787b3a76103ebf4fda5a03813d6ebb6db896
Recommendation: info only
Confidence: low

PR review advisor failed: Could not configure advisor model openai/openai/gpt-5.5

Gate status

  • CI: pending — 9 status context(s) appear pending.
  • Mergeability: fail — mergeStateStatus=BLOCKED
  • Review threads: fail — 1 unresolved review thread(s).
  • Risky code tested: warning — Risky areas detected (installer/bootstrap shell, onboarding/host glue); test files changed, but coverage still needs semantic review.

🔴 Blockers

  • None.

🟡 Warnings

  • PR review advisor unavailable: The automated advisor could not complete: Could not configure advisor model openai/openai/gpt-5.5
    • Recommendation: Re-run the PR Review Advisor or perform a manual review.
    • Evidence: Could not configure advisor model openai/openai/gpt-5.5

🔵 Suggestions

  • None.

Acceptance coverage

  • No linked acceptance clauses were analyzed.

Security review

  • warning — Secrets and Credentials: Advisor unavailable; human review required.
  • warning — Input Validation and Data Sanitization: Advisor unavailable; human review required.
  • warning — Authentication and Authorization: Advisor unavailable; human review required.
  • warning — Dependencies and Third-Party Libraries: Advisor unavailable; human review required.
  • warning — Error Handling and Logging: Advisor unavailable; human review required.
  • warning — Cryptography and Data Protection: Advisor unavailable; human review required.
  • warning — Configuration and Security Headers: Advisor unavailable; human review required.
  • warning — Security Testing: Advisor unavailable; human review required.
  • warning — Holistic Security Posture: Advisor unavailable; human review required.

Test / E2E status

  • Test depth: e2e_required — Runtime/sandbox/infrastructure paths need real execution coverage: scripts/nemoclaw-start.sh.
  • E2E Advisor: not_found (not found)

✅ What looks good

  • No positives were identified by the advisor.

Review completeness

  • Advisor execution failed: Could not configure advisor model openai/openai/gpt-5.5
  • Human maintainer review required: yes

Comment thread scripts/nemoclaw-start.sh
openclaw_pkg_roots+=("/usr/local/lib/node_modules/openclaw")
if openclaw_bin="$(command -v openclaw 2>/dev/null)"; then
openclaw_real="$(readlink -f "$openclaw_bin" 2>/dev/null || printf '%s\n' "$openclaw_bin")"
openclaw_pkg="$(cd "$(dirname "$openclaw_real")/.." 2>/dev/null && pwd -P || true)"
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: cloud-onboard-e2e, sandbox-survival-e2e
Optional E2E: skill-agent-e2e, shields-config-e2e

Dispatch hint: cloud-onboard-e2e,sandbox-survival-e2e

Auto-dispatched E2E: cloud-onboard-e2e, sandbox-survival-e2e via nightly-e2e.yaml at 2cf8787b3a76103ebf4fda5a03813d6ebb6db896nightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • cloud-onboard-e2e (medium): Validates install/onboard into a live OpenClaw sandbox and exercises scripts/nemoclaw-start.sh during first boot, including sandbox health, security checks, and inference.local after the workspace seeding path runs.
  • sandbox-survival-e2e (medium): Covers sandbox startup and restart lifecycle with workspace/OpenClaw state persistence. This is important because the PR changes the sandbox entrypoint before gateway launch and workspace initialization ownership/step-down behavior.

Optional E2E

  • skill-agent-e2e (medium): Useful confidence for a real OpenClaw assistant user flow after workspace template seeding, because it verifies the agent can read sandbox skills and complete an agent turn.
  • shields-config-e2e (medium): Optional security-adjacent check because the modified entrypoint area is near config/workspace ownership and locked-file behavior; this job validates shields/config mutability and token rotation controls.

New E2E recommendations

  • OpenClaw workspace template seeding (high): Existing E2E coverage appears to exercise live onboarding/startup but does not explicitly assert that AGENTS.md, SOUL.md, IDENTITY.md, USER.md, TOOLS.md, and HEARTBEAT.md are seeded from the installed OpenClaw templates, that BOOTSTRAP.md is omitted, and that files are sandbox-owned in a live sandbox.
    • Suggested test: Add a workspace-template-seeding E2E, or extend cloud-onboard-e2e, to inspect /sandbox/.openclaw/workspace after first boot with skipBootstrap=true and assert expected template files/content, BOOTSTRAP.md absence, ownership, and non-clobber behavior.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: cloud-onboard-e2e,sandbox-survival-e2e

@jyaunches jyaunches reopened this May 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26182279881
Target ref: 190636c2784941623bcee163ef1cd49c2051c5d5
Workflow ref: main
Requested jobs: cloud-onboard-e2e
Summary: 0 passed, 0 failed, 0 skipped

Job Result
cloud-onboard-e2e ⚠️ cancelled

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26182589337
Target ref: 190636c2784941623bcee163ef1cd49c2051c5d5
Workflow ref: main
Requested jobs: cloud-onboard-e2e,sandbox-survival-e2e
Summary: 0 passed, 0 failed, 0 skipped

Job Result
cloud-onboard-e2e ⚠️ cancelled
sandbox-survival-e2e ⚠️ cancelled

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26182964890
Target ref: 2cf8787b3a76103ebf4fda5a03813d6ebb6db896
Workflow ref: main
Requested jobs: cloud-onboard-e2e,sandbox-survival-e2e
Summary: 2 passed, 0 failed, 0 skipped

Job Result
cloud-onboard-e2e ✅ success
sandbox-survival-e2e ✅ success

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

Approved after adversarial review at head 2cf8787. The workspace-template seeding path is gated on skipBootstrap, avoids symlink/non-empty workspace clobbering, uses the installed OpenClaw package templates, and runs through the sandbox step-down path for ownership. Focused local validation passed, PR checks are green, and the required selective E2E run passed cloud-onboard-e2e and sandbox-survival-e2e. The remaining GHAS ShellCheck note is informational and not a behavioral blocker in this context.

@ericksoa ericksoa merged commit 4dbe4c0 into main May 20, 2026
28 checks passed
miyoungc added a commit that referenced this pull request May 21, 2026
## Summary
Refreshes NemoClaw release notes for v0.0.47 and v0.0.48, then
regenerates the corresponding user-skill references so agent-facing docs
match the source pages.

Preview:
https://nvidia-preview-docs-release-notes-47-48.docs.buildwithfern.com/nemoclaw/about/release-notes

## Changes
- Adds explicit v0.0.47 and v0.0.48 sections to
`docs/about/release-notes.mdx`.
- Documents follow-up WSL Ollama, sandbox image, share mount, and
troubleshooting updates from recent release changes.
- Regenerates `nemoclaw-user-*` skill references from the Fern MDX
source docs.

## Source Summary
- #4003 -> `docs/about/release-notes.mdx`: Notes the messaging manifest
registry work as part of v0.0.48 release coverage.
- #3984 -> `docs/about/release-notes.mdx`: Captures Hermes messaging
policy scoping in the v0.0.48 release notes.
- #3963 -> `docs/about/release-notes.mdx`: Captures DGX Spark Hermes GPU
recreation startup recovery in the v0.0.48 release notes.
- #3961 -> `docs/about/release-notes.mdx`: Captures Discord loopback
proxy routing in the v0.0.48 release notes.
- #3940 -> `docs/about/release-notes.mdx`: Captures installer prompt
clarification and express-install behavior in the v0.0.48 release notes.
- #3946 -> `docs/about/release-notes.mdx`: Carries forward the Homebrew
preinstall clarification in release coverage.
- #3937 -> `docs/about/release-notes.mdx`: Carries forward the dashboard
URL command and post-install next steps coverage.
- #3921 -> `docs/about/release-notes.mdx`: Carries forward managed vLLM
default behavior for DGX Spark and DGX Station.
- #3931 -> `docs/about/release-notes.mdx`,
`docs/reference/architecture.mdx`: Documents the sandbox `python` to
`python3` compatibility symlink.
- #1485 -> `docs/about/release-notes.mdx`,
`docs/reference/architecture.mdx`: Documents the sandbox image Docker
health check.
- #3784 -> `docs/about/release-notes.mdx`: Captures VM-driver snapshot
health-check reliability in release notes.
- #3917 -> `docs/about/release-notes.mdx`: Captures package-based
workspace template resolution in release notes.
- #3170 -> `docs/about/release-notes.mdx`: Captures installer checksum
compatibility from preferring `sha256sum`.
- #3898 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage
for messaging provider scenario validation.
- #3897 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage
for baseline onboarding scenario validation.
- #3834 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage
for PR review advisor automation.
- #3838 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage
for CLI display registry refactoring.

## 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)

## Verification
- [x] `npx prek run --all-files` passes
- [ ] `npm test` passes
- [ ] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs updated for user-facing behavior changes
- [ ] `make 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)

`make docs` was attempted but could not complete because `npx fern-api`
failed with `403 Forbidden` from `https://registry.npmjs.org/fern-api`
in this environment. Pre-commit and pre-push hooks passed after
refreshing the local CLI build output with `npm run build:cli`; no build
artifacts were committed.

---
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>

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

* **Documentation**
* Added WSL onboarding notes for Windows-host Ollama detection, restart
guidance, and PowerShell checks.
* Clarified express-install behavior (non-interactive, sudo prompts) and
default sandbox policy selection.
* Added Windows preparation guidance when installer tooling is missing
(winget/App Installer or Docker Desktop).
* Expanded sandbox docs with Docker health checks, Homebrew/python
compatibility helpers, share-mount path validation, Discord
troubleshooting, and new v0.0.48/v0.0.47 release notes.
* **Chores**
  * Improved docs preview workflow error handling.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/4007?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
@jyaunches jyaunches deleted the maintainer/pr-3449-signed-squash branch June 12, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression v0.0.47 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/sandbox/.openclaw/workspace/ is empty

4 participants