Commit graph

2201 commits

Author SHA1 Message Date
Marshall Bowers
b138243438
collab: Remove unused fields from database user model (#56898)
This PR removes some more unused fields from the database user model:

- `github_user_created_at`
- `email_address`
- `name`
- `created_at`

These fields were not being used anywhere, and are nullable/defaulted in
the database in tests.

Release Notes:

- N/A
2026-05-15 17:01:42 +00:00
Marshall Bowers
f1a7567791
collab: Remove seeding infrastructure (#56562)
This PR removes the seeding infrastructure from Collab.

We're already set up to just-in-time create users in local development
through Cloud.

Also updated the liveness probe for the health endpoint to use a
different query.

Closes CLO-763.

Release Notes:

- N/A
2026-05-13 15:44:55 +00:00
Marshall Bowers
bb18442e2b
collab: Remove database access in Authorization header verification (#56558)
This PR removes the database access in the `Authorization` header
verification in Collab.

We already have the user returned from the call to Cloud, but were just
fetching the user from the database to get some additional fields.

We're now returning the additional fields we need from Cloud, so we can
just convert the user from the internal API response into a `User`
entity.

Closes CLO-762.

Release Notes:

- N/A
2026-05-13 15:17:42 +00:00
Anthony Eid
592727b892
collab: Add request stream support (#56455)
Adds streaming RPC forwarding to collab so guests can call
`GetInitialGraphData` and `SearchCommits` against a remote host project.
Previously these requests had no forwarder registered on the server and
would fail when invoked by a guest.

This mirrors the existing single-response forwarding pattern with new
analogues:
- `StreamResponse<R>` + `MessageContext::forward_request_stream`
- `Server::add_request_stream_handler`
- `forward_read_only_project_stream_request`, registered for both
messages

Also hardens both the unary and stream handlers to send
`respond_with_error` when a handler returns `Ok` without sending/ending
a response, so the client doesn't hang waiting for a reply that will
never arrive.

I added git graph collab integration tests for this as well. 


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 #55954

Release Notes:

- N/A
2026-05-12 17:43:06 +00:00
Marshall Bowers
6e8eaab25b
collab: Remove unused From impl for User model to proto::User (#56548)
This PR removes a `From` impl from the database `User` model to
`proto::User`, as it is no longer used.

Release Notes:

- N/A
2026-05-12 16:21:58 +00:00
Marshall Bowers
6f1409b31c
collab: Replace TransitionalUserService with CloudUserService (#56538)
This PR replaces the `TransitionalUserService` with the
`CloudUserService`, as all of the calls are now all going through Cloud.

This allows us to delete the `TransitionalUserService`, the
`DatabaseUserService`, as well as the backing database queries that are
no longer used.

Closes CLO-758.

Release Notes:

- N/A
2026-05-12 14:32:14 +00:00
Marshall Bowers
b13cb40b97
collab: Route search_channel_members through Cloud (#56465)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
This PR makes it so we route the `UserService::search_channel_members`
call through Cloud instead of hitting the database.

This is the last of the calls to be routed through Cloud. We'll clean up
the old database-backed implementations in a follow-up PR.

Closes CLO-746.

Release Notes:

- N/A
2026-05-12 13:05:19 +00:00
Marshall Bowers
7472c29de0
collab: Route fuzzy_search_users through Cloud (#56436)
This PR makes it so we route the `UserService::fuzzy_search_users` call
through Cloud instead of hitting the database.

Closes CLO-745.

Release Notes:

- N/A
2026-05-11 17:29:35 +00:00
Marshall Bowers
6b7d20efdb
collab: Route UserService::get_user_by_github_login through Cloud (#56190)
This PR makes it so we route the `UserService::get_user_by_github_login`
call through Cloud instead of hitting the database.

Closes CLO-743.

Release Notes:

- N/A
2026-05-08 16:21:09 +00:00
Marshall Bowers
4b23564f36
collab: Route get_users_by_ids through Cloud (#56105)
This PR makes it so we route the `UserService::get_users_by_ids` call
through Cloud instead of hitting the database.

We've introduced a new `CloudUserService` that will fetch the users from
Cloud using the internal API. Note that we've only implemented the
`get_users_by_ids` method on this service, as the endpoints for the
other methods don't yet exist.

We have also introduced a `TransitionalUserService` for the purposes of
gradually transitioning these calls over to Cloud. Right now it uses the
`CloudUserService` for the `get_users_by_ids` implementation, but then
uses the `DatabaseUserService` for the other methods.

Closes CLO-740.

Release Notes:

- N/A
2026-05-08 13:34:46 +00:00
Marshall Bowers
367db0706b
collab: Remove unused api_token field from Config (#56098)
This PR removes the `api_token` field from Collab's `Config`, as it is
no longer used.

Release Notes:

- N/A
2026-05-08 12:28:22 +00:00
Marshall Bowers
dacf984596
collab: Introduce UserService (#55449)
This PR introduces a `UserService` trait to Collab.

This is a step towards moving Collab away from reading user information
directly from the database.

We currently have two implementations for the trait:

- The `DatabaseUserService`, which leverages the existing query methods
to talk to the database
- The `FakeUserService`, which will be used in tests

Once we're ready, we'll be able to replace the `DatabaseUserService`
with a `CloudUserService` to fetch the users from Cloud.

Release Notes:

- N/A
2026-05-06 18:15:36 +00:00
Marshall Bowers
5894f5d2e1
collab: Stop mixing concerns in get_channel_participant_details (#55568)
This PR updates the `get_channel_participant_details` method to reduce
the mixing of concerns within the method.

The authorization check for the caller has been moved to the outside,
along with the conversions from the database representations to the RPC
proto representations.

Now the method is just responsible for dealing with the data fetching,
which will make it easier to swap out.

Release Notes:

- N/A
2026-05-04 11:51:56 +00:00
Marshall Bowers
c5599efaaa
collab: Remove stray dev_servers.rs module (#55566)
This PR removes a stray, empty `dev_servers.rs` module from the `collab`
crate.

Release Notes:

- N/A
2026-05-03 16:45:40 +00:00
Marshall Bowers
262026fb6a
collab: Simplify contributor setup in test_channel_requires_zed_cla (#55558)
This PR updates the `test_channel_requires_zed_cla` test to simplify the
setup for denoting that a user has signed the CLA.

Since the user already exists in the database, we can just create the
corresponding record without needing to worry about upserting.

Release Notes:

- N/A
2026-05-03 15:33:50 +00:00
Marshall Bowers
90b3ef0c65
collab: Decouple session principal from User database model (#55440)
This PR decouples the session principal in Collab from the `User`
database model.

We have introduced a new `User` domain entity that we use for the
principal. Currently we just construct it from the database model, but
this separation will make it easier to remove reliance on reading the
database directly soon.

Release Notes:

- N/A
2026-05-01 17:28:57 +00:00
Max Brunsfeld
caccc65b1e
Improve bare repo support (#55153)
Fixes https://github.com/zed-industries/zed/issues/54830

This fixes a bugs where
* when there's no main worktree, we treated the first linked worktree as
main
* the titlebar and sidebar showed two different things when opening a
linked wortree directly

When there's no main worktree, our "project group key" will be the bare
repo path. For displaying this to the user, we try to present something
meaningful:
* If the bare repo is `foo.git`, we'll say "foo"
* If the bare repo is "bar/.bare", we'll "bar"

Release Notes:

- Fixed bugs in Zed's sidebar and titlebar when editing in git worktrees
created from bare repositories.
2026-04-29 13:16:37 +00:00
Conrad Irwin
1abbaf9c43
Fix version check (#55032)
Release Notes:

- N/A
2026-04-28 22:12:38 +00:00
Anthony Eid
58c4dda8b9
git: Fix remote branch picker not showing branches (#54575)
This sends `branch_list` in live `UpdateRepository` messages so
downstream repository snapshots stay in sync and the remote branch
picker can populate correctly. Collab DB replay for join/reconnect will
follow in a separate change.

This fixes a bug where the branch picker wouldn't show any branches in
remote environments

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 #54530

Release Notes:

- git: Fix remote branch picker not showing any branches
2026-04-22 20:26:43 -04:00
Anthony Eid
72d004c8e8
git_graph: Add remote support for commit data handler (#54468)
### Motivation

To support remote Git graph usage, we need remote support for the Git
APIs that the graph depends on. This PR adds remote support for
`CommitDataHandler` (the `git cat-file --batch` process manager),
allowing remote Git graph consumers to fetch visible commit data without
polling.

#### Summary

The Git graph separates the UI and data layers so the UI can continue
rendering while commit data is fetched in the background. This change
extends that model to remote repositories by allowing
`GitStore::fetch_commit_data(sha: Oid, await_result: bool, cx: &mut
Context) -> &CommitDataState` to await remote commit loading.

For simplicity, the `Starting` variant was removed from
`CommitDataState`. `CommitDataState::Loading(Option<...>)` now stores
`Some(...)` when `await_result == true` is passed to
`fetch_commit_data`. This allows the data layer to await commit loading
without polling, and only when explicitly requested.

I also removed the `Graph` prefix from `CommitData`-related types
because this API is general-purpose and not limited to the graph. Longer
term, I hope to replace `Repository::show` with the commit data
functionality, since it already provides built-in caching.

#### Bug Fixes

- Fix stale `Loading(...)` entries that survive enqueue failure or
handler shutdown.
- Fix commit data handler bookkeeping so `pending_requests`,
`completion_senders`, and `CommitDataState` remain consistent.
- Fix remote commit-data loading so the data layer can await results
instead of polling.

#### Testing

- Add property tests for commit data fetching.
- Add a collab integration test that verifies batched remote commit-data
fetching.

#### Follow Up

In a follow-up, I want to replace the `Repository::show` backend with
the commit data handler and remove `CommitDetails` from the codebase as
a cleanup and maintenance pass. The commit data handler already provides
caching and is a better long-term path for commit metadata access.

I may also want to allow the `CommitData` type to propagate errors to
callers.

For the Git graph, the remaining work is remote search and initial data
fetching.

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: Remco Smits <djsmits12@gmail.com>
2026-04-22 16:11:51 -04:00
Marco Groot
68341e72b6
Clarify error message when attempting to delete channel with active participants (#54146)
Previous error message when trying to delete channel with active
participants in call:
<img width="2880" height="1800" alt="image"
src="https://github.com/user-attachments/assets/b11a0d75-438d-468f-8fe4-e0c249dd096c"
/>

After change (tested locally)

<img width="474" height="304" alt="image"
src="https://github.com/user-attachments/assets/1e887411-a851-4dc8-83dc-881f690c0ad9"
/>



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
https://github.com/zed-industries/zed/issues/53572

Release Notes:

- N/A or Added/Fixed/Improved ...
Added a clear error message upon trying to delete channel with active
participants
2026-04-21 01:14:06 -07:00
Anthony Eid
d60b55675b
agent: Support remote archive thread git operations (#54001)
### 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
2026-04-15 19:55:37 +00:00
Eric Holk
d812adc833
sidebar: Better handling for threads in remote workspaces (#53451)
This PR greatly improves our handling of remote threads in the sidebar.

One primary issue was that many parts of the sidebar were only looking
at a thread's path list and not its remote connection information. The
fix here is to use `ProjectGroupKey` more consistently throughout the
sidebar which also includes remote connection information.

The second major change is to extend the MultiWorkspace with the ability
to initiate the creation of remote workspaces when needed. This involved
refactoring a lot of our remote workspace creation paths to share a
single code path for better consistency.

Release Notes:

- (Preview only) Fixed remote project threads appearing as a separate
local project in the sidebar

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-04-09 06:56:28 +00:00
Richard Feldman
fb2bff879c
Add allow_empty commits, detached worktree creation, and new git operations (#53213)
Extend the git API with several new capabilities needed for worktree
archival and restoration:

- Add `allow_empty` flag to `CommitOptions` for creating WIP marker
commits
- Change `create_worktree` to accept `Option<String>` branch, enabling
detached worktree creation when `None` is passed
- Add `head_sha()` to read the current HEAD commit hash
- Add `update_ref()` and `delete_ref()` for managing git references
- Add `stage_all_including_untracked()` to stage everything before a WIP
commit
- Implement all new operations in `FakeGitRepository` with functional
commit history tracking, reset support, and ref management
- Update existing call sites for the new `CommitOptions` field and
`create_worktree` signature

Part 1 of 3 in the persist-worktree stack. These are nonbreaking API
additions with no behavioral changes to existing code.

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-04-06 21:31:59 +00:00
Max Brunsfeld
20f7308677
Maintain root repo common dir path as a field on Worktree (#53023)
This enables us to always different git worktrees of the same repo
together.

Depends on https://github.com/zed-industries/cloud/pull/2220

Release Notes:

- N/A

---------

Co-authored-by: Eric Holk <eric@zed.dev>
2026-04-03 04:16:35 +00:00
Cole Miller
2a15bf630d
Require multibuffer excerpts to be ordered and nonoverlapping (#52364)
TODO:
- [x] merge main
- [x] nonshrinking `set_excerpts_for_path`
- [x] Test-drive potential problem areas in the app
- [x] prepare cloud side
- [x] test collaboration
- [ ] docstrings
- [ ] ???

## Context

### Background

Currently, a multibuffer consists of an arbitrary list of
anchor-delimited excerpts from individual buffers. Excerpt ranges for a
fixed buffer are permitted to overlap, and can appear in any order in
the multibuffer, possibly separated by excerpts from other buffers.
However, in practice all code that constructs multibuffers does so using
the APIs defined in the `path_key` submodule of the `multi_buffer` crate
(`set_excerpts_for_path` etc.) If you only use these APIs, the resulting
multibuffer will maintain the following invariants:

- All excerpts for the same buffer appear contiguously in the
multibuffer
- Excerpts for the same buffer cannot overlap
- Excerpts for the same buffer appear in order
- The placement of the excerpts for a specific buffer in the multibuffer
are determined by the `PathKey` passed to `set_excerpts_for_path`. There
is exactly one `PathKey` per buffer in the multibuffer

### Purpose of this PR

This PR changes the multibuffer so that the invariants maintained by the
`path_key` APIs *always* hold. It's no longer possible to construct a
multibuffer with overlapping excerpts, etc. The APIs that permitted
this, like `insert_excerpts_with_ids_after`, have been removed in favor
of the `path_key` suite.

The main upshot of this is that given a `text::Anchor` and a
multibuffer, it's possible to efficiently figure out the unique excerpt
that includes that anchor, if any:

```
impl MultiBufferSnapshot {
    fn buffer_anchor_to_anchor(&self, anchor: text::Anchor) -> Option<multi_buffer::Anchor>;
}
```

And in the other direction, given a `multi_buffer::Anchor`, we can look
at its `text::Anchor` to locate the excerpt that contains it. That means
we don't need an `ExcerptId` to create or resolve
`multi_buffer::Anchor`, and in fact we can delete `ExcerptId` entirely,
so that excerpts no longer have any identity outside their
`Range<text::Anchor>`.

There are a large number of changes to `editor` and other downstream
crates as a result of removing `ExcerptId` and multibuffer APIs that
assumed it.

### Other changes

There are some other improvements that are not immediate consequences of
that big change, but helped make it smoother. Notably:

- The `buffer_id` field of `text::Anchor` is no longer optional.
`text::Anchor::{MIN, MAX}` have been removed in favor of
`min_for_buffer`, etc.
- `multi_buffer::Anchor` is now a three-variant enum (inlined slightly):

```
enum Anchor {
    Min,
    Excerpt {
        text_anchor: text::Anchor,
        path_key_index: PathKeyIndex,
        diff_base_anchor: Option<text::Anchor>,
    },
    Max,
}
```

That means it's no longer possible to unconditionally access the
`text_anchor` field, which is good because most of the places that were
doing that were buggy for min/max! Instead, we have a new API that
correctly resolves min/max to the start of the first excerpt or the end
of the last excerpt:


```
impl MultiBufferSnapshot {
    fn anchor_to_buffer_anchor(&self, anchor: multi_buffer::Anchor) -> Option<text::Anchor>;
}
```
- `MultiBufferExcerpt` has been removed in favor of a new
`map_excerpt_ranges` API directly on `MultiBufferSnapshot`.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Conrad <conrad@zed.dev>
2026-04-01 17:25:32 +00:00
Ben Brandt
76c6004b27
Remove text thread and slash command crates (#52757)
🫡

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:

- Removed legacy Text Threads feature to help streamline the new agentic
workflows in Zed. Thanks to all of you who were enthusiastic Text Thread
users over the years ❤️!

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-31 17:55:05 +02:00
Mikayla Maki
17adc40d61
Implement sidebar rendering of the configured worktrees (#51342)
Implements worktree support for the agent panel sidebar

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-03-12 17:53:38 +00:00
Anthony Eid
d18e4a75bc
git: Add SSH support for removing and renaming git worktrees (#50759)
This should be the last step in implementing full git worktree support
in the `GitStore`. We still need to add UI for that allows a user to
rename a git worktree and, by extension git branches if we use the git
picker to do so.

Also, I added a helper function called `disallow_guest_request::<T>` to
the `Collab::rpc` that is used to specify a proto request isn't allowed
to be sent by a guest. This enabled me to add a regression test that
checks that a guest isn't allowed to delete a git worktree, without the
test hanging forever because it's waiting for the proto server to
respond.

Since SSH connections send the proto message directly from client to
remote host, this won't affect those requests.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- git: Add SSH support for removing git worktrees
2026-03-10 14:57:06 +00:00
Anthony Eid
5c91ebf1fe
git: Move diff num stat calculation to repository snapshot layer (#50645)
Follow up on: https://github.com/zed-industries/zed/pull/49519

This PR reworks how Zed calculates diff num stats by moving the
calculation to the `RepositorySnapshot` layer, instead of the
`GitPanel`. This has a couple of benefits:

1. Snapshot recalculations are already set up to recompute on file
system changes and only update the affected files. This means that diff
stats don't need to manage their own subscription or states anymore like
they did in the original PR.
2. We're able to further separate the data layer from the UI. Before,
the git panel owned all the subscriptions and tasks that refreshed the
diff stat, now the repository does, which is more inline with the code
base.
3. Integration tests are cleaner because `FakeRepository` can handle all
the data and calculations of diff stat and make it accessible to more
tests in the codebase. Because a lot of tests wouldn't initialize the
git panel when they used the git repository.
4. This made implementing remote/collab support for this feature
streamline. Remote clients wouldn't get the same buffer events as local
clients, so they wouldn't know that the diff stat state has been updated
and invalidate their data.
5. File system changes that happened outside of Zed now trigger the diff
stat refresh because we're using the `RepositorySnapshot`.

I added some integration tests as well to make sure collab support is
working this time. Finally, adding the initial diff calculation to
`compute_snapshot` didn't affect performance for me when checking
against chromium's diff with HEAD~1000. So this should be a safe change
to make.

I decided to add diff stats on the status entry struct because it made
updating changed paths and the collab database much simpler than having
two separate SumTrees. Also whenever the UI got a file's status it would
check its diff stat as well, so this change makes that code more
streamlined as well.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing.
- [x] Done a self-review taking into account security and performance
aspects.

Release Notes:

- N/A
2026-03-04 18:54:23 +00:00
Anthony Eid
0a1a92131f
git: Fix remote worktree support (#50614)
The main issue is that we weren't forwarding the proto messages through
the collab server to the host. After fixing that I added integration
tests to cover local worktrees, remote worktrees, and ssh worktrees.

I also fixed a bug with FakeRepository where it wouldn't name its
current branch as a worktree when calling git worktree, which doesn't
match the behavior of the git binary.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects

Release Notes:

- git: Fix bug that caused the git worktree picker from displaying and
creating worktrees over collab
2026-03-03 19:01:28 +01:00
Richard Feldman
7c9a9d40c0
Add "Start Thread in New Worktree" (#49141)
Add the thread target selector in the agent panel behind the
`agent-git-worktrees` flag:

<img width="590" height="121" alt="Screenshot 2026-03-02 at 11 50 47 PM"
src="https://github.com/user-attachments/assets/17ee3303-7e01-4e40-bb84-1e7e748a3196"
/>

- Add a "Start Thread In..." dropdown to the agent panel toolbar, gated
behind `AgentV2FeatureFlag`
- Options: "Local Project" (default) and "New Worktree"
- The "New Worktree" option is disabled when there's no git repository
or in collab mode

Closes AI-34

Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: morgankrey <morgan@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: MostlyK <135974627+MostlyKIGuess@users.noreply.github.com>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: John Tur <john-tur@outlook.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Wuji Chen <chenwuji2000@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Kasper Nyhus <kanyhus@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Josh Robson Chase <josh@robsonchase.com>
Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com>
Co-authored-by: ozacod <ozacod@users.noreply.github.com>
Co-authored-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Lena <241371603+zelenenka@users.noreply.github.com>
Co-authored-by: 0x2CA <2478557459@qq.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Albab Hasan <155961300+Albab-Hasan@users.noreply.github.com>
Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
Co-authored-by: Nikhil Pandey <nikhil@nikhil.com.np>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: dancer <144584931+dancer@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-03-03 15:25:36 +00:00
Marshall Bowers
4491c2cac8
collab: Remove unused AccessToken model (#49542)
This PR removes the `AccessToken` database model and its related
queries, as they are no longer used.

Closes CLO-306.

Release Notes:

- N/A
2026-02-18 23:47:11 +00:00
Marshall Bowers
f07cec59de
collab: Validate access tokens through Cloud (#49535)
This PR updates Collab to make it validate access tokens through Cloud
instead of doing it in-house.

We're reusing the `GET /client/users/me` endpoint—which is what we also
call on the client—to validate the user's access token.

We only need to do this when establishing a WebSocket connection, so the
increased latency of a network hop shouldn't be a problem.

Closes CLO-308.

Release Notes:

- N/A
2026-02-18 18:20:52 -05:00
Marshall Bowers
6b553e4d27
collab: Remove leftover impersonation code (#49314)
This PR removes some code left over from how we used to do impersonation
for local development.

The local development impersonation path is separate now, so we don't
need all of this plumbing in Collab.

Release Notes:

- N/A
2026-02-17 00:27:04 +00:00
Marshall Bowers
e269569241
collab: Remove GET /rpc_server_snapshot endpoint (#49312)
This PR removes the `GET /rpc_server_snapshot` endpoint from Collab, as
it is not being used (and also didn't seem to be functional).

Release Notes:

- N/A
2026-02-17 00:00:28 +00:00
Marshall Bowers
2839506516
collab: Remove POST /users/:id/access_tokens endpoint (#49297)
This PR removes the `POST /users/:id/access_tokens` endpoint from
Collab, as it is no longer used.

Closes CLO-290.

Release Notes:

- N/A
2026-02-16 18:21:31 -05:00
Marshall Bowers
f81dfca30a
collab: Remove unused Config fields (#48836)
This PR removes the unused fields from the `Config` struct in Collab.

Release Notes:

- N/A
2026-02-10 01:21:51 +00:00
Marshall Bowers
0821d6fb73
collab: Remove GET /extensions endpoint (#48827)
This PR removes the `GET /extensions` endpoint from Collab, as it has
been moved to Cloud.

In #48717 we changed it to just proxy to Cloud, but we didn't end up
needing that.

Release Notes:

- N/A
2026-02-09 23:06:11 +00:00
Marshall Bowers
aa11edf99d
collab: Proxy GET /extensions to Cloud (#48717)
This PR updates the `GET /extensions` endpoint in Collab to proxy to
Cloud.

Release Notes:

- N/A
2026-02-08 05:05:34 +00:00
Marshall Bowers
5ed13a0293
Move extension API DTOs into cloud_api_types (#48689)
This PR moves the DTOs for the extension API from the `rpc` crate into
the `cloud_api_types` crate.

Release Notes:

- N/A
2026-02-07 17:54:29 +00:00
Lukas Wirth
5d2feaa144
editor: Implement semantic highlighting (#46356)
Part of #7450

Big thanks to @macmv for pushing this forwards so much!

Rebased version of https://github.com/zed-industries/zed/pull/39539 as
working on an in-org branch simplifies a lot of things for us)

Release Notes:

- Added LSP semantic tokens highlighting support

---------

Co-authored-by: Neil Macneale V <neil.macneale.v@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-04 17:37:13 +00:00
Leo
92ad7c3000
project_panel: Add right-click download option for folders/files stored in remote development server (#47344)
Closes #24431 , closes #42501


https://github.com/user-attachments/assets/13ace1d7-7699-4f2b-aa97-86235008adb3

Release Notes:

- Added right click download option for folders/files stored in remote
development server
2026-02-03 07:12:29 +00:00
Diego Perez
cfbf6ebe96
nix: Use flake-parts, partitions, and treefmt-nix (#45321)
Release Notes:

Refactored:
- Use [flake-parts](https://flake.parts/index.html) modules
- `nix/shell.nix` -> `nix/modules/devshells.nix`

Added:
- Use
[flake-parts.partitions](https://flake.parts/options/flake-parts-partitions.html)
to isolate dev dependencies so that flakes that use `zed-editor` don't
fetch dev-only inputs such as `treefmt-nix`
- [treefmt-nix](https://github.com/numtide/treefmt-nix)
  - nixfmt
  - rustfmt

Fixed:
- `shell.nix` and `default.nix` fetching `flake-compat` from
`flake.lock` which added an extra and unnecessary input/dependency to
`flake.nix`. Fixed by setting a fixed rev and sha256 instead.
- `nixfmt-rfc-style` is deprecated and is now `nixfmt`
- Fixes #45338 by using rust-overlay toolchain directly
  - Previously, the devShell included `rustup` which caused slow startup
times as Nix would build rustup from source (including running its test
suite). Additionally, rust tooling (cargo, rustfmt, clippy,
rust-analyzer) wasn't available in the dev shell.
- cargo, rustc, and rust-toolchain.toml components included in
`rustToolchain`

Chore:
- Update `flake.lock`
- Format Rust code with `rustfmt` via `treefmt-nix`

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2026-02-02 14:26:42 +00:00
Conrad Irwin
e868446ea2
Reapply "Try namespace mac runners (#47675)" (#47721) (#47727)
This reverts commit c50120199f.

Closes #ISSUE

Release Notes:

- N/A
2026-01-26 22:02:52 -07:00
Conrad Irwin
c50120199f
Revert "Try namespace mac runners (#47675)" (#47721)
This broke the libgit2 bundling silently

Release Notes:

- N/A
2026-01-27 02:59:52 +00:00
Conrad Irwin
2b45efc1ea
Try namespace mac runners (#47675)
Closes #ISSUE

Release Notes:

- N/A
2026-01-26 21:39:40 +00:00
Piotr Osiewicz
b74b1977d4
collab: Extract tests into integration tests crate (#47668)
Reduces time needed to build collab tests from 48s to 38s.

Release Notes:

- N/A
2026-01-26 20:28:09 +01:00
Conrad Irwin
38821a66a7
Reduce intensity of refreshing pull diagnostics (#47510)
Before this change we'd spawn N tasks in parallel on every keystroke,
afterwards
we only allow 1 background diagnostic refresh in flight at a time.

This also fixed a bug where we'd send O(n*2) pull diagnostic requests
when
re-opening a workspace with n editors.

Co-authored-by: John Tur <john-tur@outlook.com>

Closes #ISSUE

Release Notes:

- Improved performance when a large number of files were open by making
background diagnostics more efficient

---------

Co-authored-by: John Tur <john-tur@outlook.com>
2026-01-23 21:08:56 +00:00
Piotr Osiewicz
c9997592e4
build: Simplify build graph (#47253)
- **title_bar: Extract platform_title_bar from title_bar**
- **file_finder no longer depends on search and agent_servers no longer
depend on language_models**

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-01-23 18:29:20 +01:00