diff --git a/scripts/agentctl_console.py b/scripts/agentctl_console.py index ba2bf0bc..c119f265 100644 --- a/scripts/agentctl_console.py +++ b/scripts/agentctl_console.py @@ -167,9 +167,11 @@ def integrate_prepare(repo: ac.Repo, args) -> dict: if porcelain: ac.deny('INVALID_REQUEST', 'Existing integrate worktree is dirty', path=str(integ_path)) - # Different base: refuse rather than reset. - ac.deny('BASE_CHANGED', 'Integrate worktree exists for a different base; remove it first', - path=str(integ_path), head=head) + if head != expected: + # Different base: refuse rather than reset. + ac.deny('BASE_CHANGED', 'Integrate worktree exists for a different base; remove it first', + path=str(integ_path), head=head) + # Clean checkout parked on expected-dev (e.g. after abort): continue to merge. else: integ_path.parent.mkdir(exist_ok=True) ac.git(repo.main, 'worktree', 'add', '-b', branch, str(integ_path), expected)