Skip to content

Conversation

0xToshii
Copy link
Contributor

@0xToshii 0xToshii commented Jul 29, 2025

Related Issue

Issue: #XXXX

Description

There is no try-catch on the diffViewEditor logic for closing dirty tabs which occasionally throws an error and bricks cline entirely. The underlying issue is that there's no error handling on the attempt to close the tabs. It may be worth in the future adding logic to re-try on initial failure

Test Procedure

To reproduce this have the same file opened on lhs and rhs and have cline try to edit the file. This will (often) throw an error which results in bricking cline.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Screenshots

recording:

record.bricking.mov

screenshot:
screenshot bricking

Additional Notes


Important

Add error handling for tab closing in VscodeDiffViewProvider to prevent application crashes.

  • Error Handling:
    • Add try-catch block around vscode.window.tabGroups.close(tab) in VscodeDiffViewProvider to handle errors when closing tabs.
    • Logs warning message "Tab close retry failed:" with error message if tab close fails.
  • Affected Methods:
    • openDiffEditor() and closeDiffView() methods in VscodeDiffViewProvider are updated with error handling for tab closing.

This description was created by Ellipsis for b0522ad. You can customize this summary. It will automatically update as commits are pushed.

Copy link

changeset-bot bot commented Jul 29, 2025

⚠️ No Changeset found

Latest commit: b0522ad

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@0xToshii 0xToshii changed the title fix issue where cline is occasionally bricked by the diffViewEditor fix issue where cline is occasionally bricked by the diffViewProvider attempting to close tabs Jul 29, 2025
Copy link
Contributor

Coverage Report

Extension Coverage

Base branch: 46%

PR branch: 47%

✅ Coverage increased or remained the same

Webview Coverage

Base branch: 17%

PR branch: 17%

✅ Coverage increased or remained the same

Overall Assessment

Test coverage has been maintained or improved

Last updated: 2025-07-29T03:02:02.000199

Copy link
Contributor

@arafatkatze arafatkatze left a comment

Choose a reason for hiding this comment

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

Approving this PR because the code makes logical sense.

This will not brick cline and its nice to have try and catch blocks.

That being said I have never faced the issue myself.

@0xToshii 0xToshii merged commit b9f4678 into main Jul 29, 2025
13 checks passed
Copy link
Contributor

@celestial-vault celestial-vault left a comment

Choose a reason for hiding this comment

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

LGTM

dtrugman pushed a commit to dtrugman/cline that referenced this pull request Aug 24, 2025
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.

3 participants