Return updated line numbers with post-replace diff#20325
Return updated line numbers with post-replace diff#20325gundermanc wants to merge 7 commits intomainfrom
Conversation
Summary of ChangesHello @gundermanc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant improvements to the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request primarily enhances the edit tool by adding line number tracking for exact matches, which will provide more precise feedback to the language model. It also includes dependency updates to integrate a new devtools package. While the changes for line number tracking are a good improvement, there is a critical bug in the calculateRegexReplacement function where the tokenization logic has been incorrectly modified, which will likely break the regex-based replacement strategy.
…ace tool response
|
Size Change: +552 B (0%) Total Size: 25.7 MB ℹ️ View Unchanged
|
57ef47b to
2406cdd
Compare
Summary
In the past week or so I merged #19240 which reduced the failure rate of the replace tool by ~1-2%. Shortly after, I merged #19574 which made the agent significantly faster by eliminating a bunch of read turns.
19574 unfortunately regressed replace tool success rate back to about where it was because the smaller view of the updated file meant that the agent's understanding of line numbers got out of sync without it realizing.
This change adds in a start_line, end_line, and total doc length into the response from replace, filling in these context gaps for the agent without requiring a verification read. Initial evals seem to show that the regression to replace success rate is fixed.