Bug Description
When a run produces zero files changed (on a task that clearly requires changes) or a truncated response, the action completes as-is with no retry attempt. The workflow finishes 'successfully' with a useless result.
Reproduction
- Trigger claude-code-action on a task like 'refactor this module' or 'fix these 3 bugs'
- Run produces a PR comment but changes 0 files, or only partially addresses the task
- Action reports success. No retry. Workflow ends.
Expected Behavior
When the output is clearly degenerate (zero diff on a mutation task, response truncated mid-sentence), the action should retry automatically — or at minimum expose the failure signal so the workflow can retry.
Actual Behavior
Single attempt. Zero diff. Green check. Done.
Impact
- Wastes entire CI cycles — you get notified of 'success' but nothing happened
- Especially bad for cron-triggered runs where nobody is watching
- Manual re-trigger costs time and breaks automation chains
Frequency
Approximately 10-15% of runs in my setup produce partial/empty results that would benefit from retry.
Suggested Fix
Optional quality thresholds with automatic retry:
\\yaml
- uses: anthropics/claude-code-action@v1
with:
min_files_changed: 1
max_retries: 2
fail_on_empty_diff: true
fail_on_truncated: true
\\
This pairs with #1392 (output validation as detection) — validation detects, retry acts.
I run 16 automated agent jobs daily and have built retry/quality logic for exactly this problem. Happy to contribute.
Bug Description
When a run produces zero files changed (on a task that clearly requires changes) or a truncated response, the action completes as-is with no retry attempt. The workflow finishes 'successfully' with a useless result.
Reproduction
Expected Behavior
When the output is clearly degenerate (zero diff on a mutation task, response truncated mid-sentence), the action should retry automatically — or at minimum expose the failure signal so the workflow can retry.
Actual Behavior
Single attempt. Zero diff. Green check. Done.
Impact
Frequency
Approximately 10-15% of runs in my setup produce partial/empty results that would benefit from retry.
Suggested Fix
Optional quality thresholds with automatic retry:
\\yaml
with:
min_files_changed: 1
max_retries: 2
fail_on_empty_diff: true
fail_on_truncated: true
\\
This pairs with #1392 (output validation as detection) — validation detects, retry acts.
I run 16 automated agent jobs daily and have built retry/quality logic for exactly this problem. Happy to contribute.