Repository navigation
test(agents): realpath apply-patch temp dir fixture - #119353
Merged
Merged
Conversation
withTempDir used a raw fs.mkdtemp(os.tmpdir()) path. On macOS os.tmpdir() is a /var -> /private/var symlink while the production sandbox guard compares against canonical paths, so the symlink-delete test failed with "Path escapes sandbox root". Realpath the mkdtemp result so the fixture matches the canonical form the guard expects.
steipete
marked this pull request as ready for review
August 4, 2026 21:37
Contributor
Author
|
Merged via squash.
|
vincentkoc
added a commit
that referenced
this pull request
Aug 5, 2026
Punchcard-Session: crisp-lantern-orchard-nv * origin/main: perf(memory): defer session backfill runtime (#119372) fix(ci): isolate built TUI PTY fixture (#119339) fix(commands): restore tool inventory for dynamic models (#119306) fix(media): release rejected BytePlus and Runway video downloads under debug capture (#119257) docs: add ChromeOS (Crostini) platform install guide (#107663) test(msteams): serve JWKS from in-process server in auth coverage (#119354) fix(qa): enable OpenAI for stored audio scenario (#119349) test(agents): realpath apply-patch temp dir fixture (#119353) test(slack): drop redundant .js-suffixed system-event mock (#119352) fix(exec): leave safe builtins unrewritten in enforced mode (#119351) fix(sessions): keep gateway responsive while large transcript archives are built (#112424) fix(tui): restore provider auth in installed local mode (#119283)
vincentkoc
added a commit
that referenced
this pull request
Aug 5, 2026
…time * origin/main: (75 commits) fix(commands): restore tool inventory for dynamic models (#119306) fix(media): release rejected BytePlus and Runway video downloads under debug capture (#119257) docs: add ChromeOS (Crostini) platform install guide (#107663) test(msteams): serve JWKS from in-process server in auth coverage (#119354) fix(qa): enable OpenAI for stored audio scenario (#119349) test(agents): realpath apply-patch temp dir fixture (#119353) test(slack): drop redundant .js-suffixed system-event mock (#119352) fix(exec): leave safe builtins unrewritten in enforced mode (#119351) fix(sessions): keep gateway responsive while large transcript archives are built (#112424) fix(tui): restore provider auth in installed local mode (#119283) fix(release): accept legacy empty core artifacts (#119337) fix(qa): carry selected runtime into flow scenarios (#119324) fix(ci): retry interrupted Windows dashboard release checks (#119095) fix(release): filter validation ancestry fetch (#119334) fix(release): accept trusted extended-stable validation evidence (#119264) fix(sessions): preserve recorder-owned user turns (#119307) perf(cli): split plugin registry startup timing (#119318) fix(qa): align release scenario setup and compaction proof (#119188) fix(ci): avoid duplicate Matrix release QA runs (#119171) perf(agents): reuse provider policy manifest registry (#119305) ...
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 5, 2026
withTempDir used a raw fs.mkdtemp(os.tmpdir()) path. On macOS os.tmpdir() is a /var -> /private/var symlink while the production sandbox guard compares against canonical paths, so the symlink-delete test failed with "Path escapes sandbox root". Realpath the mkdtemp result so the fixture matches the canonical form the guard expects. Co-authored-by: Peter Steinberger <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Resolves a problem where the apply-patch symlink-delete test failed on macOS with
Path escapes sandbox root. The test'swithTempDirhelper used a rawfs.mkdtemp(os.tmpdir())path. On macOSos.tmpdir()is a/var→/private/varsymlink, while the production sandbox guard compares against canonical (realpath'd) paths, so the guard rejected the lexical temp path.Why This Change Was Made
The production guard is correct; the fixture was not. The fix realpaths the
mkdtempresult so the temp directory matches the canonical form the guard expects. Test-only change, no production behavior touched.User Impact
No user-visible impact — this makes the apply-patch test suite portable across macOS and Linux so the sandbox path-safety behavior is reliably exercised.
Evidence
node scripts/run-vitest.mjs src/agents/apply-patch.test.ts: 52 tests pass on macOS (previously the symlink-delete case threwPath escapes sandbox root).Found during a broad stress sweep of the repo's test surface.