Repository navigation
Conversation
…e Sandbox skill Managed images use /vercel as the working directory, not /vercel/sandbox. Add when to use a drive, snapshot, or custom image, a tested shared-cache example, the no-shell runCommand rule, and the null readFileToBuffer return.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
The Sandbox skill tells agents to work in
/vercel/sandbox, but managed images use/vercel. On the current default image, commands start in/verceland/vercel/sandboxdoesn't exist until a file write creates it. So the skill's examples can point commands at a directory that isn't there. A command started withcwdunder/vercel/sandboxfails withchdir /vercel/sandbox: no such file or directory.This PR makes four changes to the skill:
/vercel. The limits table now gives the working directory, replacing the "Writable paths" row. This matches the SDK reference: "Managed images use/vercel. Custom images use the DockerfileWORKDIR, or/if none is set."runCommand: it runs the executable without a shell and doesn't throw on a non-zero exit. Usebash -cfor pipes and&&.readFileToBuffer: returnsnullfor a missing file. The SDK's JSDoc says so too.It also updates the official resource links from
/docs/vercel-sandbox/...(which redirect) to/docs/sandbox/....The Vercel plugin copies this file. Its drift agent flagged the plugin's copy in vercel/vercel-plugin#397, and these changes reach the plugin on its next resync.
Validation
I ran these against live sandboxes with
@vercel/sandbox3.9.1 on November 9:pwdin a new sandbox prints/vercel, andHOMEis/vercel. RelativewriteFilespaths land in/vercel.runCommand("echo", ["one", "&&", "echo", "two"])printsone && echo two.runCommand("echo one && echo two")returns400 executable file not found in $PATH.bash -cwith the same string prints both lines.runCommand("false")returnsexitCode1 without throwing.readFileToBufferon a missing path returnsnull.pnpm installexits 0 and writes its store to the drive. A second sandbox mountscache.snapshot()and sees the store, and writes there fail withRead-only file system. Running pnpm directly against that read-only store fails withERR_SQLITE_ERROR unable to open database file. Copying it to/tmp/storefirst and installing from there exits 0, so the skill now says to do that.The Drives docs have the same two problems. vercel/front#97270 fixes them.