fix(create-pr): add marker-based cleanup for stranded synthetic commits#203
fix(create-pr): add marker-based cleanup for stranded synthetic commits#203jamesadevine wants to merge 1 commit into
Conversation
…ts (#192) If the process is hard-killed (OOM, SIGKILL) between creating a synthetic commit and resetting it, the commit persists in the working directory. While this is low-risk (the agent runs in an ephemeral AWF container), it can confuse subsequent invocations. Add a marker file (.ado-aw-synthetic-commit) that is: - Written before the synthetic commit is created - Removed after the reset completes - Checked at the start of generate_patch() — if present, the stranded commit is cleaned up with git reset HEAD~1 Also documents why a stash-based approach was considered but not used (format-patch requires proper commit history for rename detection and binary handling). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This PR and issue makes no sense given the execution context |
🔍 Rust PR ReviewSummary: Has a concrete bug — the marker file placement in the working tree creates a false-positive cleanup path that can reset a real (non-synthetic) commit. Findings🐛 Bugs / Logic Issues
✅ What Looks Good
|
Closes #192.
Problem
generate_patch() creates a synthetic commit, runs git format-patch, then resets it. If the process is hard-killed (OOM, SIGKILL) between commit and reset, the synthetic commit persists.
Fix
Marker file approach:
Also adds documentation explaining why a git stash approach was considered but not used (format-patch needs proper commit history for rename detection and binary handling).
Risk Assessment
Low probability event in an ephemeral AWF container. The marker-based cleanup adds a safety net without changing the proven format-patch flow.
Testing
All 810 tests pass.