mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #45] [CLOSED] fix(sandbox): roll back resources after start failures #137
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#137
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/45
Author: @morluto
Created: 7/28/2026
Status: ❌ Closed
Base:
main← Head:fix/start-failure-resource-rollback📝 Commits (2)
d631e4dfix(sandbox): roll back failed direct starts4ddd422fix(sandbox): retain network slot on policy failure📊 Changes
1 file changed (+70 additions, -5 deletions)
View changed files
📝
src/sandbox/firecracker/sandbox.rs(+70 -5)📄 Description
Problem
Direct calls to
FirecrackerSandbox::start()returned after startup or readiness errors without awaiting cleanup. Fresh startup also applied fallible egress-policy configuration before attaching the allocated network slot to the sandbox.Together, these paths could retain daemon-managed ublk resources or leave a network slot unavailable after a failed start.
Changes
start_nowait()andwait_for_ready()as one public-start transaction.stop()after either operation fails.Existing orchestrator cleanup,
Drop, and daemon shutdown behavior are unchanged.Commit structure
fix(sandbox): roll back failed direct startsfix(sandbox): retain network slot on policy failureThe commits are separate because public-start transactionality and network-slot ownership are independently reviewable and revertible.
Validation
cargo test -p agentenv --lib sandbox::firecracker::sandbox::tests::— 14 passed.cargo clippy -p agentenv --lib -- -D warningscargo fmt --allThe network ownership test uses the existing deterministic test-slot seam. A full base-failing
start_freshintegration test would require privileged networking, ublk setup, and an additional injection seam, so this PR does not add production-wide mocking for that path.Closes #42.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.