fix(sandbox): summarize cleanup_all failures with per-agent error reporting#4131
Open
UGVicV wants to merge 17 commits into
Open
fix(sandbox): summarize cleanup_all failures with per-agent error reporting#4131UGVicV wants to merge 17 commits into
UGVicV wants to merge 17 commits into
Conversation
added 17 commits
May 22, 2026 11:55
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.
Description
This PR resolves the issue where
AgentSandbox.cleanup_all()silently failed without reporting which sandbox cleanup failed. Operators could not tell which temporary workspaces remained after bulk cleanup.Fix
cleanup_all()return type fromNonetoDict[str, List]withsucceededandfailedkeys.agent_idanderrormessage for operator diagnostics.logger.warning()when failures occur,logger.error()for individual failures.print()withlogger.error()throughout the file.osimport.Verification (Proof)
Added 3 regression tests in new
TestCleanupAllclass:test_cleanup_all_success: Verifies all sandboxes cleaned up, returned in succeeded list.test_cleanup_all_partial_fail: Verifies failed sandbox (mocked OSError) is collected in failed list.test_cleanup_all_empty: Verifies empty sandbox returns empty result.flake8 src/agent/sandbox.py tests/test_sandbox.py-> Passed (0 errors)git diff --check-> Passed (0 errors)Closes #4066.