fix(agent-manager): preserve local edits during base updates - #13780
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by grok-4.6 · Input: 42K · Output: 5.7K · Cached: 131.1K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
September 4, 2026 10:17
WebReflection
approved these changes
Sep 4, 2026
marius-kilocode
deleted the
improve-merge-conflict-resolution-workflow
branch
September 4, 2026 10:28
This was referenced Sep 6, 2026
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.
What Problem This Solves
Update from base stops on uncommitted edits and asks which Git preservation method to use. The operation should preserve local work and resolve base conflicts without making users choose backup mechanics. Concurrent worktrees must not exchange edits through the repository's shared stash stack.
Why This Change Was Made
Replace the mandatory preservation question with instructions to verify a recovery copy unique to the current worktree and update, temporarily clear backed-up edits when needed, and restore their staging state. Keep unfinished edits out of the merge commit and retain recovery data until restoration is verified. Do not restore or remove another worktree's recovery data.
The shared stash stack and autostash remain excluded. Git's internal temporary merge state is allowed when it does not change the shared stash stack. Source selection, conflict-intent questions, and normal tool approvals remain unchanged. This is a focused prompt change, not a new Git transaction implementation.
User Impact
Update from base can continue through dirty-worktree preservation without a backup-method question. The agent must still stop if preservation cannot be verified or a conflict needs a decision about intended behavior.
Evidence
90 focused base-update and architecture tests passed, along with extension lint, formatting, and the change-marker guard.
Live-agent tests used disposable Git repositories. One exercised merge and restoration conflicts. Two agents then updated separate worktrees of the same repository concurrently, with different staged, unstaged, partially staged, binary, and untracked edits. Independent assertions verified every edit and staging boundary, excluded unfinished work from merge commits, and confirmed that a pre-existing shared stash entry and its reflog stayed unchanged. Both concurrent fixtures passed tests, lint, and typecheck. Test repositories and recovery artifacts were removed.
Local extension typecheck is blocked by existing workspace dependency and SDK type mismatches, including missing memory/indexing/core modules. No extension UI test was run; the live tests exercised the generated prompt directly.