Skip to content

Fix minor bugs in file tools and UI feedback#1328

Open
hobostay wants to merge 1 commit intoMoonshotAI:mainfrom
hobostay:fix/minor-bug-fixes
Open

Fix minor bugs in file tools and UI feedback#1328
hobostay wants to merge 1 commit intoMoonshotAI:mainfrom
hobostay:fix/minor-bug-fixes

Conversation

@hobostay
Copy link
Copy Markdown

@hobostay hobostay commented Mar 3, 2026

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 on original_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 /feedback command had no feedback when the browser opened successfully, leaving users uncertain.

Fix: Show appropriate message whether browser opens successfully or not.

Test plan

  • All existing tests pass (34 tests in test_str_replace_file.py and test_read_file.py)
  • Code formatting and type checking pass

Open with Devin

- 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>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant