mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #405] [MERGED] fix: reject explicit volume mounts on snapshots with volumes #408
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#408
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/405
Author: @Primary33
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/reject-snapshot-volume-replacement📝 Commits (1)
7e8eb75fix: reject explicit volume mounts on snapshots with volumes📊 Changes
7 files changed (+79 additions, -2 deletions)
View changed files
📝
CLAUDE.md(+2 -1)📝
docs/src/concepts/sandboxes/starting.md(+1 -1)📝
docs/src/concepts/volumes/sandbox-forks-and-snapshots.md(+5 -0)📝
scripts/tests/e2e/suites/15_volume.sh(+23 -0)📝
src/api/generated/src/models.rs(+2 -0)📝
src/api/impls/sandbox.rs(+38 -0)📝
src/api/openapi.yml(+8 -0)📄 Description
What
Reject explicit
volumeMounts, including[], when launching a sandbox snapshot that contains volumes.Why
The restored guest retains its captured filesystems. Rebinding those drive slots to different volumes can corrupt data. Following the maintainer discussion, reject replacement instead of implementing the staging and unmount machinery in #404.
Related issue
Supersedes #404. Prerequisite for #398.
Scope and non-goals
Warm-start validation, API descriptions, CLI documentation, and regression coverage.
Design and behavior changes
Check the original optional field before allocating or reserving volumes. Omitting it restores the captured snapshot volumes. Templates still accept explicit mounts, as do snapshots without volumes. Both creation endpoints share this check.
Compatibility and operations
[].Validation
Tested on Ubuntu 24.04 as a non-root user with isolated state, dependencies, ports, and network ranges.
make agentenv-serverwith OpenAPI Generator 7.22.0make fmtmake clippycargo test -p agentenv --lib snapshot_volume_replacementmake test-unit— 1206 passed, plus shell checks; CLI tests serialized15_volume.sh— 56 assertions, including both endpoints and empty arrays16_volume_randomized.sh— 1696 assertions; Compose, seed 21106, 50 stepsRisks and reviewer notes
Empty arrays intentionally count as explicit replacement requests.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.