mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
revert: lower the confidence levels
This commit is contained in:
@@ -344,7 +344,7 @@ export async function applyEdit(hunk: Hunk, content: string[], matchPosition: nu
|
|||||||
// Normal mode - try strategies sequentially until one succeeds
|
// Normal mode - try strategies sequentially until one succeeds
|
||||||
for (const strategy of strategies) {
|
for (const strategy of strategies) {
|
||||||
const result = await strategy.apply();
|
const result = await strategy.apply();
|
||||||
if (result.confidence === 1) {
|
if (result.confidence > MIN_CONFIDENCE) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ Your diff here
|
|||||||
startLine?: number,
|
startLine?: number,
|
||||||
endLine?: number
|
endLine?: number
|
||||||
): Promise<DiffResult> {
|
): Promise<DiffResult> {
|
||||||
const MIN_CONFIDENCE = 1
|
const MIN_CONFIDENCE = 0.9
|
||||||
const parsedDiff = this.parseUnifiedDiff(diffContent)
|
const parsedDiff = this.parseUnifiedDiff(diffContent)
|
||||||
const originalLines = originalContent.split("\n")
|
const originalLines = originalContent.split("\n")
|
||||||
let result = [...originalLines]
|
let result = [...originalLines]
|
||||||
@@ -170,7 +170,7 @@ Your diff here
|
|||||||
const { index: matchPosition, confidence } = findBestMatch(contextStr, result)
|
const { index: matchPosition, confidence } = findBestMatch(contextStr, result)
|
||||||
|
|
||||||
const editResult = await applyEdit(hunk, result, matchPosition, confidence)
|
const editResult = await applyEdit(hunk, result, matchPosition, confidence)
|
||||||
if (editResult.confidence >= MIN_CONFIDENCE) {
|
if (editResult.confidence > MIN_CONFIDENCE) {
|
||||||
result = editResult.result
|
result = editResult.result
|
||||||
} else {
|
} else {
|
||||||
return { success: false, error: `Failed to apply edit using ${editResult.strategy} strategy` }
|
return { success: false, error: `Failed to apply edit using ${editResult.strategy} strategy` }
|
||||||
|
|||||||
Reference in New Issue
Block a user