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
feat: add case sensitivity debug logging to search algorithm
- Add detection for case mismatches when search fails
- Log case sensitivity issues to console for AI debugging
- Show potential case mismatch count in error messages
- Add comprehensive tests for case sensitivity detection
Fixes#4731
startLine ? `starting at line ${startLine}` : "start to end"
647
-
}\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}`,
691
+
}\n- Tried both standard and aggressive line number stripping${caseMismatchInfo}\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}`,
caseMismatchInfo=`\n- 🔍 **Potential case mismatch**: Found ${caseMismatchCount} location(s) where content differs only by case`
582
+
console.log(
583
+
`[apply_diff] Case sensitivity issue detected: ${caseMismatchCount} potential matches with different casing`,
584
+
)
585
+
}
586
+
543
587
diffResults.push({
544
588
success: false,
545
-
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- 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}`,
589
+
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- Tried both standard and aggressive line number stripping${caseMismatchInfo}\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}`,
0 commit comments