fix(core): prevent omission placeholder deletions in replace/write_file (#19870)

Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
This commit is contained in:
Nick Salerni
2026-02-22 11:58:31 -08:00
committed by GitHub
parent d96bd05d36
commit faa1ec3044
9 changed files with 282 additions and 8 deletions
@@ -547,7 +547,7 @@ A good instruction should concisely answer:
"type": "string",
},
"new_string": {
"description": "The exact literal text to replace \`old_string\` with, preferably unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic.",
"description": "The exact literal text to replace \`old_string\` with, preferably unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide exact literal code.",
"type": "string",
},
"old_string": {
@@ -665,7 +665,7 @@ exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snaps
"parametersJsonSchema": {
"properties": {
"content": {
"description": "The content to write to the file.",
"description": "The content to write to the file. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide complete literal content.",
"type": "string",
},
"file_path": {
@@ -1312,7 +1312,7 @@ The user has the ability to modify the \`new_string\` content. If modified, this
"type": "string",
},
"new_string": {
"description": "The exact literal text to replace \`old_string\` with, unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic.",
"description": "The exact literal text to replace \`old_string\` with, unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide exact literal code.",
"type": "string",
},
"old_string": {
@@ -1429,7 +1429,7 @@ The user has the ability to modify \`content\`. If modified, this will be stated
"parametersJsonSchema": {
"properties": {
"content": {
"description": "The content to write to the file.",
"description": "The content to write to the file. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide complete literal content.",
"type": "string",
},
"file_path": {
@@ -71,7 +71,8 @@ export const DEFAULT_LEGACY_SET: CoreToolSet = {
type: 'string',
},
content: {
description: 'The content to write to the file.',
description:
"The content to write to the file. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide complete literal content.",
type: 'string',
},
},
@@ -332,7 +333,7 @@ A good instruction should concisely answer:
},
new_string: {
description:
'The exact literal text to replace `old_string` with, preferably unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic.',
"The exact literal text to replace `old_string` with, preferably unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide exact literal code.",
type: 'string',
},
expected_replacements: {
@@ -73,7 +73,8 @@ The user has the ability to modify \`content\`. If modified, this will be stated
type: 'string',
},
content: {
description: 'The content to write to the file.',
description:
"The content to write to the file. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide complete literal content.",
type: 'string',
},
},
@@ -310,7 +311,7 @@ The user has the ability to modify the \`new_string\` content. If modified, this
},
new_string: {
description:
'The exact literal text to replace `old_string` with, unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic.',
"The exact literal text to replace `old_string` with, unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic. Do not use omission placeholders like '(rest of methods ...)', '...', or 'unchanged code'; provide exact literal code.",
type: 'string',
},
expected_replacements: {