# agent: When opening a remote thread check that the linked worktree path exists \(\#54353\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4b488190728c7ff08b22bc4b331070dc0459b1ea)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4b488190728c7ff08b22bc4b331070dc0459b1ea

Requested commit: 4b488190728c7ff08b22bc4b331070dc0459b1ea

Commit: 4b488190728c7ff08b22bc4b331070dc0459b1ea

Tree: eddf27676baf00b5f9265cd166c266de38db690c

Author: Anthony Eid

Committer: GitHub

## Message

```
agent: When opening a remote thread check that the linked worktree path exists (#54353)

If the path doesn't exist we fallback to the main worktree path. This
handles the edge case where a git linked worktree is deleted on a remote
machine, and a user tries to open a thread based on that.

We fallback to the main git worktree in this case, if that doesn't exist
the project will open in an error state (empty workspace) like we
already do

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

Closes #ISSUE

Release Notes:

- N/A
```

## Parents

- [66a77d29fd4ede98f224c1a6b6cc5bc27d237366](https://git.cafe/gitcafe/zed/commit/66a77d29fd4ede98f224c1a6b6cc5bc27d237366?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4b488190728c7ff08b22bc4b331070dc0459b1ea?format=markdown)
