mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 02:26:12 +02:00
Fresh agent worktrees could inherit committed divergence from a stale or unpushed local master, leaking unrelated changes into a task's PR. Resolve the base ref authoritatively to origin/<branch> (mapping a configured local branch to its remote-tracking counterpart) so unpushed local commits never seed a task branch, and record the resolved ref so drift checks stay accurate. Also auto-refresh a reused worktree to the latest origin/master when it is provably unstarted (no commits past base, clean tree including untracked files); started or dirty worktrees keep warn-only behavior so in-progress work is never destroyed.