Skip to content

fix(agent-manager): preserve local edits during base updates - #13780

Merged
marius-kilocode merged 1 commit into
mainfrom
improve-merge-conflict-resolution-workflow
Sep 4, 2026
Merged

fix(agent-manager): preserve local edits during base updates#13780
marius-kilocode merged 1 commit into
mainfrom
improve-merge-conflict-resolution-workflow

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

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.

@kilo-code-bot

kilo-code-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/update-from-base-questions.md
  • packages/kilo-vscode/src/agent-manager/base-update.ts
  • packages/kilo-vscode/tests/unit/base-update.test.ts

Reviewed by grok-4.6 · Input: 42K · Output: 5.7K · Cached: 131.1K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 74b3141 into main Sep 4, 2026
25 checks passed
@marius-kilocode
marius-kilocode deleted the improve-merge-conflict-resolution-workflow branch September 4, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants