Fix dollar sign replacement bug in file editing (#7871)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
fuyou
2025-09-13 14:05:43 +08:00
committed by GitHub
parent 087c192e51
commit 73466b626d
8 changed files with 239 additions and 24 deletions
+4 -1
View File
@@ -14,6 +14,7 @@ import {
MCPServerStatus,
isNodeError,
parseAndFormatApiError,
safeLiteralReplace,
} from '@google/gemini-cli-core';
import type {
ToolConfirmationPayload,
@@ -518,7 +519,9 @@ export class Task {
if (oldString === '' && !isNewFile) {
return currentContent;
}
return currentContent.replaceAll(oldString, newString);
// Use intelligent replacement that handles $ sequences safely
return safeLiteralReplace(currentContent, oldString, newString);
}
async scheduleToolCalls(