fix: keep the current plan when LLM refinement drops hunks or does not reduce violations - #121
Open
vitali87 wants to merge 1 commit into
Open
fix: keep the current plan when LLM refinement drops hunks or does not reduce violations#121vitali87 wants to merge 1 commit into
vitali87 wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
vitali87
force-pushed
the
fix/refinement-keeps-valid-plan
branch
from
August 30, 2026 16:31
345cb57 to
7813443
Compare
vitali87
changed the base branch from
fix/llm-parse-errors-retry
to
fix/guard-saved-plan-dag
August 30, 2026 16:32
vitali87
force-pushed
the
fix/refinement-keeps-valid-plan
branch
from
August 30, 2026 16:40
7813443 to
7455f28
Compare
vitali87
changed the base branch from
fix/guard-saved-plan-dag
to
fix/score-plan-cycle
August 30, 2026 16:40
…t reduce violations
vitali87
force-pushed
the
fix/refinement-keeps-valid-plan
branch
from
August 30, 2026 19:21
7455f28 to
db00703
Compare
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
Each LLM refinement iteration replaced the plan with whatever the model returned. There was no coverage check and no comparison with the plan being refined, so a response that dropped a hunk turned a plan that only had LOC warnings into one that fails
validate_planwithCOVERAGE_GAP(the run aborted), and a response that was no better was accepted anyway.Now a candidate is kept only if it passes
validate_coverageand has strictly fewer LOC-bound violations than the plan it replaces. Otherwise the current plan is kept and refinement stops, with a warning naming the reason:Refinement iteration N produced an invalid plan (Hunk b.py[0] not assigned to any group); keeping the current plan …Refinement iteration N did not reduce violations (2 -> 2); keeping the current planStacked on #63 (stack #75 = #59→#63→#121); #59 provides the
LLMErrorwrapping of malformed LLM output that this relies on.Test plan
test_refinement_that_drops_hunks_is_rejectedandtest_refinement_that_does_not_improve_is_rejected— both fail on the base