Preserve Docker image PATH during sandbox imports - #131
Merged
Merged
Conversation
Dingway98
marked this pull request as ready for review
September 27, 2026 20:45
NikhilShahi
approved these changes
Sep 27, 2026
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.
Summary
Docker image imports discarded the image's
PATH, which could make commands use the system interpreter instead of an image-provided virtualenv. Preserve that environment value when deriving sandbox image initialization metadata.Changes
PATH; explicit caller overrides, including an empty value, still take precedence.1.9.0to1.9.1.Validation
1.9.1wheel and source distribution with Python 3.12; both passedtwine checkand version metadata verification.The companion receiver change preserves child PATH during shell execution. These latest fixes have been validated locally end to end; production-host verification remains pending.
Note
Medium Risk
Changes how sandbox startup env is built for imported Docker images, directly affecting executable resolution; scope is narrow and covered by expanded tests.
Overview
Fixes sandbox Docker image imports dropping the image’s
PATH, which could route commands to the host interpreter instead of an image virtualenv.PATHis no longer treated as a reservedimage_initenv key, so_derive_auto_image_envkeeps the value from the image config during exact-image reuse and other import paths. Callerimage_init.envstill wins viamerge_image_init, including whenPATHis set to a custom value or an empty string.Tests now cover sync/async exact reuse (no
docker save), env filtering for reserved keys likeHOME/SANDBOX_ENABLED, andPATHoverride behavior. Package version is bumped to 1.9.1.Reviewed by Cursor Bugbot for commit 00905ed. Bugbot is set up for automated code reviews on this repo. Configure here.