fix(code-review): retry broken sandboxes#3110
Open
alex-alecu wants to merge 4 commits intomainfrom
Open
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Resolved Findings
Reviewed by gpt-5.5-2026-04-23 · 810,280 tokens |
Contributor
Author
|
Manual test passed. Tested:
Verified:
|
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.
Why
Sometimes a code review can fail because the machine it is using breaks. When that happens, the review should get one clean second try instead of staying failed.
What changed
Code reviews now remember which sandbox and attempt they are using. When cloud-agent-next confirms a sandbox failed and destroys it, the web app claims affected reviews only once and starts them again in a fresh attempt. Old updates from the first attempt are ignored, so they cannot overwrite the retry. The same pull request check is reused and shows that the review is trying again.
How to test
pnpm drizzle migrate.pnpm test -- "apps/web/src/app/api/internal/code-review-status/[reviewId]/route.test.ts" apps/web/src/app/api/internal/code-review-sandbox-destroyed/route.test.ts apps/web/src/lib/code-reviews/sandbox-retry.test.ts apps/web/src/lib/code-reviews/db/code-reviews.test.ts apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.test.ts apps/web/src/routers/code-reviews-router.test.ts.pnpm --filter kilo-code-review-worker test.pnpm --filter cloud-agent-next test -- sandbox-recovery.test.ts session-prepare.test.ts.pnpm --filter @kilocode/worker-utils test.