Skip to content

fix(onboard): normalize blueprint build permissions#3664

Merged
cv merged 4 commits into
NVIDIA:mainfrom
ChunkyMonkey11:fix/3634-kimi-manifest-readable
May 17, 2026
Merged

fix(onboard): normalize blueprint build permissions#3664
cv merged 4 commits into
NVIDIA:mainfrom
ChunkyMonkey11:fix/3634-kimi-manifest-readable

Conversation

@ChunkyMonkey11

@ChunkyMonkey11 ChunkyMonkey11 commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Normalize NemoClaw blueprint permissions during sandbox build staging and inside the OpenClaw Docker image so model-specific setup manifests remain readable when config generation runs as the non-root sandbox user. This prevents Kimi K2.6 onboarding builds from depending on restrictive host checkout file modes.

Related Issue

Fixes #3634

Changes

  • Add a Dockerfile permission normalization step for /opt/nemoclaw-blueprint before generate-openclaw-config.py runs.
  • Normalize copied blueprint directory and file modes in both legacy and optimized sandbox build-context staging.
  • Add regression coverage for restrictive model-specific-setup manifest modes and the Dockerfile permission-normalization block.

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)

Passed locally:

  • npm run build:cli
  • npx vitest run test/sandbox-build-context.test.ts test/sandbox-provisioning.test.ts
  • npm run typecheck:cli
  • git diff --check

npm test failed in unrelated existing tests: two test/generate-openclaw-config.test.ts numeric env-var assertions receive Infinity instead of falling back to defaults, and one e2e helper timeout appeared in the full root run. The focused regression tests for this fix passed in both targeted runs and the larger test runs.

npx prek run --all-files and the push hook failed on the same unrelated CLI test failure in test/generate-openclaw-config.test.ts; lint, schema, security, docs, plugin tests, source-shape, skills YAML, and TypeScript checks passed. The commit and push used hook bypasses only after those unrelated failures blocked publishing.


Signed-off-by: Revant revant.h.patel@gmail.com

Summary by CodeRabbit

  • Bug Fixes

    • Normalize permissions for blueprint directories and files copied into runtime images so directories are executable and files are world-readable, preventing access failures for staged blueprints and helper manifests.
  • Tests

    • Added unit and staging tests validating permission normalization during build/context staging.
    • Added a regression test ensuring staged manifest/helper files and directories have the expected readable/executable permissions.

Review Change Stack

Signed-off-by: Revant <revant.h.patel@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented May 17, 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.

@coderabbitai

coderabbitai Bot commented May 17, 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: 66d60cfe-c034-4f01-975c-8b49694f9120

📥 Commits

Reviewing files that changed from the base of the PR and between 250b397 and 0ca3754.

📒 Files selected for processing (1)
  • test/sandbox-build-context.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/sandbox-build-context.test.ts

📝 Walkthrough

Walkthrough

Normalizes read/execute permissions for the nemoclaw-blueprint during build-context staging and adds a runtime RUN chmod -R a+rX /opt/nemoclaw-blueprint/; unit and integration tests verify staged and in-image directories are 755 and manifest files 644.

Changes

Blueprint permission normalization

Layer / File(s) Summary
Build-context permission normalization helper and integration
src/lib/sandbox/build-context.ts, test/sandbox-build-context.test.ts
Adds normalizeReadModesForDockerCopy that recursively enforces readable/executable dirs and readable files; invoked in legacy and optimized staging. Tests assert staged manifest directories become 0o755 and files 0o644.
Docker runtime permission fix and regression test
Dockerfile, test/sandbox-provisioning.test.ts
Adds RUN chmod -R a+rX /opt/nemoclaw-blueprint/ to the runtime image. Regression test runs the Dockerfile chmod block against a restrictive fixture and asserts the blueprint directory is 755 and kimi-k2.6-managed-inference.json is 644.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

fix, Sandbox, Integration: OpenClaw

Suggested reviewers

  • cv
  • zyang-dev

🐰 I hopped through folders dim and tight,
I nudged permissions, made them right,
Directories open, files can be read,
Kimi's manifest wakes from bed,
Onboarding hums — a cozy sight.

🚥 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 'fix(onboard): normalize blueprint build permissions' clearly and specifically describes the main change—normalizing permissions for blueprint builds during onboarding.
Linked Issues check ✅ Passed The PR fully addresses issue #3634 by normalizing blueprint permissions in Docker build context and during sandbox staging to ensure manifests remain readable.
Out of Scope Changes check ✅ Passed All changes directly relate to fixing blueprint permission issues: Dockerfile permission normalization, build-context helper function, and targeted regression tests.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Comment thread src/lib/sandbox/build-context.ts
@cv cv added the v0.0.45 label May 17, 2026

@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)
test/sandbox-build-context.test.ts (1)

49-140: ⚡ Quick win

Add a legacy-staging regression alongside the optimized one.

This covers stageOptimizedSandboxBuildContext(), but the same permission-normalization hook was also added to stageLegacySandboxBuildContext(). Right now a future refactor could drop the legacy call without tripping these tests, so it would be worth adding a small counterpart that stages the same restrictive manifest tree through the legacy path and asserts the copied modes there too.

