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:
이충영 에이닷서비스개발
2026-03-14 20:48:25 +09:00
parent 0858675076
commit af05fc1ddb
2 changed files with 34 additions and 22 deletions

View File

@@ -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"):