fix: honor per-file review terminal states - #582
Conversation
|
CLA Assistant confirms that I signed the CLA as 4-1-1. I rechecked the original PR #578 and recreated it as this PR (#582), but the |
|
🔍 OpenCodeReview found 2 issue(s) in this PR.
|
31596c9 to
2507df0
Compare
|
Hi @lizhengfeng101, the CLA is now green and this PR is mergeable. When convenient, could you please take a look? It fixes per-file tasks incorrectly treating FAILED or incomplete terminal states as successful, while preserving compatibility with legacy task_done({}). Targeted regression tests and go vet for the affected packages pass. Thank you! |
Treat FAILED and missing completion as review failures, and retry invalid task_done states instead of accepting them as success. Keep partial scan output and session history aligned with those states.
2507df0 to
fd102b2
Compare
Description
Per-file review and scan tasks could be reported as successful even when the model explicitly returned
task_done({"state":"FAILED"})or stopped without reaching a valid terminal state. Invalid terminal states could also be accepted instead of being returned to the model for correction.This change makes terminal-state handling explicit across the per-file agent loop and its callers:
DONEcompletes the task.FAILEDterminates the task as a failure.task_doneis propagated as a review or scan failure.task_done({})remains a successful completion for compatibility.Type of Change
How Has This Been Tested?
go vetpasses for all affected packages.Checklist
Related Issues
No linked issue.