Preserve blocked PR lanes during doctor cleanup - #746
Merged
NagyVikt merged 2 commits intoAug 31, 2026
Merged
Conversation
NagyVikt
commented
Aug 31, 2026
NagyVikt
left a comment
Collaborator
Author
There was a problem hiding this comment.
🛡️ GitGuardex code-assist
2 finding(s) — 🟠 1 high · 🟡 1 medium
⛔ Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).
| Severity | Location | Finding |
|---|---|---|
| 🟠 high | templates/scripts/agent-worktree-prune.sh:590 |
Open PR protection excludes work/* lanes. The script processes and deletes both agent/* and work/* branches, but both new |
| 🟡 medium | templates/scripts/agent-worktree-prune.sh:230 |
The implementation makes a separate GitHub API request for every candidate and can query the same branch again during branch deletion. |
Provider codex · commit 74a1ec7
NagyVikt
commented
Aug 31, 2026
NagyVikt
left a comment
Collaborator
Author
There was a problem hiding this comment.
🛡️ GitGuardex code-assist
1 finding(s) — 🟡 1 medium
✅ Merge gate: pass — no blocking findings (blocks on high/critical).
| Severity | Location | Finding |
|---|---|---|
| 🟡 medium | templates/scripts/agent-worktree-prune.sh:587 |
The open-PR check performs a GitHub API request for every agent/work worktree before determining whether it is eligible for pruning. |
Provider codex · commit c4c4760
NagyVikt
marked this pull request as ready for review
August 31, 2026 10:46
NagyVikt
marked this pull request as draft
August 31, 2026 10:50
NagyVikt
commented
Aug 31, 2026
NagyVikt
left a comment
Collaborator
Author
There was a problem hiding this comment.
🛡️ GitGuardex code-assist
✅ No findings. Nothing worth an inline comment in this diff.
Provider codex · commit c4c4760
NagyVikt
marked this pull request as ready for review
August 31, 2026 10:51
added 2 commits
August 31, 2026 12:57
Constraint: unattended doctor cleanup must not delete clean unmerged lanes or branches with open PRs. Tested: doctor/worktree 44 tests; lint; package check; full suite 1047 pass, 1 unrelated flaky failure reran green.
- HIGH templates/scripts/agent-worktree-prune.sh:590 Open PR protection excludes `work/*` lanes. The script processes and deletes both `agent/*` and `work/*` branches, but both new preservation checks only cover `agent/*`, so an eligible `work/*` branch with an open PR can still have its worktree and branch deleted; update both checks and add coverage for a `work/*` PR lane.
NagyVikt
force-pushed
the
agent/codex/preserve-pr-and-worktree-on-dirty-merge-2026-08-31-12-22
branch
from
August 31, 2026 11:02
c4c4760 to
4b2ddec
Compare
NagyVikt
deleted the
agent/codex/preserve-pr-and-worktree-on-dirty-merge-2026-08-31-12-22
branch
August 31, 2026 11:08
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
Test plan