fix: preserve agentic branch when intermediate commits exist
_finalize_worktree was returning None and deleting the branch when the final commit was empty, even though _commit_iteration had already committed changes during the pipeline. Now checks git log for any commits on the branch before deciding to clean up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -71,8 +71,11 @@ class BuiltinAgentConfigTest(unittest.TestCase):
|
||||
|
||||
self.assertIn("--dangerously-skip-permissions", coder_args)
|
||||
self.assertIn("bypassPermissions", coder_args)
|
||||
self.assertIn("plan", reviewer_args)
|
||||
self.assertIn("plan", senior_args)
|
||||
# Reviewers/seniors use -p without --permission-mode plan
|
||||
self.assertIn("-p", reviewer_args)
|
||||
self.assertIn("-p", senior_args)
|
||||
self.assertNotIn("plan", reviewer_args)
|
||||
self.assertNotIn("plan", senior_args)
|
||||
|
||||
def test_codex_builtin_agents_skip_git_repo_check(self) -> None:
|
||||
for agent_name in ("codex-coder", "codex-reviewer", "codex-senior"):
|
||||
|
||||
Reference in New Issue
Block a user