edit_file: Add diff-fenced output format (#32737)

This format is enabled for Google models as they seem to prefer it.
A relevant unit eval's pass rate has increased from 0.77 to 0.98.

Diff-fenced format looks like this (markdown fences and a line hint are
optional):

```diff
<<<<<<< SEARCH line=42
...
=======
...
>>>>>>> REPLACE
```

Release Notes:

- Agent: Gemini models now use the diff-fenced format when making edits
This commit is contained in:
Oleksiy Syvokon 2025-06-16 17:28:18 +03:00 committed by GitHub
parent 8df6ce2aac
commit fceba6c795
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 667 additions and 79 deletions

View file

@ -65,7 +65,8 @@ const PROMPT_PATHS = [
"crates/agent/src/prompts/summarize_thread_detailed_prompt.txt",
"crates/agent/src/prompts/summarize_thread_prompt.txt",
"crates/assistant_tools/src/templates/create_file_prompt.hbs",
"crates/assistant_tools/src/templates/edit_file_prompt.hbs",
"crates/assistant_tools/src/templates/edit_file_prompt_xml.hbs",
"crates/assistant_tools/src/templates/edit_file_prompt_diff_fenced.hbs",
"crates/git_ui/src/commit_message_prompt.txt",
];