fix(cloud-agent-next): destroy sandbox on prep 500#3081
Merged
Conversation
Contributor
Author
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (9 files)
Fix these issues in Kilo Cloud Reviewed by gpt-5.5-20260423 · 1,153,037 tokens |
jrf0110
approved these changes
May 6, 2026
2b20bf4 to
b489a20
Compare
- Tighten 500 regexes with \b to avoid matching 5000/50012/etc. - Walk cause chain in recovery classifier so wrapped SandboxError 500s are still detected (mkdir error wrappers previously stripped identity, preventing destroy on control-plane 500s) - Skip cleanupWorkspace on cold-start resume when sandbox was destroyed (exec against a destroyed sandbox is a no-op that emits misleading warnings) - Drop redundant WRAPPER_START_FAILED branch; trailing cause recursion already covers it - Add sandbox_500_detected/destroyed/destroy_failed logTags to measure hit rate and destroy success per phase in Axiom
b489a20 to
164cf55
Compare
alex-alecu
reviewed
May 7, 2026
| try { | ||
| const result = await WrapperClient.ensureWrapper(sandbox, prepared.session, { | ||
| agentSessionId: sessionId, | ||
| userId, |
Contributor
There was a problem hiding this comment.
Could sandbox 500s from image attachment downloads be swallowed here? downloadImagesToSandbox catches per-file session.exec failures and this rethrows WORKSPACE_SETUP_FAILED without the original cause, so the recovery wrapper may not destroy an unhealthy sandbox.
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.
Summary
\bto avoid matching5000/50012/etc.cleanupWorkspaceon cold-start resume failure when the sandbox was already destroyed (exec against a destroyed sandbox would emit misleading warnings).WRAPPER_START_FAILEDclassification branch; the trailing `cause` recursion already covers it.sandbox_500_detected/sandbox_500_destroyed/sandbox_500_destroy_failedlogTags so we can measure hit rate, destroy success, and per-phase distribution in Axiom.Verification
Visual Changes
N/A
Reviewer Notes