Skip to content

fix(sandbox): preserve long filenames in downloads - #14120

Merged
cv merged 3 commits into
NVIDIA:mainfrom
PansulBhatt:fix/sandbox-download-long-filenames
Nov 17, 2026
Merged

cv merged 3 commits into
NVIDIA:mainfrom
PansulBhatt:fix/sandbox-download-long-filenames

Conversation

@PansulBhatt

@PansulBhatt PansulBhatt commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

A sandbox directory download preserves a 240-byte filename and its contents on a host with a 255-byte filename limit. Previously the download failed with ENAMETOOLONG.

Reason

The temporary filename included the destination filename plus a process ID and UUID. That combination could exceed the host filesystem’s per-name limit even when the destination name fit.

Related issues

Fixes #14057

Changes

  • Build the temporary name from the .nemoclaw- prefix, process ID and UUID in the destination directory.
  • Add a regression test that reads the downloaded contents back under the original 240-byte filename.

Verification

  • The new test failed with ENAMETOOLONG before the fix and passed afterward.
  • vitest run --project cli src/lib/actions/sandbox/sessions/download-verify.test.ts src/lib/actions/sandbox/download.test.ts passed all 54 tests.
  • npm run build:cli and npm run test:changed passed.
  • git diff --check passed. I reviewed the diff for secrets, API keys and credentials and found none.

Review notes

The required OpenShell SDK check only runs successfully for branches in NVIDIA/NemoClaw. A maintainer can push this patch to an upstream branch so that check can run. CI rule


Signed-off-by: Pansul Bhatt [email protected]

Summary by CodeRabbit

  • Bug Fixes
    • Publishing directories now preserves filenames up to 240 bytes and retains their file contents. Files with long names can be included in published directories without losing their names or data, making the published directory more accurately reflect the original contents.

@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 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.

@PansulBhatt

Copy link
Copy Markdown
Contributor Author
Authoring session — opening

This report covers the original authoring session from creation through the first passing npm run test:changed after the fix. The session record contains both edits and the test results. Counts cover the primary session, including earlier repository investigation and idle time. They exclude activity within delegated sessions.

Field Status Value Evidence or limit
Harness partial Codex Desktop Session metadata identifies the app. The recorded prerelease build identifier is private.
Skills recorded nemoclaw-contributor-plan-issue, nemoclaw-contributor-implement-issue, nemoclaw-contributor-create-pr, host runtime skill Complete skill text appears in authoring-session read results.
Instruction files recorded Workspace and repository AGENTS.md, CONTRIBUTING.md, SECURITY.md, WRITING.md, bug report form and issue template configuration, pull request template, session report template Full instruction injections and read results. Skill references are grouped with their skills.
Tool calls recorded 75 execution wrappers and 16 collaboration calls. Inside the wrappers: 135 shell commands, 16 process polls, 5 web calls, 7 app calls and 3 patch operations. Attempted calls through cutoff, including failures. Outer and nested counts are separate.
Session window recorded October 31, 2026, 00:27:52 UTC to November 2, 2026, 01:31:22 UTC (49 h 3 min 30 s) Session creation timestamp through receipt of the passing test result, including idle time.
Compactions recorded 1 One compaction event appears before the cutoff.
Models unavailable - The model field in the authoring record contains a private identifier.
Reasoning levels unavailable - The reasoning setting in the authoring record is private.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between bd9447b and f782821.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The download publisher now names its temporary publication file without using the destination basename. A test verifies that a published directory preserves a 240-byte filename and its contents.

Changes: Download publication

Layer / File(s) Summary
Temporary filename and regression test
src/lib/actions/sandbox/sessions/download-verify.ts, src/lib/actions/sandbox/sessions/download-verify.test.ts
The temporary publication filename uses a .nemoclaw-<pid>-<uuid>.tmp pattern. A test checks that a directory containing a 240-byte filename is published with the original contents.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: apurvvkumaria

Merge Risk: Minimal · previous review bd944

