summaryrefslogtreecommitdiff
path: root/packages/server/src
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-05-25 13:44:49 -0700
committerN. Taylor Mullen <[email protected]>2025-05-25 13:47:19 -0700
commit2e3eeaf920f51e93d194e36bdd8338e65061afc0 (patch)
treed6f74a1c3501a9418fec5db2b79f2512c53230c3 /packages/server/src
parentceb25c8350dd21a56a1431643faf8739d026b869 (diff)
Upon finding > 1 occurrences do not attempt auto-correction.
- When correcting edits prior to this if we found more than one occurrence we would try to auto-correct the old/new strings. There's no need in this situation because the tool has already provided too vague of an old_string to act upon. Instantly return. Part of https://github.com/google-gemini/gemini-cli/issues/484
Diffstat (limited to 'packages/server/src')
-rw-r--r--packages/server/src/utils/editCorrector.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/server/src/utils/editCorrector.ts b/packages/server/src/utils/editCorrector.ts
index c8a8e1a9..477b2381 100644
--- a/packages/server/src/utils/editCorrector.ts
+++ b/packages/server/src/utils/editCorrector.ts
@@ -69,6 +69,12 @@ export async function ensureCorrectEdit(
originalParams.new_string,
);
}
+ } else if (occurrences > 1) {
+ const result: CorrectedEditResult = {
+ params: { ...originalParams },
+ occurrences,
+ };
+ return result;
} else {
// occurrences is 0 or some other unexpected state initially
const unescapedOldStringAttempt = unescapeStringForGeminiBug(