🤖 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 `@test/sandbox-build-context.test.ts` around lines 49 - 140, The test only
exercises stageOptimizedSandboxBuildContext but the same
permission-normalization exists in stageLegacySandboxBuildContext; add a sibling
test (or extend this test) that calls stageLegacySandboxBuildContext(sourceRoot,
tmpDir) to stage the same restrictive blueprint tree and assert that staged
manifest directory and files (the equivalents of stagedManifestDir,
stagedManifest, stagedPlugin) have modes "755" and "644" respectively; reuse the
same fixture setup and cleanup, and mirror the expect assertions so the legacy
path is covered.
🤖 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 `@test/sandbox-build-context.test.ts`:
- Around line 49-140: The test only exercises stageOptimizedSandboxBuildContext
but the same permission-normalization exists in stageLegacySandboxBuildContext;
add a sibling test (or extend this test) that calls
stageLegacySandboxBuildContext(sourceRoot, tmpDir) to stage the same restrictive
blueprint tree and assert that staged manifest directory and files (the
equivalents of stagedManifestDir, stagedManifest, stagedPlugin) have modes "755"
and "644" respectively; reuse the same fixture setup and cleanup, and mirror the
expect assertions so the legacy path is covered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: df44bc51-2d8c-4ecf-9ad6-052d87151b98

📥 Commits

Reviewing files that changed from the base of the PR and between e3d26df and 250b397.

📒 Files selected for processing (2)
  • src/lib/sandbox/build-context.ts
  • test/sandbox-build-context.test.ts

Signed-off-by: Revant <revant.h.patel@gmail.com>
@cv cv merged commit a08d38c into NVIDIA:main May 17, 2026
18 of 20 checks passed
ericksoa pushed a commit that referenced this pull request May 18, 2026
## Summary
Updates the NemoClaw documentation for the v0.0.45 release by
summarizing the user-facing changes merged since v0.0.44 and bumping the
docs version metadata.
Refreshes generated user skills so agent-facing references match the
source docs.

## Changes
- Added v0.0.45 release notes covering onboarding recovery, local
inference, channel cleanup, share mount diagnostics, uninstall cleanup,
and security redaction updates.
- Updated command and troubleshooting docs for sandbox name limits, GPU
gateway reuse, DNS preflight behavior, channel removal cleanup, and
share mount path validation.
- Bumped docs version metadata to 0.0.45 and regenerated NemoClaw user
skills from the docs.
- Source summary: #3672 -> `docs/reference/commands.md`: documented
channel removal detaching bridge providers and un-applying channel
policy presets.
- Source summary: #3678 -> `docs/about/release-notes.md`: documented
Ollama streamed usage accounting in the release notes.
- Source summary: #3670 -> `docs/reference/commands.md`,
`docs/reference/troubleshooting.md`: documented safe GPU gateway
replacement behavior.
- Source summary: #3664 -> `docs/about/release-notes.md`: documented
blueprint permission normalization in the release notes.
- Source summary: #3181 -> `docs/reference/troubleshooting.md`:
documented GPU toolkit guidance when host drivers work but passthrough
is disabled.
- Source summary: #3554 -> `docs/about/release-notes.md`: documented
host `openshell-gateway` cleanup during uninstall.
- Source summary: #3651 -> `docs/reference/troubleshooting.md`:
documented the uncached `.invalid` DNS preflight probe.
- Source summary: #3643 -> `docs/reference/commands.md`: included
existing `NEMOCLAW_PROVIDER` interactive-mode behavior in generated
docs.
- Source summary: #3647 -> `docs/reference/commands.md`: documented
remote sandbox path verification for `share mount`.
- Source summary: #3646 -> `docs/reference/commands.md`: included
existing local writable mount target guidance in generated docs.
- Source summary: #3642 -> `docs/inference/use-local-inference.md`,
`docs/reference/commands.md`: documented managed-vLLM model override and
gated-model token checks.
- Source summary: #3639 -> `docs/reference/commands.md`: documented the
63-character sandbox name limit.

## 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
- [ ] `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
- [x] `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)

Commit hooks passed for the staged files. A standalone `npx prek run
--all-files` attempt was blocked by sandbox access to
`/Users/miyoungc/.cache/prek/prek.log`, so that checkbox is left
unchecked.

---
<!-- DCO sign-off required by CI. Run: git config user.name && git
config user.email -->
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>

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

## Summary by CodeRabbit

* **Documentation**
* Enhanced CLI command reference documentation with clearer guidance on
onboarding, GPU passthrough, inference configuration, channel removal,
and shared mounts.
* Improved troubleshooting sections with better DNS resolution and GPU
passthrough remediation steps.
  * Added documentation for overriding managed vLLM model selection.
* Updated release notes for v0.0.45 reflecting infrastructure and
workflow improvements.

* **Version Bump**
  * Released v0.0.45.

<!-- 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/3755?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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Onboard] v0.0.44 Docker build fails reading Kimi K2.6 model-specific manifest

3 participants