Access Denied for bun commands in sandbox

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’ve been seeing an issue using Grok Code in sandbox mode (oddly have not seen it as much with Composer) where node_modules seems to be corrupted. I suspect it could be due to the fact that bun uses hardlinks for node_modules and maybe that doesn’t map well into the sandbox or something.

I see the issue most often with jest, there’s a @jest/test-sequencer package that always seems to be missing from the version of node_modules the sandbox environment has access to. Sometimes if I prompt it to bun install a few times the modules successfully reinstall and then I can use jest again. Very weird bug.

Some output:

cd /Users/quantizor/code/
bun install v1.3.2 (b131639c)

Failed to install 4 packages
[350.00ms] done
EACCES: Permission denied while installing @babel/plugin-bugfix-firefox-class-in-computed-class-key
EACCES: Permission denied while installing path-key
EACCES: Permission denied while installing @jest/test-sequencer
AccessDenied: Failed to open node_modules folder for slash in /Users/quantizor/code/markdown-to-jsx/node_modules/@jest/test-sequencer/node_modules

Steps to Reproduce

Use Grok Code
Turn on worktrees
Make a bun repo using jest (alias jest to bun run test)
Try to spin off an agent to run bun run test
Hopefully see the error…

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.75
VSCode Version: 1.99.3
Commit: 9e7a27b76730ca7fe4aecaeafc58bac1e2c82120
Date: 2025-11-12T17:34:21.472Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.0.0

For AI issues: which model did you use?

Grok Code

For AI issues: add Request ID with privacy disabled

60690afb-6b6d-40d0-bf7d-372665a25eca

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This likely relates to known sandbox + worktree issues.

Try this first:

  • Open Settings Cmd+Shift+J → Agents → Inline Editing & Terminal
  • Enable “Legacy Terminal Tool”
  • Cmd+Shift+P → “Terminal: Kill All Terminals”
  • Restart Cursor

The team is working on worktree improvements in version 2.1. I’ll escalate this bun-specific issue with your request ID.

Let me know if the Legacy Terminal Tool helps!

1 Like

Does seem to help, though I also just switched over to bun test to avoid the jest issue entirely.