feat(sandbox): honor OCI image working directories - #2530
Conversation
2c9c7b7 to
6838984
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-2530.docs.buildwithfern.com/openshell |
BlockedGator is blocked because PR #2530 currently has merge conflicts ( Next action: @matthewgrossman, please rebase or merge the base branch and resolve the conflicts, then push an updated head SHA so gator can run the independent review. |
Closes #2526 Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
6838984 to
493abe0
Compare
drew
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
Validation: PR #2530 implements linked issue #2526, which is already marked state:agent-ready / state:pr-opened, and the current head is open, ready for review, and no longer conflict-blocked.
Head SHA: 493abe06869d41a5b161a1a97abc21c0c3ce6436
Review findings:
- Warning: Docker/Podman pass the resolved workspace to the supervisor, but the create specs still appear to inherit the image process cwd. For hand-crafted OCI images where
Config.WorkingDiris missing on disk or is not a directory, the container runtime may fail before the supervisor can run the intended workspace validation/preparation path. Please consider starting the supervisor from a known-safe cwd such as/while passing--workdir <resolved-root>separately, and add coverage for missing/non-directoryWorkingDir. - See the inline warning about accepting whitespace/control-character OCI
WorkingDirvalues before SSH discovery and shell-text flows consume the path.
Docs: Fern docs and relevant agent skill guidance were updated; no docs navigation change appears required because no new page was added.
Next state: gator:in-review
| )); | ||
| } | ||
|
|
||
| Ok(working_dir.trim_end_matches('/').to_string()) |
There was a problem hiding this comment.
gator-agent
Warning: resolve_oci_workspace_root accepts paths with trailing whitespace or control characters, but SSH workspace discovery later trims stdout and uses shell text protocols. A WorkingDir such as /workspace or one containing a newline can be accepted by the driver and then discovered as a different root or fail transfer/editor flows. Please reject these as malformed here, or change discovery to use an unambiguous encoding before accepting them. This is CWE-20 input validation.
Summary
Docker and Podman now honor a usable OCI
Config.WorkingDiras the sandbox workspace, with an OpenShell-created/sandboxfallback for empty or root declarations. The resolved workspace is used consistently by drivers, the supervisor, filesystem policy, SSH transfers, and editor launch while Kubernetes/OpenShift and VM retain/sandbox.This is a stacked PR on top of #2509.
Related Issue
Closes #2526
Changes
WorkingDirwithUserfrom the same immutable Docker/Podman image and pass the resolved root through the existing supervisor workdir argumentfilesystem.include_workdirinstead of automatically granting literal/sandbox/sandboxbehavior for Kubernetes/OpenShift and VMTesting
mise run pre-commitpassesmise run testpassescustom_imageE2E passes (OCI WorkingDir, fallback, direct/SSH, transfers)driver_config_volumeE2E passes (nested volume ownership)Checklist