Skip to content

Conversation

@max-frai
Copy link
Contributor

@max-frai max-frai commented Jun 20, 2025

Closes #32158

Release Notes:

  • Fix agent diff hanging when we "Keep All" changes for removed file

When agent removes some file, we still can see this change in the list of changed files. There we can click Review on removed file. Clicking "Keep All" hangs forever with this (simplified) log:

ERROR [zed::reliability] Suspected hang on main thread:
...
5. alloc::collections::btree::map::Keys<gpui::app::entity_map::Entity<language::buffer::Buffer>, gpui::app::entity_map::Entity<buffer_diff::BufferDiff>>  
   ↳ core::iter::Iterator::try_fold
6. core::iter::adapters::cycle::Cycle<alloc::collections::btree::map::Keys<…>>  
   ↳ core::iter::Iterator::find
7. agent_diff::AgentDiff::review_in_active_editor
8. gpui::app::AppContext::update_entity<agent_diff::AgentDiff, Option<executor::Task<…>>>

Zed tried to use cycle iterator to find buffer for the removed file, but it doesn't exist. In this case we just take next available buffer.

infinitely to find buffer related to removed file but it doesn't exist.
@cla-bot
Copy link

cla-bot bot commented Jun 20, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @max-frai on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@max-frai
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 20, 2025
@cla-bot
Copy link

cla-bot bot commented Jun 20, 2025

The cla-bot has been summoned, and re-checked this pull request!

@SomeoneToIgnore SomeoneToIgnore added the area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Jun 20, 2025
@zed-industries-bot
Copy link

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 1fdf6f9

@filipwiech
Copy link

Might also fix #32492. 👍

@notpeter
Copy link
Contributor

notpeter commented Aug 7, 2025

Apologies for not getting a chance to review this sooner, but I believe this has been fixed. If you are still seeing this can you comment with more details in the original issues and we can reopen there?

Thanks!

@notpeter notpeter closed this Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

5 participants