Repository navigation
fix(sandbox): weakerWhenNested reaches the sandbox - #5304
Merged
Merged
Conversation
The runtime reads the weaker nested profile from its run-wide config, so the per-call flag did nothing: in a container that refuses a fresh /proc mount, or under an agent's sandbox, every sandboxed task failed with the flag set as without it. The probe and each task's wrap now set it for their own span, and the refusal names the field. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
npm showed @vzn/vx@0.0.656 five minutes before @vzn/vx-linux-x64 at that version (0.0.654: two minutes), and an install in between took no binary. The publish now waits for every platform package's version and tarball before it sends @vzn/vx. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
0.0.656's linux-x64 package took over 8 minutes and the 10-minute wait failed the publish job, so the server images were skipped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
vx-migrate pinned what it installs to its own version. From bun x's day-old cache, or beside a vx older than the newest, that put a lockfile plugin of one release next to a vx of another (0.0.655 next to 0.0.656, its peer unmet). It now pins to the installed @vzn/vx, and vx init's next line names vx-migrate at its own version. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
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.
sandbox.weakerWhenNestedtakes effectBefore: vx run inside another sandbox (an agent's, or an unprivileged container) that refuses a fresh
/procmount. The task setsweakerWhenNested: true, and nothing changes:After: the same workspace, same outer sandbox.
$ vx run build --all success miss — 65ms — — 2B 0 local packages/lib#buildWithout the flag, the refusal now names it:
… — a fresh /proc cannot be mounted here (an unprivileged container, or a sandbox around vx): set sandbox.weakerWhenNested: true on every sandboxed task.Also:
@vzn/vxonly once npm shows every platform package. npm showed@vzn/vx@0.0.656at 13:21:50 UTC and@vzn/vx-linux-x64@0.0.656at 13:26:38 (0.0.654: two minutes apart), and an install in between took no binary. The 0.0.656 publish job then failed its own 10-minute "served" wait; both waits are now 15 minutes.bunx @vzn/vx-migratepins the plugins it adds to the vx the workspace has installed, not to its own version. A bunx-cached 0.0.655 migrate put@vzn/vx-lockfile@0.0.655beside@vzn/vx@0.0.656.vx init's next line namesbunx @vzn/vx-migrate@<running version>.How it works
The sandbox runtime reads
enableWeakerNestedSandboxfrom its run-wide config only; vx passed it per call, where it is dropped. The availability probe and each task's wrap now set it on the run's config for their own span, the wayunixSocketsandgitConfigalready are, so a task without the flag in the same run keeps the fresh/proc. The docs said the flag lets a sandboxed task start a sandbox; it does not (the secure wrapper forbids nested user namespaces), anddocs/schema.mdanddocs/modules/sandbox.mdnow say what it is for.scripts/release.ts publish linuxsends the platform packages, waits until the registry answers 200 for each one's version and tarball (the darwin ones too, up to 15 min), then sends@vzn/vxand the plugins. npm processes a publish after the command returns and not in order, so publishing in order was not enough.workspaceVersion(root)in vx-migrate readsnode_modules/@vzn/vx/package.jsonand falls back to the package's own version.Breaking changes
None.
Proof
tests/sandbox-weaker-nested.unsafe.test.ts(a task that sets it binds/proc; one without it in the same run keeps the fresh mount; the probe wraps the weaker way and restores the config);tests/sandbox-hint.test.ts"names the same field when the container refuses a fresh /proc";tests/release.test.tspublishSettled(waits between the platform packages and@vzn/vx; publishes no@vzn/vxwhen one never shows; the darwin job waits for nothing);vx-migrate/tests/adopt.test.ts"pins to the workspace's installed vx, so a plugin beside it is not missing";tests/init.test.ts"the next line names vx-migrate at the running version".tests/sandbox-lifecycle.unsafe.test.tspinned the dropped per-call option and now reads the wrapper's answer.bwrap --unshare-user: refused before, runs after.weakerWhenNestedtask (the per-wrap config path is taken only when one sets it).docs/schema.md,docs/modules/sandbox.md,docs/cli.md./procmount, the others are the release script and the migrate CLI's install step.🤖 Generated with Claude Code
https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2