fix(sandbox): corepack's download prompt hangs the dev server forever - #5837
Merged
Conversation
A task spawns on a PTY, so corepack sees a tty and its download prompt defaults on. The first time it has to fetch a yarn/pnpm shim it prints "Do you want to continue? [Y/n]" and blocks on stdin — forever. Nothing times it out, the port never opens, and the preview sits on "Starting your preview..." until the sandbox is reaped. Observed on every pod of the electrolux tenant warm pool in prod: the repo was cloned and node_modules installed, but `yarn run dev` was parked at the prompt with 0% CPU. Setting COREPACK_ENABLE_DOWNLOAD_PROMPT=0 on the same pod makes yarn resolve instantly. The install step (install.go) and SpawnStep already pin these two vars. The task manager is the third spawner and was missed — and it is the one that runs the dev server.
pedrofrxncx
enabled auto-merge (squash)
August 7, 2026 00:26
decocms Bot
pushed a commit
that referenced
this pull request
Aug 7, 2026
PR: #5837 fix(sandbox): corepack's download prompt hangs the dev server forever Bump type: patch - @decocms/sandbox (packages/sandbox/package.json): 1.43.1 -> 1.43.2 - deploy/helm/sandbox-env (chart 0.12.3) (deploy/helm/sandbox-env/values.yaml deploy/helm/sandbox-env/Chart.yaml): image.tag/appVersion -> 1.43.2 Deploy-Scope: both
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 bug
Every pod in the
tenant-electrolux-prodwarm pool has a cloned repo and a fullnode_modules, and adevtask that has never produced a byte of output:/usr/local/bin/yarnis the corepack shim. Its first line isprocess.env.COREPACK_ENABLE_DOWNLOAD_PROMPT ??= '1', so when it has to fetch a yarn version it asks:Tasks spawn on a PTY, so corepack sees a tty, prints the prompt, and blocks on stdin. Nothing times it out. The dev port never opens, so the preview sits on "Starting your preview…" until the sandbox is reaped — and a warm pool of these is a pool of pods that are warm in every respect except the one that matters.
Verified on the live pod: with
COREPACK_ENABLE_DOWNLOAD_PROMPT=0,yarn --versionreturns instantly.The fix
install.goandSpawnStepalready pinCOREPACK_ENABLE_STRICT=0/COREPACK_ENABLE_DOWNLOAD_PROMPT=0— that's whyinstallsucceeded whiledevhung.buildEnvin the task manager is the third spawner and was missed; it's the one that runs the dev server,/exec, and/bash.Two lines in
buildEnv, seeded beforeextra/overridesso caller env still wins.Testing
TestBuildEnvSilencesCorepackPrompt— asserts both vars on the pty and pipe paths, and that caller overrides survive.go build ./... && go test ./internal/proc/ ./internal/setup/ ./internal/routes/pass.Only affects repos whose package manager is a corepack shim (yarn, pnpm). npm/bun were never blocked, which is why this hid until a yarn tenant showed up.
Summary by cubic
Prevent dev server hangs caused by
corepack’s interactive download prompt by disabling it in task-run envs. Repos usingyarn/pnpmnow start previews reliably.COREPACK_ENABLE_STRICT=0andCOREPACK_ENABLE_DOWNLOAD_PROMPT=0inbuildEnvbefore applying overrides.TestBuildEnvSilencesCorepackPrompt.Written for commit 688d31e. Summary will update on new commits.