Skip to content

fix: stage inline content payloads outside payloadDir (#84) - #87

Merged
robbycochran merged 1 commit into
mainfrom
rc-fix-84-payload-rename
Aug 21, 2026
Merged

fix: stage inline content payloads outside payloadDir (#84)#87
robbycochran merged 1 commit into
mainfrom
rc-fix-84-payload-rename

Conversation

@robbycochran

@robbycochran robbycochran commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

What

Fixes #84 — inline content payloads (payloads[].content) failed with local path does not exist.

Root cause

ResolvePayloads wrote inline content to temp files inside payloadDir. createSandbox then does os.Rename(payloadDir, uploadDir) to stage the upload, which invalidated the source paths already stored in extraUploads. Every SandboxCreate — and all five retries — then failed on the same stale path.

Fix

Stage inline content in a separate temp dir that is not renamed, so the upload source paths survive until SandboxCreate (cmd/executor.go). One-line change plus its temp-dir lifecycle.

Test

Adds TestUpLocal_InlineContentPayloadPathSurvivesRename, which asserts every upload Src still resolves at create time (via a new onSandboxCreate hook on the test mockGW). Verified it fails on the pre-fix code with the exact no such file or directory error after the rename, and passes with the fix.

Credit

Approach and reproduction mirror the fix shared by @RoddieKieley in the issue (fix/resolve-payloads-rename).


Stacked PR: based on rc-openshell-compat (#86). Review/merge that first; this branch will retarget to main once it lands.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed inline payload uploads so their source files remain available during sandbox creation.
    • Preserved clearer error context when payload resolution fails.
  • Tests
    • Added regression coverage for inline payload execution and upload path accessibility.
    • Improved sandbox creation test support for validating request behavior.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5b3ca4af-e34a-4f6b-9b17-fa078e7c7d46

📥 Commits

Reviewing files that changed from the base of the PR and between a8fcd59 and 9cdf5c9.

📒 Files selected for processing (3)
  • cmd/executor.go
  • cmd/executor_test.go
  • cmd/helpers_test.go

Walkthrough

Inline payload files are now stored outside the sandbox payload directory. Their paths remain valid during sandbox creation. Tests observe sandbox creation and verify that inline upload sources exist.

Changes

Inline payload handling

Layer / File(s) Summary
Separate inline payload storage
cmd/executor.go
Inline payload content uses a separate temporary directory. The directory is removed after execution.
Sandbox creation regression coverage
cmd/executor_test.go, cmd/helpers_test.go
The test gateway exposes a sandbox creation callback. The regression test verifies source paths during sandbox creation and checks for one successful creation.

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

✨ 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 rc-fix-84-payload-rename

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

@robbycochran
robbycochran force-pushed the rc-fix-84-payload-rename branch 2 times, most recently from a9c3e2f to 9f9533a Compare August 21, 2026 15:05
@robbycochran
robbycochran force-pushed the rc-fix-84-payload-rename branch from 9f9533a to 6d787a0 Compare August 21, 2026 15:08
@robbycochran
robbycochran changed the base branch from rc-openshell-compat to main August 21, 2026 15:19
Inline content payloads (payloads[].content) were written to temp files inside
payloadDir. createSandbox then renames payloadDir into a staging directory,
which invalidated the stored upload source paths — so every SandboxCreate
failed with "local path does not exist" and all five retries hit the same
stale path.

Stage inline content in a separate temp dir that is not renamed, so the upload
source paths survive until SandboxCreate.

Adds a regression test that fails on the pre-fix code (stale path after rename)
and passes with the fix: it asserts every upload Src resolves at create time.

Fixes #84. Approach and test mirror the reproduction shared by @RoddieKieley.
@robbycochran
robbycochran force-pushed the rc-fix-84-payload-rename branch from 6d787a0 to 9cdf5c9 Compare August 21, 2026 15:20
@robbycochran
robbycochran merged commit 8173e58 into main Aug 21, 2026
6 of 7 checks passed
@robbycochran
robbycochran deleted the rc-fix-84-payload-rename branch August 21, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inline content payloads fail with "local path does not exist"

1 participant