Skip to content

fix(sandbox): stage Slack deny-feedback patch script#4971

Closed
cv wants to merge 1 commit into
mainfrom
codex/fix-openclaw-slack-patch-context
Closed

fix(sandbox): stage Slack deny-feedback patch script#4971
cv wants to merge 1 commit into
mainfrom
codex/fix-openclaw-slack-patch-context

Conversation

@cv

@cv cv commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stage the Slack deny-feedback patch script in the optimized sandbox build context so OpenClaw source installs can satisfy every COPY scripts/... line in the Dockerfile. This fixes the nightly E2E image-build failure where Docker could not find scripts/patch-openclaw-slack-deny-feedback.mts.

Changes

  • Copy scripts/patch-openclaw-slack-deny-feedback.mts into the optimized sandbox build context alongside the existing OpenClaw patch scripts.
  • Add a regression assertion that parses staged Dockerfile COPY scripts/... entries and verifies every referenced script exists in the staged context.

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
  • 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: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Tests

    • Expanded build context staging test coverage with helper validation to verify all staged scripts exist in the build context
  • Chores

    • Added staging support for an additional support script in the optimized build process

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: e59a7bb2-dbab-4bba-ae37-049160b42296

📥 Commits

Reviewing files that changed from the base of the PR and between 9a738e0 and 644c6ea.

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

📝 Walkthrough

Walkthrough

This PR extends the sandbox build-context staging to include a new script, patch-openclaw-slack-deny-feedback.mts, copied into the optimized build context's scripts/ directory. Test coverage is expanded with a new Dockerfile parsing helper to validate that all declared script copies actually exist in the staged context.

Changes

Sandbox Build Context Script Staging

Layer / File(s) Summary
Script staging in build context
src/lib/sandbox/build-context.ts
stageOptimizedSandboxBuildContext adds a new fs.copyFileSync call to copy patch-openclaw-slack-deny-feedback.mts from the source scripts/ into the staged build context's scripts/ directory.
Test validation for script staging
test/sandbox-build-context.test.ts
Test fixture includes the new script, a new expectDockerfileScriptCopiesExist helper extracts and validates COPY scripts/<...> statements from the Dockerfile, and file-existence assertions are updated to require the new script in the build context.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#4933: Introduces the patch-openclaw-slack-deny-feedback.mts script that this PR stages into the sandbox build context.

Suggested labels

area: sandbox, integration: slack, bug-fix

Suggested reviewers

  • prekshivyas

Poem

🐰 A script finds its home in the sandbox today,
Copying close to ensure it won't stray,
Tests now verify each file is in place,
Docker and Dockerfile run their full race! 📦✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: staging the Slack deny-feedback patch script in the sandbox build context to fix a Docker build failure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 codex/fix-openclaw-slack-patch-context

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

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 0 nice ideas

Consider writing more tests for
  • **Runtime validation** — Build an optimized sandbox image from the staged context and verify Docker reaches/passes the `COPY scripts/patch-openclaw-slack-deny-feedback.mts` layer.. Unit coverage now exercises the exact optimized-staging bug path and the Dockerfile script-copy contract. Because this touches sandbox image build infrastructure, a targeted runtime image-build validation would still increase confidence.
  • **Runtime validation** — If Dockerfile script-copy syntax expands in the future, cover `COPY --flag scripts/<name> ...`, JSON-array COPY, or multi-source COPY forms so the staging contract test cannot miss them.. Unit coverage now exercises the exact optimized-staging bug path and the Dockerfile script-copy contract. Because this touches sandbox image build infrastructure, a targeted runtime image-build validation would still increase confidence.

Workflow run details

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

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: cloud-e2e
Optional E2E: rebuild-openclaw-e2e, openclaw-slack-pairing-e2e

Dispatch hint: cloud-e2e

Auto-dispatched E2E: cloud-e2e via nightly-e2e.yaml at 644c6eab185c22546b4ef1ca7d0588d6ebe38098nightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • cloud-e2e (high): Runs the standard full install/onboard flow and builds the OpenClaw sandbox image from the staged optimized context, which should catch missing Dockerfile COPY inputs such as patch-openclaw-slack-deny-feedback.mts.

