Skip to content
Computing Life · Share · Yage

Why git worktree isolation doesn't stop AI agents from deleting new logic at merge time

为什么用了 git worktree,Agent 合代码时还是会删掉你的新逻辑

git worktree isolates an AI agent's working directory, but interface changes at merge time can still lead an agent following an old plan to delete new logic on the main branch. The article cites SWE-Shift tests across 17 coding systems and 120 tasks: passing existing tests does not guarantee new code survives, and clearing old conversation plus rescanning the workspace raised pairwise success by six to nine percentage points.

Why it matters: It offers a concrete method: isolate the working directory with git worktree, then reopen a clean window before merging so the agent reworks the merge against current interfaces and patch diffs.

Read the original ↗Export Markdown