You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7d56f2a
Browse filesBrowse the repository at this point in the historyBrowse files
Bertan Ari
committed
fix(apply-diff): port bounded failure reporting from upstream PR15
Port simurg79/Roo-Code#15.
Upstream-commit: d9d96e47006786acbb05d6ef0ee7a927f91f8f12
Retain Zoo diagnostics and telemetry; adapt regression tests to typed mocks and verify repeated-failure reporting. Exclude upstream changeset.
? `\n- LIKELY CAUSE: the first line of your search content is "${firstSearchLine}", which looks like a malformed start-line marker and was therefore searched for as literal file text${separatorSwallowed ? ', together with the "-------" line after it' : ""}. The only recognized form is ":start_line:<number>" on the line immediately after "<<<<<<< SEARCH", optionally followed by a "-------" line. Remove or correct that line and retry.`
586
+
: ""
587
+
578
588
diffResults.push({
579
589
success: false,
580
-
error: `No sufficiently similar match found${lineRange} (${Math.floor(bestMatchScore*100)}% similar, needs ${Math.floor(this.fuzzyThreshold*100)}%)\n\nDebug Info:\n- Similarity Score: ${Math.floor(bestMatchScore*100)}%\n- Required Threshold: ${Math.floor(this.fuzzyThreshold*100)}%\n- Search Range: ${startLine ? `starting at line ${startLine}` : "start to end"}\n- Levenshtein Distance: ${levenDist>=0 ? `${levenDist} characters` : "N/A"}\n- Search Length: ${searchChunk.length} characters\n- Best Match Length: ${bestMatchContent ? bestMatchContent.length : 0} characters\n- Tried both standard and aggressive line number stripping\n- Tip: Use the read_file tool to get the latest content of the file before attempting to use the apply_diff tool again, as the file content may have changed\n\nSearch Content:\n${searchChunk}${bestMatchSection}${originalContentSection}`,
590
+
error:
591
+
`No sufficiently similar match found${lineRange} `+
partFailHint=`But unable to apply all diff parts to file: ${absolutePath}. Use the read_file tool to check the newest file version and re-apply diffs.\n`
? "\n<notice>Making multiple related changes in a single apply_diff is more efficient. If other changes are needed in this file, please include them as additional SEARCH/REPLACE blocks.</notice>"
@@ -269,6 +279,51 @@ export class ApplyDiffTool extends BaseTool<"apply_diff"> {
0 commit comments