Problem
When retrying failed tasks or resuming a batch, individual coding agents fail with "File already exists" errors because previous runs created files that the agent's plan expects to create.
Current behavior: Agent fails immediately with executor error, no recovery attempted.
Expected behavior: Agent should escalate to orchestration layer which has context about:
- What files exist from previous runs
- Whether those files should be overwritten or edited instead of created
- The overall state of the workspace
Root Cause
The individual coding agents don't have awareness of the workspace state from previous runs. They generate plans assuming a clean slate. When they encounter existing files, they fail rather than adapting.
Proposed Solution
-
Orchestration-level handling: When an agent encounters "File already exists", it should escalate to the main orchestrator rather than failing outright.
-
Orchestrator context: The orchestrator should:
- Track which files were created/modified by previous runs
- Provide this context to agents on retry
- Instruct agents to use "edit" operations instead of "create" for existing files
-
Tactical pattern: Add "File already exists" to the supervisor's tactical patterns so it can intervene and provide guidance.
Example Error
[DIAG] Agent FAILED - analyzing for supervisor intervention
[DIAG] Last step result: status=ExecutionStatus.FAILED, error=File already exists: src/task_tracker/exceptions.py
[DIAG] Matched tactical patterns: [] # <-- Should match a pattern here
[DIAG] No supervisor intervention - error_msg empty=False, no pattern match=True
Acceptance Criteria
Labels
enhancement, agent-system, batch-execution
Problem
When retrying failed tasks or resuming a batch, individual coding agents fail with "File already exists" errors because previous runs created files that the agent's plan expects to create.
Current behavior: Agent fails immediately with executor error, no recovery attempted.
Expected behavior: Agent should escalate to orchestration layer which has context about:
Root Cause
The individual coding agents don't have awareness of the workspace state from previous runs. They generate plans assuming a clean slate. When they encounter existing files, they fail rather than adapting.
Proposed Solution
Orchestration-level handling: When an agent encounters "File already exists", it should escalate to the main orchestrator rather than failing outright.
Orchestrator context: The orchestrator should:
Tactical pattern: Add "File already exists" to the supervisor's tactical patterns so it can intervene and provide guidance.
Example Error
Acceptance Criteria
Labels
enhancement, agent-system, batch-execution