mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #194] [MERGED] fix: atomically claim expired sandboxes #242
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#242
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/194
Author: @ztting01
Created: 8/19/2026
Status: ✅ Merged
Merged: 8/25/2026
Merged by: @LSX-s-Software
Base:
main← Head:fix/atomic-auto-eviction-expiry📝 Commits (4)
40abd67fix: atomically claim expired sandboxes850de83refactor: simplify sandbox helper names2e001cdtest: make auto-eviction claim gate one-shot2c15c9erefactor: inline auto-eviction actions📊 Changes
2 files changed (+421 additions, -11 deletions)
View changed files
📝
src/orchestrator/service.rs(+77 -9)📝
src/orchestrator/tests.rs(+344 -2)📄 Description
Summary
PauseandDeletetimeout actionsFixes #165
Root cause
evict_expired_sandboxesacted on metadata returned by an earlierlist_expiredsnapshot. A keep-alive could updateexpires_atand return success while the eviction loop later transitioned the still-Runningsandbox toPausingorKillingbased on that stale snapshot.The fix evaluates the expiry predicate and performs the state transition in the same
update_if_statecritical section. If renewal wins, eviction observes the new deadline and skips the sandbox. If eviction wins, keep-alive observes the transitional state and cannot report a successful renewal.Red/green verification
The same test selection was run against the parent commit and the fix:
547c1a8, tests-only patch): 3 passed, 4 failedThe four pre-fix failures cover both
PauseandDelete, including the key invalid outcome where keep-alive reports success and stale auto-eviction still proceeds.Test coverage
New deterministic cases cover:
Validation
make fmtcargo clippy -p agentenv --lib --tests -- -D warningscargo test -q -p agentenv --lib orchestrator::service::tests::— 91 passedcargo test -q -p agentenv --lib auto_evict— 7 passed🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.