feat: Add fix_retries for workflow verification failures#190
Merged
Conversation
When a step with apply_edits and verify fails verification, the workflow can now automatically retry by re-querying the LLM with the error message. - Add fix_retries field to Step struct - Wrap apply/verify in 'fix_loop that retries on failure - Roll back via git-agent before retry - Re-query backend with error context appended to prompt Usage in workflow: ```toml [[steps]] name = "fix" apply_edits = true verify = "cargo clippy" fix_retries = 2 ``` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
lok Review (Claude + Codex + Gemini consensus)Verdict: APPROVEThe fix_retries feature correctly implements a retry loop for verification failures with proper rollback and user feedback. Core implementation is sound but has gaps around timeout handling, error logging, and scope of what triggers retries. Recommended to address timeout wrapping and error logging before merge. Critical: None Important: - Re-query failures are silent: When backend.query fails during fix retry, no error is logged and the specific failure reason is swallowed, making debugging difficult (workflow.rs ~1385-1390, ~1418-1423)
Minor: - Inconsistent error message format: Verification errors are wrapped in code blocks but timeout errors are not (workflow.rs ~1379-1382 vs ~1413-1417)
Automated review by lok review-pr workflow |
- Add timeout wrapper to fix re-queries (prevents indefinite hangs) - Log re-query failures instead of silent fallthrough - Recalculate elapsed_ms after fix_loop to include retry time Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a step with
apply_editsandverifyfails verification, the workflow can now automatically retry by re-querying the LLM with the error message.Changes
fix_retriesfield to Step struct'fix_loopthat retries on failureUsage
When verification fails, the workflow will:
fix_retriestimesTest plan
🤖 Generated with Claude Code