Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

Fix minor bugs in file tools and UI feedback - #1328

Closed
hobostay wants to merge 1 commit into
MoonshotAI:mainfrom
hobostay:fix/minor-bug-fixes
Closed

hobostay wants to merge 1 commit into
MoonshotAI:mainfrom
hobostay:fix/minor-bug-fixes

Conversation

@hobostay

@hobostay hobostay commented Mar 3, 2026 •

Copy link
Copy Markdown

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 <[email protected]>

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

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant