fix: use is_initializer instead of undefined is_first_run variable

The PR #77 introduced a bug where `is_first_run` was used in the
completion detection check, but this variable is only defined when
`agent_type is None`. When the orchestrator runs agents with explicit
`--agent-type` or `--feature-id`, the variable is undefined causing
a NameError crash.

Changed to use `is_initializer` which is always defined and has the
correct semantic meaning for this check.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Auto
2026-01-19 09:03:38 +02:00
parent 0391df8fb2
commit 6c8b463891

View File

@@ -186,8 +186,8 @@ async def run_autonomous_agent(
iteration += 1
# Check if all features are already complete (before starting a new session)
# Skip this check on first iteration if it's a fresh start (initializer needs to run)
if not is_first_run and iteration == 1:
# Skip this check if running as initializer (needs to create features first)
if not is_initializer and iteration == 1:
passing, in_progress, total = count_passing_tests(project_dir)
if total > 0 and passing == total:
print("\n" + "=" * 70)