fix(sandbox): resolve OpenClaw workspace templates from installed pac…#3449
fix(sandbox): resolve OpenClaw workspace templates from installed pac…#3449IronLung7 wants to merge 12 commits into
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughseed_default_workspace_templates now probes multiple candidate OpenClaw package roots (global npm root, system path, binary package dir), searches multiple template subpaths, and logs tried locations. Root-mode invocation uses STEP_DOWN_PREFIX_SANDBOX. A Vitest suite validates discovery variants, seeding behavior, safety checks, and the startup invocation. ChangesTemplate Seeding Discovery and Execution
Sequence DiagramsequenceDiagram
participant Seeder as seed_default_workspace_templates
participant NPM as "npm root (-g)"
participant SYS as "/usr/local/lib/node_modules/openclaw"
participant BIN as "openclaw binary package dir"
Seeder->>NPM: query global npm root
Seeder->>SYS: probe fixed system package path
Seeder->>BIN: resolve package dir from openclaw binary
Seeder->>Seeder: check docs/reference/templates and dist/docs/reference/templates subpaths
Seeder->>Seeder: set templates_dir on first match or log tried: list
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| 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)" |
d860a77 to
32d9125
Compare
32d9125 to
e39cec4
Compare
Selective E2E Results — ✅ All requested jobs passedRun: 26179700021
|
jyaunches
left a comment
There was a problem hiding this comment.
Approved after manual E2E advisor review and dispatching required follow-up E2E coverage. Required runs are in progress.
|
Thanks for the contribution. This PR is currently blocked by the repository rule requiring verified commit signatures. I’m going to carry this forward in a maintainer-squashed PR so the fix can land, but for future contributions please configure commit signing so GitHub shows your commits as Verified before opening the PR. See GitHub’s docs for signing commits with GPG, SSH, or S/MIME. |
## 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 - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [ ] `npx prek run --all-files` passes - [ ] `npm test` passes - [x] 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) - [ ] 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: Julie Yaunches <jyaunches@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/3917?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 --> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
|
Done in #3917 |
Pull request was closed
|
Thank you @jyaunches |
…kage
Summary
Fix empty default workspaces when OpenClaw bootstrap is skipped.
NemoClaw sets
agents.defaults.skipBootstrap=trueto avoid the interactive identity setup turn. OpenClaw normally seeds workspace template files during that bootstrap path, so NemoClaw added its own seeding step. However, the seeder only looked under$(npm root -g)/openclaw/....In the sandbox,
npm root -gcan resolve to/tmp/npm-global/lib/node_modules, while the bundled OpenClaw package and templates are installed under/usr/local/lib/node_modules/openclaw. That made the seeder miss the real templates and leave/sandbox/.openclaw/workspace/empty.Related Issue
Fixes #3240
Changes
$(npm root -g)/openclaw/usr/local/lib/node_modules/openclawcommand -v openclawdocs/reference/templatesdist/docs/reference/templatesType of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Leo Zhu lingyuez@nvidia.com
Summary by CodeRabbit
Improvements
Tests