Optional E2E

  • rebuild-openclaw-e2e (high): Useful confidence that the same staged build-context path also works during an OpenClaw sandbox rebuild/upgrade flow, not only initial onboarding.
  • openclaw-slack-pairing-e2e (high): Adjacent Slack-specific coverage for the area that consumes the newly included patch file. The patch content itself is unchanged, so this is confidence-only rather than merge-blocking.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: cloud-e2e

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: ubuntu-repo-cloud-openclaw
Optional scenario E2E: ubuntu-repo-cloud-openclaw-slack

Dispatch required scenario E2E:

  • gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: medium

Required scenario E2E

  • ubuntu-repo-cloud-openclaw: The production sandbox build-context staging code changed. The baseline Ubuntu repo-current OpenClaw scenario exercises the optimized sandbox image build and smoke path that would catch missing files required by Dockerfile COPY/RUN steps.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Optional scenario E2E

  • ubuntu-repo-cloud-openclaw-slack: The newly staged file is the Slack deny-feedback patch script. This adjacent Slack scenario directly exercises Slack onboarding and messaging validation, but it is optional because the baseline sandbox build should catch the build-context COPY failure.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw-slack

Relevant changed files

  • src/lib/sandbox/build-context.ts

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 27155399599
Target ref: 644c6eab185c22546b4ef1ca7d0588d6ebe38098
Workflow ref: main
Requested jobs: cloud-e2e
Summary: 1 passed, 0 failed, 0 skipped

Job Result
cloud-e2e ✅ success

@cv

cv commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #4970 now that #4970 includes the generalized Dockerfile script-copy staging guard from this PR (commit 7fca86f). I recommend merging #4970 as the consolidated fix and closing this duplicate after reviewers are comfortable.

@cv

cv commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this duplicate now that #4970 has absorbed the stronger Dockerfile script-copy staging guard from this PR and the updated #4970 head is green. Consolidated fix: #4970.

@cv cv closed this Jun 8, 2026
@cv cv deleted the codex/fix-openclaw-slack-patch-context branch June 8, 2026 17:50
cv added a commit that referenced this pull request Jun 8, 2026
…ontext (#4970)

## Summary

Nightly E2E run
[27154074940](https://github.com/NVIDIA/NemoClaw/actions/runs/27154074940)
lost **48 of 67 jobs** to a single root cause: every E2E job that
exercises onboard/install died at the same Dockerfile step with

```
COPY failed: file not found in build context: stat
scripts/patch-openclaw-slack-deny-feedback.mts: file does not exist
```

PR #4933 added `scripts/patch-openclaw-slack-deny-feedback.mts` and the
matching `COPY` line in `Dockerfile`, but did **not** register the new
file in `stageOptimizedSandboxBuildContext`
(`src/lib/sandbox/build-context.ts`). The optimized staging path
hand-copies a curated set of files into a temp build context — its two
existing siblings (`patch-openclaw-tool-catalog.js`,
`patch-openclaw-chat-send.js`) are listed there explicitly. The new
`.mts` patch was missed, so `docker build` couldn't see it.

PR #4933 itself was green because PR-time builds were satisfied by other
paths or cached layers; the gap only showed up when nightly built from
main against the staged context.

## Change

- `src/lib/sandbox/build-context.ts`: stage
`patch-openclaw-slack-deny-feedback.mts` next to its siblings.
- `test/sandbox-build-context.test.ts`: extend the fixture + assertion
so any future drop of this file is caught locally before it can take
down nightly.
- `test/sandbox-build-context.test.ts`: parse staged Dockerfile `COPY
scripts/...` lines and verify every referenced script exists in the
optimized staged context, folding in the broader guard from #4971.

## Validation

- `npx vitest run test/sandbox-build-context.test.ts` → 7/7 passing
locally.
- GitHub PR checks on updated head `7fca86f78` are green, including
`build-sandbox-images`, `build-sandbox-images-arm64`,
`unit-vitest-linux`, `cli-tests`, and downstream self-hosted smoke jobs.
- After merge, rerun `nightly-e2e.yaml` (or `gh run rerun 27154074940
--failed`). A single onboard-stage job clearing Dockerfile step 23
confirms all 48 failures are resolved.

## Follow-up (suggested, not in this PR)

The two-place duplication (`Dockerfile` `COPY` + hand-listed staging) is
the structural cause of this incident. This PR now adds a contract test
for that duplication; a future cleanup could still drive the staged list
from a glob (`scripts/patch-openclaw-*.{js,mts}`) or shared manifest.

cc @yimoj (PR #4933 author).

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
@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.

2 participants