Skip to content

fix(sandbox): stage generate-openclaw-config.py in optimised build context - #2508

Closed
laitingsheng wants to merge 2 commits into
mainfrom
fix/2503-stage-generate-openclaw-config
Closed

fix(sandbox): stage generate-openclaw-config.py in optimised build context#2508
laitingsheng wants to merge 2 commits into
mainfrom
fix/2503-stage-generate-openclaw-config

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The optimised sandbox build context staging in
stageOptimizedSandboxBuildContext only copied nemoclaw-start.sh and lib/sandbox-init.sh into the staged scripts directory, but the Dockerfile (line 195) also COPYs scripts/generate-openclaw-config.py. The script was added in ca46f47 ("feat: extract inline Python config to scripts/generate-openclaw-config.py") which updated the Dockerfile but not the staging function, so nemoclaw onboard fails at the COPY step.

Related Issue

Fixes #2503

Changes

The legacy staging path (stageLegacySandboxBuildContext) recursively copies the entire scripts/ directory and is therefore unaffected.

Also extend the optimised-staging test to assert both generate-openclaw-config.py and lib/sandbox-init.sh are present in the staged context, so future Dockerfile additions that miss the staging function will be caught immediately.

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)

AI Disclosure

  • AI-assisted — tool: Claude Code

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • Chores

    • Modified sandbox build context staging to include an additional required script file in the build output.
  • Tests

    • Updated test suite with new assertions to validate script file staging behavior, confirming proper inclusion of required files and exclusion of unnecessary files in the sandbox build process.

…ntext

The optimised sandbox build context staging in
`stageOptimizedSandboxBuildContext` only copied `nemoclaw-start.sh` and
`lib/sandbox-init.sh` into the staged scripts directory, but the
Dockerfile (line 195) also COPYs `scripts/generate-openclaw-config.py`.
The script was added in ca46f47 ("feat: extract inline Python config to
scripts/generate-openclaw-config.py") which updated the Dockerfile but
not the staging function, so `nemoclaw onboard` fails at the COPY step.

The legacy staging path (`stageLegacySandboxBuildContext`) recursively
copies the entire `scripts/` directory and is therefore unaffected.

Also extend the optimised-staging test to assert both
`generate-openclaw-config.py` and `lib/sandbox-init.sh` are present in
the staged context, so future Dockerfile additions that miss the
staging function will be caught immediately.

Fixes #2503

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Apr 27, 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: 52465c3a-6855-4664-9cdf-26d491b86aab

📥 Commits

Reviewing files that changed from the base of the PR and between 6f7f0c6 and 6cc7487.

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

📝 Walkthrough

Walkthrough

The PR adds generate-openclaw-config.py to the optimized sandbox build context by copying it into the staged scripts folder. Updated tests verify the presence of this script alongside existing sandbox initialization scripts in the build context.

Changes

Cohort / File(s) Summary
Sandbox Build Context Staging
src/lib/sandbox-build-context.ts
Added file copy operation to include generate-openclaw-config.py in the staged scripts folder alongside other startup and sandbox initialization scripts.
Build Context Tests
test/sandbox-build-context.test.ts
Added test assertions to verify the presence of scripts/generate-openclaw-config.py and scripts/lib/sandbox-init.sh in the optimized staged build context, while confirming scripts/setup.sh remains excluded.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A script was lost within the build,
The Docker dreams left unfulfilled!
Now generate-openclaw finds its place,
With staging scripts in the right space! 🎉

🚥 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: staging generate-openclaw-config.py in the optimized build context to fix the Docker COPY failure.
Linked Issues check ✅ Passed The PR directly addresses issue #2503 by adding generate-openclaw-config.py to the optimized sandbox build context staging, resolving the Docker COPY failure during nemoClaw onboard.
Out of Scope Changes check ✅ Passed All changes are scoped to the objective: only modifications to sandbox build context staging and corresponding test assertions, with no unrelated alterations.

✏️ 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 fix/2503-stage-generate-openclaw-config

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

@wscurran wscurran added bug dependencies Pull requests that update a dependency file labels Apr 27, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for submitting this pull request that proposes a way to fix a bug that causes the sandbox build context staging to fail when copying the generate-openclaw-config.py script.


Related open issues:

@wscurran

Copy link
Copy Markdown
Contributor

Thanks for the proposed fix. This was covered by #2565, which was merged earlier today with the same correction to include generate-openclaw-config.py in the optimized build context. Closing to keep the queue clean; feel free to reopen if there's behavior from this PR that didn't carry over.

@wscurran wscurran closed this Apr 28, 2026
@wscurran wscurran added area: packaging Packages, images, registries, installers, or distribution bug-fix PR fixes a bug or regression chore Build, CI, dependency, or tooling maintenance platform: container Affects Docker, containerd, Podman, or images and removed area: packaging Packages, images, registries, installers, or distribution Docker chore Build, CI, dependency, or tooling maintenance labels Jun 3, 2026
@cv
cv deleted the fix/2503-stage-generate-openclaw-config branch June 28, 2026 00:24
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 dependencies Pull requests that update a dependency file platform: container Affects Docker, containerd, Podman, or images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Onboard] [All Platform] Docker image build fails copying generate-openclaw-config.py

3 participants