fix(plan): wire cleanup_stale into _create_sandbox_for_plan #10827

Merged
HAL9000 merged 1 commit from bugfix/wire-cleanup-stale-in-create into master 2026-04-22 12:18:53 +00:00
Member

Summary

The cleanup_stale() call before sandbox.create() in _create_sandbox_for_plan() was lost during the rebase of PR #10798. Without it, re-executing a plan still crashes with fatal: a branch named 'cleveragents/plan-<id>' already exists.

3-line fix — adds GitWorktreeSandbox.cleanup_stale(resource.location, plan_id) before sandbox.create().

M1 E2E passes.

Closes #7271

## Summary The `cleanup_stale()` call before `sandbox.create()` in `_create_sandbox_for_plan()` was lost during the rebase of PR #10798. Without it, re-executing a plan still crashes with `fatal: a branch named 'cleveragents/plan-<id>' already exists`. 3-line fix — adds `GitWorktreeSandbox.cleanup_stale(resource.location, plan_id)` before `sandbox.create()`. M1 E2E passes. Closes #7271
fix(plan): wire cleanup_stale into _create_sandbox_for_plan
Some checks failed
CI / helm (pull_request) Successful in 32s
CI / build (pull_request) Successful in 3m45s
CI / quality (pull_request) Successful in 4m12s
CI / security (pull_request) Successful in 4m40s
CI / typecheck (pull_request) Successful in 4m43s
CI / lint (pull_request) Successful in 3m44s
CI / integration_tests (pull_request) Successful in 7m22s
CI / unit_tests (pull_request) Successful in 8m40s
CI / push-validation (pull_request) Successful in 21s
CI / docker (pull_request) Successful in 2m9s
CI / coverage (pull_request) Successful in 15m23s
CI / e2e_tests (pull_request) Successful in 7m41s
CI / status-check (pull_request) Successful in 3s
CI / benchmark-regression (push) Waiting to run
CI / benchmark-publish (push) Waiting to run
CI / unit_tests (push) Failing after 1s
CI / e2e_tests (push) Failing after 1s
CI / push-validation (push) Successful in 24s
CI / helm (push) Successful in 29s
CI / build (push) Successful in 3m45s
CI / lint (push) Successful in 3m54s
CI / quality (push) Successful in 4m12s
CI / typecheck (push) Successful in 4m27s
CI / security (push) Successful in 4m41s
CI / docker (push) Has been skipped
CI / integration_tests (push) Successful in 7m20s
CI / coverage (push) Successful in 13m59s
CI / status-check (push) Failing after 2s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 1h4m49s
4b972941f1
The cleanup_stale() call before sandbox.create() was lost during the
rebase of PR #10798.  Without it, re-executing a plan still crashes
with 'fatal: a branch named ... already exists'.

ISSUES CLOSED: #7271
hamza.khyari added this to the v3.5.0 milestone 2026-04-22 12:00:00 +00:00
HAL9000 scheduled this pull request to auto merge when all checks succeed 2026-04-22 12:12:42 +00:00
Author
Member

@HAL9000 need you to review this PR

@HAL9000 need you to review this PR
CoreRasurae left a comment

Looks good!

Looks good!
HAL9000 merged commit 4b972941f1 into master 2026-04-22 12:18:53 +00:00
hamza.khyari deleted branch bugfix/wire-cleanup-stale-in-create 2026-04-22 12:19:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!10827
No description provided.