Repository navigation
docs(prompt): enhance apply_diff tool instructions to improve Gemini model success rate #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
edelauna
merged 4 commits into
Zoo-Code-Org:main
from
awschmeder:feat/improve-apply-diff-prompt
Jun 24, 2026
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
58da98f
docs(prompt): enhance apply_diff tool instructions for Gemini model s…
awschmeder 69a7cbc
docs: add PR description for issue 611
awschmeder 1885e9c
docs(plan): align PR description plan with actual changes by removing…
awschmeder d3a564b
docs(prompt): soften :start_line: to strongly recommended and untrack…
awschmeder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "zoo-code": patch | ||
| --- | ||
|
|
||
| Enhance the `apply_diff` tool description and parameter instructions to enforce strict `:start_line:` formatting and copy-paste exact matching requirements, improving success rates for Gemini Flash and other smaller/faster models. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| ### Related GitHub Issue | ||
|
|
||
| Closes: #611 | ||
|
|
||
| ### Description | ||
|
|
||
| This PR enhances the documentation and instructions for the `apply_diff` tool to improve its success rate, particularly for Gemini models. It addresses issues with malformed `:start_line:` syntax and imprecise diff matching by enforcing stricter, clearer requirements in the tool's system instructions. | ||
|
|
||
| Note: While the issue notes that adding these guidelines to `AGENTS.md` resolved the issue locally, we have integrated them directly into the core prompts (`src/core/prompts/tools/native-tools/apply_diff.ts`) and have purposely omitted modifying `AGENTS.md` to adhere to repository PR hygiene guidelines. | ||
|
|
||
| ### Test Procedure | ||
|
|
||
| - Verify existing `apply_diff` behavior with `apps/vscode-e2e/src/suite/tools/apply-diff.test.ts`. | ||
| - Prompt instructions updated in `src/core/prompts/tools/native-tools/apply_diff.ts`. | ||
|
|
||
| ### Pre-Submission Checklist | ||
|
|
||
| - [x] **Issue Linked**: This PR is linked to an approved GitHub Issue. | ||
| - [x] **Scope**: My changes are focused on the linked issue (one major feature/fix per PR). | ||
| - [x] **Self-Review**: I have performed a thorough self-review of my code. | ||
| - [x] **Testing**: Existing tests cover the functionality; no new functionality requiring tests was added. | ||
| - [x] **Documentation Impact**: I have considered if my changes require documentation updates. | ||
| - [x] **Contribution Guidelines**: I have read and agree to the [Contributor Guidelines](/CONTRIBUTING.md). | ||
|
|
||
| ### Documentation Updates | ||
|
|
||
| - [ ] No documentation updates are required. (Updates are purely internal prompt instruction refinements). | ||
|
|
||
| ### Additional Notes | ||
|
|
||
| None. | ||
|
|
||
| ### Get in Touch | ||
|
|
||
| Zoo AI Assistant | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.