Repository navigation
sidebar: Fix archive loop when a thread's worktree folder was deleted - #65578
Merged
Merged
Conversation
osiewicz
approved these changes
Oct 14, 2026
Closed
2 tasks done
amirkhakshour
pushed a commit
to SourceShift/zed-mini-ork
that referenced
this pull request
Oct 18, 2026
…zed-industries#65578) Closes zed-industries#57957 Archiving a thread whose linked worktree had been deleted outside Zed did nothing and kept a CPU core busy. To archive a thread whose workspace is closed, we open the workspace first and then call `archive_thread` again. With the worktree folder gone, opening falls back to the main project, so the thread's workspace never opens, and archive kept trying forever. Now the second pass never opens a workspace. If the worktree is gone, we just archive the thread. Left out on purpose: - Archiving can still switch the window to the main project once, because of that fallback. Fixing it means changing `find_or_create_workspace` for all of its callers, so I'd rather do it separately. - `close_terminal` follows the same pattern but can't loop, so I left it alone. Before: <img width="250" src="https://github.com/user-attachments/assets/e66a5675-0e84-4a59-a316-a36f289b4ff6" /> Release Notes: - Fixed archiving an agent thread doing nothing and keeping a CPU core busy when its linked worktree folder had been deleted. --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #57957
Closes #65188
Closes #64977
Archiving a thread whose linked worktree had been deleted outside Zed did nothing and kept a CPU core busy.
To archive a thread whose workspace is closed, we open the workspace first and then call
archive_threadagain. With the worktree folder gone, opening falls back to the main project, so the thread's workspace never opens, and archive kept trying forever.Now the second pass never opens a workspace. If the worktree is gone, we just archive the thread.
Left out on purpose:
find_or_create_workspacefor all of its callers, so I'd rather do it separately.close_terminalfollows the same pattern but can't loop, so I left it alone.Before:

Release Notes: