agent: Support remote archive thread git operations - #54001
Merged
Merged
Conversation
maxbrunsfeld
approved these changes
Apr 15, 2026
Anthony-Eid
enabled auto-merge (squash)
April 15, 2026 19:45
5 tasks
eholk
pushed a commit
that referenced
this pull request
Apr 16, 2026
### Summary Follow up to: #54001 This PR makes `agent_ui::thread_worktree_archive::find_or_create_repository` whether or not the repository it's searching for is on a remote machine. In the case where it's on a remote machine that has an active connection in Zed's connection pool, we return the repository; otherwise, we error out. I implemented it this way so archiving a thread on a remote machine that isn't connected deletes the metadata without showing a remote connection modal to a user. In the future, we can work around this by having better git worktree garbage collection, where remote machines remove git worktree's that were created by Zed and have no thread metadata on connection too. Finally, this PR gets archive threads working on remotes! #### Follow Ups 1. Replace instances of `std::fs` with Zed's Fs trait in the archive thread codepaths 2. Make archive thread work properly for workspace's that are not open (local and remote) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
eholk
pushed a commit
to eholk/zed
that referenced
this pull request
Apr 17, 2026
…4001) ### Summary This PR implements remote support for git store operations that the sidebar's archive thread checkpoint/restore featured relied on. This was the second to last blocker for remote usage of this feature. I also made a shared backend between `update_ref` and `delete_ref` called `edit_ref` because they run the same git command and this allowed for some code unification. #### Remote Git Operations - `Repository::update_ref` - `Repository::delete_ref` - `Repository::repair_worktrees` - `Repository::create_archive_checkpoint` - `Repository::restore_archive_checkpoint` #### Follow up `agent_ui::thread_worktree_archive::find_or_create_repository` needs to be made aware of the remote machine that the repository it's searching for is on. Once that is completed, we can get the correct repo when archiving a remote thread and the flow should work without any problems. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
eholk
pushed a commit
to eholk/zed
that referenced
this pull request
Apr 17, 2026
…s#54074) ### Summary Follow up to: zed-industries#54001 This PR makes `agent_ui::thread_worktree_archive::find_or_create_repository` whether or not the repository it's searching for is on a remote machine. In the case where it's on a remote machine that has an active connection in Zed's connection pool, we return the repository; otherwise, we error out. I implemented it this way so archiving a thread on a remote machine that isn't connected deletes the metadata without showing a remote connection modal to a user. In the future, we can work around this by having better git worktree garbage collection, where remote machines remove git worktree's that were created by Zed and have no thread metadata on connection too. Finally, this PR gets archive threads working on remotes! #### Follow Ups 1. Replace instances of `std::fs` with Zed's Fs trait in the archive thread codepaths 2. Make archive thread work properly for workspace's that are not open (local and remote) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
eholk
added a commit
that referenced
this pull request
Apr 17, 2026
Cherry picks for today's preview release, bringing the v0.233.x branch up to date with fixes for archive threads on remotes and sidebar thread time ordering. ### Cherry-picked PRs Requested for this release: - #54074 — agent: Fix `find_or_create` repository to support remote - #54173 — sidebar: Fix sidebar thread times Pulled in as dependencies so the requested PRs apply cleanly (preferring to carry over additional changes rather than modify the cherry-picked patches): - #53991 — Only archive worktrees that Zed created - #54001 — agent: Support remote archive thread git operations - #54014 — Avoid showing draft threads in the sidebar or storing them in the database - #54088 — Use Fs abstraction for worktree directory removal ### Conflict resolution notes - **#54014** — The previous omnibus cherry-pick (#54111) pulled in later refactors that extracted `LIST_QUERY` to a `const` without including #54014's `WHERE session_id IS NOT NULL` filter or its draft-cleanup migration. I applied the filter to the existing `const LIST_QUERY` and kept the branch's `run_thread_metadata_migrations` helper in the affected test, rather than reverting to #54014's inline forms. - **#54173** — On v0.233.x, `sidebar_tests.rs` still contains `test_search_finds_threads_hidden_behind_view_more` (removed from main by #53956, which isn't on this branch). That test calls `save_thread_metadata`, so #54173's signature change — adding an `interacted_at: Option<DateTime<Utc>>` parameter — required a mechanical `None,` argument added to this one additional call site beyond what the cherry-pick touched. No changes were made to the substance of any cherry-picked patch. Release Notes: - N/A --------- Co-authored-by: Richard Feldman <richard@zed.dev> Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com> Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com> Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
G36maid
pushed a commit
to G36maid/zed
that referenced
this pull request
Apr 29, 2026
…4001) ### Summary This PR implements remote support for git store operations that the sidebar's archive thread checkpoint/restore featured relied on. This was the second to last blocker for remote usage of this feature. I also made a shared backend between `update_ref` and `delete_ref` called `edit_ref` because they run the same git command and this allowed for some code unification. #### Remote Git Operations - `Repository::update_ref` - `Repository::delete_ref` - `Repository::repair_worktrees` - `Repository::create_archive_checkpoint` - `Repository::restore_archive_checkpoint` #### Follow up `agent_ui::thread_worktree_archive::find_or_create_repository` needs to be made aware of the remote machine that the repository it's searching for is on. Once that is completed, we can get the correct repo when archiving a remote thread and the flow should work without any problems. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
kathbigra
pushed a commit
to kathbigra/zed
that referenced
this pull request
May 10, 2026
…4001) ### Summary This PR implements remote support for git store operations that the sidebar's archive thread checkpoint/restore featured relied on. This was the second to last blocker for remote usage of this feature. I also made a shared backend between `update_ref` and `delete_ref` called `edit_ref` because they run the same git command and this allowed for some code unification. #### Remote Git Operations - `Repository::update_ref` - `Repository::delete_ref` - `Repository::repair_worktrees` - `Repository::create_archive_checkpoint` - `Repository::restore_archive_checkpoint` #### Follow up `agent_ui::thread_worktree_archive::find_or_create_repository` needs to be made aware of the remote machine that the repository it's searching for is on. Once that is completed, we can get the correct repo when archiving a remote thread and the flow should work without any problems. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
kathbigra
pushed a commit
to kathbigra/zed
that referenced
this pull request
May 10, 2026
…s#54074) ### Summary Follow up to: zed-industries#54001 This PR makes `agent_ui::thread_worktree_archive::find_or_create_repository` whether or not the repository it's searching for is on a remote machine. In the case where it's on a remote machine that has an active connection in Zed's connection pool, we return the repository; otherwise, we error out. I implemented it this way so archiving a thread on a remote machine that isn't connected deletes the metadata without showing a remote connection modal to a user. In the future, we can work around this by having better git worktree garbage collection, where remote machines remove git worktree's that were created by Zed and have no thread metadata on connection too. Finally, this PR gets archive threads working on remotes! #### Follow Ups 1. Replace instances of `std::fs` with Zed's Fs trait in the archive thread codepaths 2. Make archive thread work properly for workspace's that are not open (local and remote) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
jasonsmithio
pushed a commit
to paddleboarddev/paddleboard
that referenced
this pull request
May 31, 2026
### Summary Follow up to: zed-industries/zed#54001 This PR makes `agent_ui::thread_worktree_archive::find_or_create_repository` whether or not the repository it's searching for is on a remote machine. In the case where it's on a remote machine that has an active connection in Zed's connection pool, we return the repository; otherwise, we error out. I implemented it this way so archiving a thread on a remote machine that isn't connected deletes the metadata without showing a remote connection modal to a user. In the future, we can work around this by having better git worktree garbage collection, where remote machines remove git worktree's that were created by Zed and have no thread metadata on connection too. Finally, this PR gets archive threads working on remotes! #### Follow Ups 1. Replace instances of `std::fs` with Zed's Fs trait in the archive thread codepaths 2. Make archive thread work properly for workspace's that are not open (local and remote) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Zenor27
pushed a commit
to Zenor27/zed
that referenced
this pull request
Jul 4, 2026
…4001) ### Summary This PR implements remote support for git store operations that the sidebar's archive thread checkpoint/restore featured relied on. This was the second to last blocker for remote usage of this feature. I also made a shared backend between `update_ref` and `delete_ref` called `edit_ref` because they run the same git command and this allowed for some code unification. #### Remote Git Operations - `Repository::update_ref` - `Repository::delete_ref` - `Repository::repair_worktrees` - `Repository::create_archive_checkpoint` - `Repository::restore_archive_checkpoint` #### Follow up `agent_ui::thread_worktree_archive::find_or_create_repository` needs to be made aware of the remote machine that the repository it's searching for is on. Once that is completed, we can get the correct repo when archiving a remote thread and the flow should work without any problems. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
Zenor27
pushed a commit
to Zenor27/zed
that referenced
this pull request
Jul 4, 2026
…s#54074) ### Summary Follow up to: zed-industries#54001 This PR makes `agent_ui::thread_worktree_archive::find_or_create_repository` whether or not the repository it's searching for is on a remote machine. In the case where it's on a remote machine that has an active connection in Zed's connection pool, we return the repository; otherwise, we error out. I implemented it this way so archiving a thread on a remote machine that isn't connected deletes the metadata without showing a remote connection modal to a user. In the future, we can work around this by having better git worktree garbage collection, where remote machines remove git worktree's that were created by Zed and have no thread metadata on connection too. Finally, this PR gets archive threads working on remotes! #### Follow Ups 1. Replace instances of `std::fs` with Zed's Fs trait in the archive thread codepaths 2. Make archive thread work properly for workspace's that are not open (local and remote) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…4001) ### Summary This PR implements remote support for git store operations that the sidebar's archive thread checkpoint/restore featured relied on. This was the second to last blocker for remote usage of this feature. I also made a shared backend between `update_ref` and `delete_ref` called `edit_ref` because they run the same git command and this allowed for some code unification. #### Remote Git Operations - `Repository::update_ref` - `Repository::delete_ref` - `Repository::repair_worktrees` - `Repository::create_archive_checkpoint` - `Repository::restore_archive_checkpoint` #### Follow up `agent_ui::thread_worktree_archive::find_or_create_repository` needs to be made aware of the remote machine that the repository it's searching for is on. Once that is completed, we can get the correct repo when archiving a remote thread and the flow should work without any problems. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…s#54074) ### Summary Follow up to: zed-industries#54001 This PR makes `agent_ui::thread_worktree_archive::find_or_create_repository` whether or not the repository it's searching for is on a remote machine. In the case where it's on a remote machine that has an active connection in Zed's connection pool, we return the repository; otherwise, we error out. I implemented it this way so archiving a thread on a remote machine that isn't connected deletes the metadata without showing a remote connection modal to a user. In the future, we can work around this by having better git worktree garbage collection, where remote machines remove git worktree's that were created by Zed and have no thread metadata on connection too. Finally, this PR gets archive threads working on remotes! #### Follow Ups 1. Replace instances of `std::fs` with Zed's Fs trait in the archive thread codepaths 2. Make archive thread work properly for workspace's that are not open (local and remote) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…4001) ### Summary This PR implements remote support for git store operations that the sidebar's archive thread checkpoint/restore featured relied on. This was the second to last blocker for remote usage of this feature. I also made a shared backend between `update_ref` and `delete_ref` called `edit_ref` because they run the same git command and this allowed for some code unification. #### Remote Git Operations - `Repository::update_ref` - `Repository::delete_ref` - `Repository::repair_worktrees` - `Repository::create_archive_checkpoint` - `Repository::restore_archive_checkpoint` #### Follow up `agent_ui::thread_worktree_archive::find_or_create_repository` needs to be made aware of the remote machine that the repository it's searching for is on. Once that is completed, we can get the correct repo when archiving a remote thread and the flow should work without any problems. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
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.
Summary
This PR implements remote support for git store operations that the sidebar's archive thread checkpoint/restore featured relied on. This was the second to last blocker for remote usage of this feature.
I also made a shared backend between
update_refanddelete_refcallededit_refbecause they run the same git command and this allowed for some code unification.Remote Git Operations
Repository::update_refRepository::delete_refRepository::repair_worktreesRepository::create_archive_checkpointRepository::restore_archive_checkpointFollow up
agent_ui::thread_worktree_archive::find_or_create_repositoryneeds to be made aware of the remote machine that the repository it's searching for is on. Once that is completed, we can get the correct repo when archiving a remote thread and the flow should work without any problems.Self-Review Checklist:
Release Notes: