fix: enforce mandatory :start_line: in apply_diff tool#12200
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
fix: enforce mandatory :start_line: in apply_diff tool#12200roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
- Make :start_line: mandatory in the regex pattern (was optional) - Add :start_line: presence tracking in validateMarkerSequencing - Add early validation in ApplyDiffTool before calling applyDiff - Add sayAndCreateMissingStartLineError helper method on Task - Update error messages to reflect :start_line: requirement - Update all existing tests to include :start_line: directive - Add new test for rejecting diffs without :start_line: Closes #12199
This was referenced Apr 26, 2026
Open
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.
Related GitHub Issue
Closes: #12199
Description
This PR attempts to address Issue #12199 by enforcing the
:start_line:directive as mandatory in theapply_difftool, matching what the tool prompt already documents.Changes:
src/core/diff/strategies/multi-search-replace.ts::start_line:mandatory in the regex pattern (removed trailing?from the group):start_line:presence tracking (foundStartLine) invalidateMarkerSequencingsrc/core/tools/ApplyDiffTool.ts::start_line:is present before callingapplyDiffsrc/core/task/Task.ts:sayAndCreateMissingStartLineErrorhelper method following the existingsayAndCreateMissingParamErrorpatternTest files:
:start_line:directive:start_line:are rejectedTest Procedure
multi-search-replace.spec.tsandmulti-search-replace-trailing-newline.spec.tspassPre-Submission Checklist
:start_line:as required).Feedback and guidance are welcome.
Interactively review PR in Roo Code Cloud