The change addresses long-filename downloads, and no actionable merge-blocking risk is identified. It is ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(sandbox): preserve long filenames in downloads" matches the main change. The raw summary and objectives say the temporary publication copy name no longer includes the destination basena…
Linked Issues check Passed Issue #14057 requires saving a valid 240-byte filename under its original name with intact contents. replaceWithPrivateEntry now uses a bounded .nemoclaw-${process.pid}-${randomUUID()}.tmp name in…
Out of Scope Changes check Passed The changes modify temporary publication naming in src/lib/actions/sandbox/sessions/download-verify.ts and add a focused regression test in download-verify.test.ts. Both changes directly support i…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title "fix(sandbox): preserve long filenames in downloads" matches the main change. The raw summary and objectives say the temporary publication copy name no longer includes the destination basename, which lets a 240-byte filename download without ENAMETOOLONG. The added test checks that a long filename and its contents survive publishing. The title names the outcome and the scope (sandbox downloads). It omits the mechanism (temp filename change), which is acceptable because the title need not list every detail.

Full details: Linked Issues check

Explanation

Issue #14057 requires saving a valid 240-byte filename under its original name with intact contents. replaceWithPrivateEntry now uses a bounded .nemoclaw-${process.pid}-${randomUUID()}.tmp name in the destination directory. The added regression test publishes a directory and reads the contents through the original 240-byte filename. The implementation and test satisfy the coding requirement.

Full details: Out of Scope Changes check

Explanation

The changes modify temporary publication naming in src/lib/actions/sandbox/sessions/download-verify.ts and add a focused regression test in download-verify.test.ts. Both changes directly support issue #14057. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between ce66ca2 and bd9447b.

Files selected for processing: 1
  • src/lib/actions/sandbox/sessions/download-verify.ts
Files skipped from review as they are similar to previous changes: 1
  • src/lib/actions/sandbox/sessions/download-verify.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery labels Nov 3, 2026
@PansulBhatt
PansulBhatt marked this pull request as ready for review November 3, 2026 20:49
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Nov 3, 2026
rsliter added a commit that referenced this pull request Nov 4, 2026
## Outcome

Growth checks allow each Git fetch up to 90 seconds while sharing a
180-second preparation budget. Failed preparation reports bounded,
redacted Git diagnostics instead of discarding stderr.

## Reason

The independent growth workflow on PRs #14152, #14151, and #14120 failed
during its initial depth-32 PR fetch at the helper's 30-second cutoff.
No growth assertion ran. Increasing the setup-hook allowance in #13930
left that per-command cutoff unchanged.

## Changes

- Apply the remaining preparation budget to both fetch paths, history
deepening, commit verification, and merge preparation. Local commands
retain their 30-second limit.
- Capture bounded stderr and report the phase, requested depth, elapsed
time, command allowance, exit status, and signal. Redact before
truncation and omit raw subprocess causes from serialized errors.
- Extend the existing approval-loader tests for slow fetches,
total-budget exhaustion, timeout diagnostics, nonzero exits, and secret
redaction. Preserve the real Git-history and trusted-policy tests.

## Verification

- The five regression cases failed against trusted base
`8893b9f442a323f65d8847606c0b70f4a7debab9`.
- `node node_modules/vitest/vitest.mjs run --project integration
test/automation/pull-requests/e2e-budget-approval.test.ts
test/automation/pull-requests/growth-guardrail-comparison.test.ts
test/automation/pull-requests/growth-guardrail-parsers.test.ts
test/automation/pull-requests/growth-guardrails-workflow-boundary.test.ts
test/automation/pull-requests/growth-guardrails.test.ts`: 160 tests
passed.
- Tests ran in an isolated Linux container with no host mounts,
credential files, SSH agent, or GitHub token.
- CLI and plugin builds and typechecks passed in the isolated checkout.
- Installed pre-commit, commit-msg, and pre-push hooks passed. The
actual hooks ran in the credential-free container; publication
validation and CLI/plugin/JS compiler checks passed.
- Tested and published commit:
`66b075f4aa8cbf6c0d5fca449b8568ac9746e3b1`.
- Reviewed the three-file diff for correctness and secrets. No
credentials or API keys are included.

## Review notes

This changes shared validation behavior. Candidate tests do not
establish independent policy approval. The separate governance workflow
executes trusted-base code; after merge, verify a fresh affected-PR run
uses a base containing this repair. The underlying source of network or
Git latency remains unproven.

---
Signed-off-by: Rebecca Sliter <[email protected]>


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

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Tests**
* Automated pull request checks now account for slow Git fetches and
preparation time limits across different history depths.
* Failure diagnostics provide concise, sanitized details while omitting
sensitive information.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Rebecca Sliter <[email protected]>
Co-authored-by: Rebecca Sliter <[email protected]>
@cv
cv merged commit 147d2de into NVIDIA:main Nov 17, 2026
42 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sandbox download fails on a valid 240-byte filename

3 participants