Fix minor bugs in file tools and UI feedback#1328
Open
hobostay wants to merge 1 commit intoMoonshotAI:mainfrom
Open
Fix minor bugs in file tools and UI feedback#1328hobostay wants to merge 1 commit intoMoonshotAI:mainfrom
hobostay wants to merge 1 commit intoMoonshotAI:mainfrom
Conversation
- Fix replacement count calculation in StrReplaceFile: When multiple edits are provided, the count should reflect the actual number of replacements made, accounting for cumulative changes from previous edits. - Fix truncated line numbers formatting in ReadFile: Display line numbers as comma-separated list instead of Python list representation for better user experience. - Improve webbrowser.open() handling in /feedback command: Show appropriate message whether browser opens successfully or not. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR fixes three minor bugs that improve user experience and correctness:
1. Fix replacement count calculation in StrReplaceFile
When multiple edits are provided to
StrReplaceFile, the replacement count was calculated based onoriginal_content, which didn't account for cumulative changes from previous edits. This could result in incorrect replacement counts being reported to the user.Fix: Re-apply edits sequentially on a temporary copy to correctly count actual replacements.
2. Fix truncated line numbers formatting in ReadFile
The truncated line numbers were displayed as Python list representation (e.g.,
Lines [1, 3] were truncated), which is not user-friendly.Fix: Format as comma-separated list (e.g.,
Lines 1, 3 were truncated).3. Improve webbrowser.open() handling in /feedback command
The
/feedbackcommand had no feedback when the browser opened successfully, leaving users uncertain.Fix: Show appropriate message whether browser opens successfully or not.
Test plan