Bug in JetBrains Copilot Plugin: Files Auto-Open on New Chat Due to Whitespace-Only Diffs in copilotDiffState.xml #189955
Replies: 1 comment
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Copilot Feature Area
JetBrains & Xcode
Body
I generated this post body using Copilot after having it diagnose and fix the problem successfully. However, I have little doubt that it will happen again.
Environment
Summary
The GitHub Copilot plugin for JetBrains IDEs stores "pending diffs" in
.idea/copilotDiffState.xmleven when the only change is trivial whitespace (e.g., a trailing newline character). These pending diffs may persist indefinitely across IDE sessions and cause the affected files to automatically open every time a new Copilot chat is started, creating a disruptive and confusing user experience. On top of that, there is no hint in the UI that these files have any unaccepted changes pending.Description
When Copilot suggests changes to a file that result in only whitespace differences (such as adding or removing a trailing newline), the plugin stores these as "pending diffs" in the project's
.idea/copilotDiffState.xmlfile. Unlike meaningful code changes, these whitespace-only diffs:In my specific case, the issue began with one file and grew to include multiple files over time, all opening automatically whenever I started a new Copilot chat.
Steps to Reproduce
Expected Behavior
One or more of the following should occur:
Actual Behavior
Technical Details
The Pending Diff Format
The plugin stores pending diffs in
.idea/copilotDiffState.xmllike this:The Actual Difference
In my case, the difference was literally one byte:
...export default useFetchNiceCatalog;\n\n...export default useFetchNiceCatalog;\nThis single byte difference caused the file to open automatically for weeks until I asked copilot about the issue, and it discovered and cleared the pending diffs in the XML file.
Impact
Current Workaround
Users must manually edit
.idea/copilotDiffState.xmlto clear the pending diffs:.idea/copilotDiffState.xmlin a text editor<map>...</map>content with just<map />Alternatively, users can try to explicitly accept or reject all diffs before closing each chat session, though this requires:
Suggested Fixes
Reproducibility
This issue is highly reproducible once triggered. Any Copilot suggestion that results in whitespace-only changes will likely cause this behavior.I'm not actually sure how reliably reproducible this is. I just know it can happen sometimes.Related Information
.idea/copilotDiffState.xmlfile is project-specific, so the issue affects specific projects where it occurredBeta Was this translation helpful? Give feedback.
All reactions