Commit Graph
38185 Commits
Author SHA1 Message Date
Dino 92c03633c7 fs: Avoid resolving symlinks when trashing (#58339)
Use `std::path::absolute` instead of `RealFs::canonicalize` to make the
path absolute in `RealFs::trash` as `canonicalize` also resolves
symlinks, so trashing a symlink moved its target to the trash and left
the link dangling.

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
- Not applicable as we don't have a good infrastructure for testing
`RealFs` changes without hitting the machine's actual filesystem and
testing this on `FakeFs` implementation wouldn't prevent a future
regression, unfortunately.
- [x] Performance impact has been considered and is acceptable

Closes #54900 

Release Notes:

- Fixed trashing of symlinks in project panel to actually trash the link
and not its target.
2026-06-02 16:40:34 +00:00
Yara 🏳️‍⚧️ e714e7f97d Remove audio denoiser crate (#57923)
Why: denoise was used on the "new" removed audio pipeline. While we will
(hopefully) reintroduce that later it is currently dead code! Worse dead
code causing issues as the denoise crate breaks compilation on old arm
targets.

denoise (through candle-core) eventually depends on gemm which does not
compile on older arm targets. This is a known issue in gemm (see
sarah-quinones/gemm#31).

Hopefully this will be addressed in gemm before we re-land denoise/new
audio. If it is not we can always compile denoise only for supported
platforms.

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

Release Notes:

- Fixed Zed not compiling on pre ARMv8.2-A machines
2026-06-02 15:49:57 +00:00
Ben Brandt 71f975e514 acp: Update agent-client-protocol sdk to 0.13.1 (#58308)
Brings stable logout and additional directories support as well as
removing dep on rmcp + tokio

This also removed the unstable model selector (replaced awhile ago by
session config options) so it removes all of that code.

Native agent still uses it because we have a special model selector that
would need more work to rip out

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-06-02 15:30:37 +00:00
e25ce9e8a0 agent: Implement compaction (experimental) (#58315)
Release Notes:

- N/A

---------

Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2026-06-02 15:11:58 +00:00
Cameron Mcloughlin 1afd037638 mermaid_render: Remove spurious debug assert (#58341)
This debug assert was actually invalid, and panicked in debug builds on
valid diagrams. We start building a node only when we find a
`translate()` that we need to fix up, but unconditionally call
`finish_node`. But since `finish_node` does `if let Some(...) =
self.building.take()`, it's a no-op if there is no node being built, so
it's safe to call.

Renamed to `maybe_finish_node` to communicate this fact

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-02 14:57:44 +00:00
Smit Barmase 784e3d0b2c language_models: Remove retired GPT-5.2 and GPT-5.3-Codex from ChatGPT Subscription (#58340)
Closes #58305

OpenAI sunset GPT-5.2 and GPT-5.3-Codex in Codex for ChatGPT account
logins on June 2nd, so sending to them via the ChatGPT Subscription
provider now fails with error. This PR removes those models from ChatGPT
Subscription model list.

Release Notes:

- Removed the retired GPT-5.2 and GPT-5.3 Codex models from the ChatGPT
Subscription provider.
2026-06-02 14:44:02 +00:00
Smit Barmase 6fdd0daaa2 language: Support emitting multiple runnables from a single tree-sitter match (#57276)
Sets up infra for fixing #46881. Follow-up to the approach discussed in
#36802 (comment).

The initial problem: Go table tests weren't being detected reliably in
larger files. The old approach created one tree-sitter match per table
row, which hit the cursor match limit (64) and caused rows to be
silently dropped.

The suggested fix was to use query repetition to capture all rows in a
single match, then post-process in Rust.

But this hit another problem: some captured rows aren't valid runnables
(e.g., when a struct has multiple string fields and the query can't tell
which one is the test name). Tree-sitter predicates can't validate
subsets of captures within a match, that logic needs to happen in Rust.

This PR adds a `RunnableResolver` trait that lets languages post-process
multi-capture matches. When a query uses `@_run_item` to mark item
boundaries, we split the captures into per-item groups and pass them to
the resolver. The resolver can then:

- Pick which `@run` to use: e.g., compare field names against
`t.Run(tc.name, ...)` to find the right string field.
- Return per-item extras: only the captures that correspond to the
chosen `@run`.

Release Notes:

- N/A
2026-06-02 13:59:39 +00:00
saberoueslati a3452707a6 file_finder: Fix path duplication when opening non-project files with a filter (#54944)
## Context

When a file is opened outside any project, Zed creates a single-file
worktree for it where the file's relative path is `""` (the worktree
root IS the file). Typing to filter in the file picker (Ctrl-P) caused a
crash: `Error: opening project path
"/home/user/foo.txt/foo.txt"`.

Two bugs combined to produce this:

1. **History lookup mismatch** : `fuzzy_nucleo` detects `root_is_file =
true` for single-file worktrees and moves the worktree root name into
`path_match.path` (so `"" → "foo.txt"`). `matching_history_items` stored
the entry under key `""`but looked it up by `"foo.txt"` → miss → item
dropped from history matches.

2. **Search confirm duplication** : because the history match was
dropped, the file appeared as `Match::Search` with `path_match.path =
"foo.txt"`. Confirming the constructed `ProjectPath { path: "foo.txt" }`
inside a worktree rooted at `/home/user/foo.txt` → resolved to
`/home/user/foo.txt/foo.txt`.

Fix 1 adds a fallback empty-path lookup in `matching_history_items` so
single-file worktree entries are found correctly and deduplication
suppresses the search duplicate. Fix 2 is defense-in-depth: if a
single-file worktree file ever reaches
the `Match::Search` confirm handler, it detects `is_single_file()` and
uses an empty path instead.

**Edit :**

After further work, two additional edge cases were fixed:

- `Match::Search` split-open handling now uses the same single-file
worktree path normalization as normal confirm. This prevents
split-opening a single-file worktree search result from resolving
`notes.txt` inside `/path/to/notes.txt` as
`/path/to/notes.txt/notes.txt`.

- History matching now still includes root names for single-file
worktrees when `project_panel.hide_root = true`. Normal folder worktree
roots remain hidden in this mode, but single-file worktrees need their
root name included because the root name is the filename users type into
the picker.

Additional test coverage:

- Added `test_non_project_file_matches_history_with_hidden_root` for the
`hide_root=true` history matching edge case.
- Added `test_single_file_search_result_split_open` for split-opening a
single-file worktree search result.

Closes #54934

Manual test after fix below :

[Screencast from 2026-04-26
23-58-00.webm](https://github.com/user-attachments/assets/3de564d8-cc94-4624-98e3-54dd124bfa2f)

## How to Review

- `crates/file_finder/src/file_finder.rs` : Two targeted changes: 
- `matching_history_items` (~line 757): added `.or_else` fallback that
retries the candidates lookup with an empty path when the first lookup
misses, covering the `root_is_file` key mismatch for single-file
worktrees.
- `Match::Search` confirm handler (~line 1640): checks
`wt.read(cx).is_single_file()` and substitutes `RelPath::empty()` for
`path_match.path` to prevent duplication.

- `crates/file_finder/src/file_finder_tests.rs` — Two test changes:
- New test `test_non_project_file_open_with_filter`: opens a file
outside the project, filters for it by name, confirms, and asserts the
correct path is opened.
- Updated `test_search_results_refreshed_on_standalone_file_creation`:
the fix correctly promotes single-file worktree files to
`Match::History`, which activates `skip_focus_for_active_in_search` when
the file is currently open. The test now asserts the match type directly
and closes the picker with `menu::Cancel` instead of confirming.

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed file picker failing to open non-project files when a filter is
typed
2026-06-02 13:38:47 +00:00
Aurabindo Pillai d524bc9a78 language_models: Support custom HTTP headers for provider requests (#55246)
Add a `custom_headers` setting to each HTTP-based language model
provider
(Anthropic, Bedrock, DeepSeek, Google, LM Studio, Mistral, Ollama,
OpenAI,
OpenAI-compatible, OpenCode, OpenRouter, Vercel AI Gateway, and xAI) so
users
can attach extra headers to every outgoing request. Headers managed by
Zed
(authentication, content-type, etc.) cannot be overridden and are
skipped with
a warning.

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)
- [] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added support for configuring custom HTTP headers on language model
  providers via `language_models.<provider>.custom_headers`.

Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>
2026-06-02 13:29:23 +00:00
Smit Barmase 27db63f0e6 mermaid: Fix stack overflow when laying out deeply nested subgraphs (#58325)
Closes FR-49

This PR fixes stack overflow in flowcharts with deeply nested subgraphs.
Rewrote recursive call to iterate with an explicit stack on heap. Added
test which reproduces the overflow.

We use our fork now, with patch on existing v0.4.0:
https://github.com/zed-industries/merman/commit/1c765dcca2ef5092fcde7bebe8374819563623ef

Release Notes:

- Fixed a crash in when rendering Mermaid diagram flowcharts with deeply
nested subgraphs.
2026-06-02 13:21:32 +00:00
Danilo Leal 0a703e4216 agent_ui: Improve draft threads for worktrees (#58268)
Closes AI-351

This PR builds on top of
https://github.com/zed-industries/zed/pull/57692 by improving the draft
threads UX in the context of worktrees. If you have more than one
worktree loaded for a given group, clicking on the plus button will now
display a menu allowing you to choose for which worktree you'd like to
open a new thread in. This felt particularly relevant in the case of
discarding a draft within a worktree when that was the only thread item
for that worktree, making it hard to come back to it.

Added some extra stuff in here as well with regards to better draft
management. Most notably, if you created a new thread and then typed
something, this draft thread would show a timestamp that's relative to
the creation time of the thread. However, if you moments later deleted
the draft content and then typed something up again, the timestamp would
be stuck in the creation time. That felt wrong because by erasing the
content you effectively reset the draft. So, this branch makes it so, in
this context, the timestamp would be reset to now.

Release Notes:

- Agents: Added improvements for the draft thread UX particularly in the
context of worktrees, allowing to choose for which worktree to open a
thread in when the group contains more than one.
2026-06-02 12:30:15 +00:00
Yara 🏳️‍⚧️ a0d71a483a Log worst hanging tasks and actions (#57835)
We have a lot of long blocking tasks on both the foreground and
background, this is a start of getting some insight into those.

We will now log tasks running longer then 100ms on the foreground or
background. Hanging actions will also be logged including their name. We
simultaneously collect statistics on task and action performance and
send those to telemetry. This includes quantiles and averages for each
hanging task.

Finally this adds tree dev actions: 
- hang action
- hang foreground
- hang background

These cause a hang to check if hang reporting is working and in the
future telemetry.

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:

- Added logging and telemetry of tasks and actions with performance
issues
2026-06-02 12:03:05 +00:00
morgankrey 1a9468df12 Document Pro threshold billing behavior (#58320)
This updates docs to reflect changes threshold billing behavior for
individual Zed Pro subscriptions.

- Scope threshold billing language explicitly to individual Zed Pro
subscriptions.
- Remove stale language saying each $10 threshold crossing resets the
threshold to $0.
- Document that threshold invoices start at $10, may rise in $10
increments up to $100, and are not automatically lowered during the same
subscription.
- Split spend-limit docs between Zed Pro and Zed Business, with Business
readers linked to organization billing.

Release Notes:

- N/A
2026-06-02 11:14:53 +00:00
Bennet Bo Fennerandzed-zippy[bot] 0b0436dda5 acp: Indicate when agent is downloading (#57710)
Release Notes:

- agent: Indicate when ACP servers are downloading

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-06-02 09:40:28 +00:00
Xiaobo Liu b60173ba37 git_ui: Prepare review action with owned base ref directly (#58156)
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-06-02 09:34:27 +00:00
toddlereranddino 5370bd13e3 git_ui: Trim surrounding whitespace from new branch names (#58151)
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 #56602.

Creating a branch from the branch picker normalizes the typed name with
`replace(' ', "-")`, so leading or trailing spaces became leading or
trailing hyphens (e.g. ` fix-leak ` -> `-fix-leak-`). git rejects such
names, so branch creation failed.

Trimming the query before replacing spaces yields a valid name.

Release Notes:

- git_ui: Fixed branch creation failing when a branch name had leading
or trailing whitespace

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-06-02 09:18:17 +00:00
Finn EversandBen Brandt b44e0ea669 docs: Update agent server extension documentation (#58306)
Updates the agent server extension documentation to account for the ACP
server extension deprecation.

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-06-02 08:50:46 +00:00
Smit Barmase eba87556ee agent_ui: Fix crash when filtering tools in the agent profile tool picker (#58299)
Closes ZED-8SQ

This PR uses the same pattern for `can_select` as other delegates and
also guards `can_select` call in `Picker::render_element` which was
regressed in #50705.

Release Notes:

- Fixed a crash that could occur when searching or configuring tools in
agent profile settings.
2026-06-02 08:43:52 +00:00
Kieran FreitagandAnthony Eid d3d1f4124c Remove git2 (libgit2) dependency (#53453)
## Summary

- Remove the `git2` crate and its C dependencies (`libgit2-sys`,
`libz-sys`), replacing all remaining usage with the git CLI and other
previously used rust crates
- Replace `git2::Patch` in `buffer_diff` with `imara-diff` (used
elsewhere in the codebase for word diffing)
- Replace `git2::Oid` with `[u8; 20]` and the `hex` crate
- Replace `git2::Repository` in `RealGitRepository` with stored paths
and git CLI calls via the existing `GitBinary`
- Fixes a bug where linked worktree git dir events could cause the
repository entry to be dropped

### Motivation

libgit2 does not support the
[reftable](https://github.blog/2024-04-29-highlights-from-git-2-45/#preliminary-reftable-support)
storage format that was introduced in git 2.45 (see
[libgit2#7117](https://github.com/libgit2/libgit2/pull/7117)), meaning
that git operations in the app using these (like git status, branch
names, diffs, e.g.) appeared broken for any repository using
`--ref-format=reftable`. [Git 3 will use reftables by
default](https://www.deployhq.com/blog/git-3-0-on-the-horizon-what-git-users-need-to-know-about-the-next-major-release),
so this needs to be supported eventually.

Most operations used the git binary already, but there were still a
handfull of stragglers using libgit2. By swapping out the remaining
uses, we can remove the dependancy of libgit2 and eliminate ~30k lines
of vendored C and the associated build complexity (cmake, libz,
pkg-config), as well as ensure that all git operations go through
similar codepaths.

Closes #46747
Closes https://github.com/zed-industries/zed/discussions/45702

fixes ZED-76X
fixes ZED-73N

### Notes

- `reload_index` is removed from the `GitRepository` trait since both
implementations were no-ops (the CLI always reads from disk)
- `change_branch` is simplified to `git checkout <name>`, which natively
handles local/remote branch resolution
- `load_index_text` and `load_committed_text` no longer explicitly
filter symlinks (the old code returned `None` for symlinked entries)

## Test plan

- [x] `cargo test -p git` (34 tests)
- [x] `cargo test -p buffer_diff` (14 tests)
- [x] `cargo test -p worktree --
test_linked_worktree_git_dir_events_do_not_panic`
- [x] `cargo test -p util` (108 tests)
- [x] `cargo test -p project -- test_file_status
test_repository_subfolder_git_status test_update_gitignore`
- [ ] Manual testing of diff gutter, staging, branch switching, remote
operations
- [ ] Manual testing with a reftable repository

Release Notes:

- Fixed git integration not working with repositories using the reftable
reference storage format

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-06-02 05:35:36 +00:00
Lukas Wirth 3bb5b473d6 editor: Fix DisplayMap::highlight_text not always sorting its ranges (#58260)
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-02 04:38:51 +00:00
6d9ed1fc35 Add granular per-path write permissions for the agent terminal sandbox (#57972)
Adds granular, per-path write permissions to the agent's sandboxed
`terminal` tool.

Previously a command could only request unrestricted filesystem writes
(`allow_fs_write: true`) as an all-or-nothing escape hatch. Now the
model can request write access to specific paths via `fs_write_paths`,
and each granted directory covers its whole subtree. The broad escape
hatch is still available as `allow_fs_write_all: true` for cases where
the paths can't be enumerated up front.

Approval prompts now let the user grant a write request either just for
that command or for the rest of the conversation. Conversation grants
are tracked in memory (never persisted) using pure subtree containment,
so later commands writing under an already-granted path run without
prompting again.

Closes AI-335
Release Notes:

- Improved the agent's terminal sandbox so commands can request write
access to specific paths instead of all-or-nothing filesystem access,
with the option to grant access for a single command or the rest of the
conversation.

---------

Co-authored-by: Anant Goel <anantdgoel@gmail.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2026-06-02 01:07:05 +00:00
Anthony Eid 51fd135b45 git: Further extract gitlib2 dependencies (#58280)
Extraction done from #53453

I removed the default Oid implementation we had and added support back
for SHA264 back as well. I also removed the hex dependency and just
added some of those functions we needed in house so we can avoid
building yet another dependency

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-06-01 23:49:20 +00:00
Eric Holk 77d433192f Add create_thread and list_agents_and_models agent tools (#57987)
Adds two built-in agent tools, behind the staff-only
`create-thread-tool` feature flag, that let the agent spawn independent
sibling threads:

- **`create_thread`** creates a new thread with a title and initial
prompt. It runs on the user's behalf and shows up in the agent sidebar
like a thread the user started themselves, but it runs in the background
— the active thread is never interrupted — and it does **not** report
results back to the caller. (Use `spawn_agent` when you want the
results.)
- **`list_agents_and_models`** enumerates the configured agents and, for
the native agent, the available models, so the agent can pick a
cheaper/faster model for bulk work. The motivating stress test was
"spawn 100 threads that each write a haiku, using Haiku instead of
Opus."

By default the sibling shares the parent's project and worktree. If
`use_new_worktree` is set, `create_thread` instead opens a new
background workspace backed by fresh linked git worktrees of the
project's repos — the same flow you get from the worktree picker's
"Create worktree" — and starts the thread there. The new workspace opens
as a background tab so it doesn't pull you away from what you're doing.

A few notes on the design:

- The `agent` crate can't depend on the UI, so there's a
`SiblingThreadHost` trait that `agent_ui::AgentPanel` implements and
installs on the `NativeAgent`. Tool calls in a native-agent thread route
through it.
- Sibling threads go through the same `create_agent_thread` →
`ConversationView` path as the user-facing "new thread" action, so
eviction, persistence, and sidebar rendering match user-created threads.
- An explicit `agent`/`model` override doesn't clobber the panel's
selected agent or the last-used-agent preference — those are snapshotted
and restored around the call.
- The worktree path reuses the existing "Create worktree" machinery
rather than reimplementing it; the agent flow just opens the new
workspace in the background instead of activating it.

A couple of things I left out or want to call out:

- There's no tool to operate on an already-created sibling by session
id. The success payload deliberately omits it, since the session is
populated asynchronously and nothing consumes it yet.
- When a project has multiple worktrees that are linked worktrees of the
*same* underlying repo, they collapse into a single new worktree (they
resolve to the same target path). The tool returns a warning in that
case rather than failing — and this also fixes a latent collision the
manual "Create worktree" flow would hit in the same situation.

Release Notes:

- N/A
2026-06-01 23:44:18 +00:00
MartinYe1234 be86e9aef4 Fix rules-to-skills migration (#58278)
Closes https://github.com/zed-industries/zed/issues/57992
Closes AI-349


## Summary
- Run rules-to-skills migration during agent UI init instead of waiting
for feature flags in production.
- Add a command palette action to rerun the migration manually.
- Make AGENTS.md migration appends idempotent to avoid duplicated
default-rule prompts.


Release Notes:

- Added a manual way to trigger the Rules to Skills migration
2026-06-01 23:17:00 +00:00
Danilo Leal 560de3d644 recent_projects: Improve label truncation (#58279)
Just a small tweak here making sure the recent project's list items
truncate properly, instead of being hard cut off.

Release Notes:

- N/A
2026-06-01 23:16:49 +00:00
Sathwik ChirivelliandDanilo Leal 298222a756 git_ui: Add split controls to commit view (#58163)
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Summary:

- Added split/unified diff controls to the commit history commit view
using `SplittableEditor`.
- Kept commit messages separate from file diffs with an 8-line
scrollable message panel.
- Fixed split setup edge cases and async/test type mismatches from the
commit view changes.

Verification:

- `cargo check -p git_ui`
- `cargo check -p git_ui --tests`
- `cargo check -p editor --tests`
- `./script/clippy -p git_ui`
- `git diff --check`

Release Notes:

- Improved the commit history diff view by adding the ability to toggle
the split diff mode.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-06-01 22:46:12 +00:00
Anthony Eid 01b6ebd0b4 gpui: Add bare bones benchmark framework (#58191)
### Summary

Adds the first pass at `#[gpui::bench]`, backed by Criterion, with a new
`BenchAppContext` for GPUI benchmarks.

This ports one editor benchmark to the new setup while keeping the
existing Criterion render benchmarks in place.

### Follow Ups

I eventually want to improve this framework to create custom tracy
profiles that includes additional information such as
- notify count
- entity.update count and time
- event emitted and time for that

I also want to use this to create custom measurements so benches can be
used for
- Frames dropped 
- foreground thread time
- Render time
- etc


This PR is a very small proof of initial concept and I'll continue to
build this infrastructure out so Zed and other gpui apps can become a
lot more resilient to dropping frames and hangs. Plus it will make
improving performance a lot easier as well in the future.


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-06-01 22:28:38 +00:00
Danilo Leal 1ae465a1ef git_ui: Render commit message as markdown (#58274)
This PR removes the commit message from the first excerpt of the
multibuffer and renders it as markdown in the commit view's header.
Effectively, this allows the commit view to use the split diff buffer,
as done in https://github.com/zed-industries/zed/pull/58163.

<img width="600" alt="Screenshot 2026-06-01 at 6  34@2x"
src="https://github.com/user-attachments/assets/a763a04d-88ce-4d29-9cee-872a33ace6e4"
/>

Release Notes:

- N/A
2026-06-01 22:19:14 +00:00
Marshall Bowers b707eb4882 collab: Use avatar URLs returned from Cloud (#58265)
This PR updates Collab to use the avatar URLs returned from Cloud
instead of constructing them directly.

Release Notes:

- N/A
2026-06-01 21:50:11 +00:00
Richard Feldman 377708befa agent: Enable terminal output controls for everyone (#58271)
Removes the feature flag around terminal output selection so the
terminal tool always exposes head_lines and tail_lines. This keeps the
simpler behavior from the landed implementation while avoiding a
separate rollout path for the tool schema.

Release Notes:

- Improved agent terminal output controls by making them available
without a feature flag
2026-06-01 21:29:15 +00:00
auwi-nordicandEric Holk f00bcae75e Symlink scan option (#53646)
Adds option to always search/scan symlinks for more thorough coverage of
#41887 issue

This is a significant rewrite and more thoroughly reviewed and tested
version of the old PR here:
https://github.com/zed-industries/zed/pull/46344

The "never" option was removed from the old PR, since "expanded" is now
the default. Perhaps "never" can be added as an option later if there's
demand for it. Adding that option may resolve #48890 for instance.

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
(significant impact with "always" option, but "expanded" is default)

Release Notes:

- Add option choose between including expanded symlinks or include all
symlinks in project search (#41887)

---------

Co-authored-by: Eric Holk <eric@zed.dev>
2026-06-01 20:48:05 +00:00
Mikayla Maki 3b42fba9c5 Align prefix parsing, smart-select characters (#58267)
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-06-01 20:47:00 +00:00
Richard Feldman 67cb7a1fdf agent: Add terminal output head and tail options (#58257)
Adds optional terminal tool parameters that let agents receive only the
first lines, last lines, or both from a command's final output while
leaving the live terminal output visible to users. This is gated by the
terminal-tail feature flag and updates the tool descriptions to steer
agents away from piping through head, tail, or similar filters.

Closes AI-36

Release Notes:

- Let agents use the terminal tool with builtin "head/tail" so they
don't have to pipe to head/tail and lose incremental output
2026-06-01 20:24:47 +00:00
Ben Kunkle e36459aead ep: Jump example capture (#58236)
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 or Added/Fixed/Improved ...
2026-06-01 20:18:48 +00:00
Ville Skyttä 64ab35c4b6 Recognize shell-script as shell in modelines (#58124)
shell-script-mode is a valid and commonly used alias for sh-mode in
Emacs.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes N/A

Release Notes:

- Added support for `shell-script` filetype in Vim modelines
2026-06-01 19:33:21 +00:00
Ville Skyttäanddino 522eadee16 Support ex: in vim modelines (#58121)
Ref https://vimdoc.sourceforge.net/htmldoc/options.html#ex%3A

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] 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 N/A

Release Notes:

- Support `ex:` identifier in vim modelines.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-06-01 18:54:29 +00:00
liamanddino ab7405778c languages: Respect devEngines package manager for package scripts (#58113)
Resolves https://github.com/zed-industries/zed/issues/58086

This diff fixes `package.json` runnables using npm for projects that
declare their package manager through
`devEngines.packageManager`. The `package.json` parser only looked at
the top-level `packageManager` field, so projects using the newer
`devEngines` shape fell back to `npm` even when they specified `pnpm`,
`yarn`, or `bun`.

With this change, package manager detection also reads
`devEngines.packageManager` in both object and array forms. The
top-level `packageManager` field still takes precedence when both are
present, and the shared parser means the fix applies to `package.json`
gutter runnables as well as TypeScript package-script tasks.

Release Notes:
- Fixed `package.json` runnables ignoring package managers declared via
`devEngines.packageManager`.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-06-01 18:04:42 +00:00
Mikayla Maki 9c8e757891 Render the first character as the icon in a terminal thread (#58251)
This makes terminal agents look much better:

<img width="667" height="520" alt="Screenshot 2026-06-01 at 10 35 34 AM"
src="https://github.com/user-attachments/assets/9029ca7d-effe-43e5-b8f4-10b3e42e6cc9"
/>

<img width="767" height="579" alt="Screenshot 2026-06-01 at 10 36 23 AM"
src="https://github.com/user-attachments/assets/d3392f64-ca2c-40d2-9077-b2ac7a51151d"
/>

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:

- The first icon in the terminal title will now render in the thread
icon slot, when using terminal threads
2026-06-01 18:03:41 +00:00
Miguel Raz Guzmán Macedo 70a1715fc3 Change .join("") to .concat() (#58200)
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-06-01 17:04:14 +00:00
Ben Brandt 42776b21da docs: Document external agent thread imports (#58242)
Release Notes:

- N/A
2026-06-01 17:01:59 +00:00
fe4203a541 Allow symlinked global skill directories (#58095)
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 #58088

Release Notes:
- Allows for symlinked global skill directories

---------

Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
Co-authored-by: Martin Ye <martin@zed.dev>
2026-06-01 16:45:03 +00:00
Bennet Bo Fenner c9df0e7cc1 acp: Handle reasoning effort shortcuts (#58223)
Makes sure that the reasoning effort levels picker can be controlled
with the same shortcuts that are used in the native agent.

Also adds the keyboard shortcuts to the tooltips for all pickers that
support them

Closes #56074

Release Notes:

- Fixed an issue where reasoning effort selector could not be controlled
via keyboard shortcuts for ACP agents
2026-06-01 16:26:39 +00:00
Richard FeldmanandBennet Bo Fenner 6d3015d2ba agent: Respect compaction boundaries in request windows (#58241)
Agent request construction now honors persisted compaction markers by
rebuilding the model-visible window from the latest boundary, retaining
recent user context for summary compactions, and treating
provider-native compactions as suffix-only until native replay lands.

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-06-01 16:00:38 +00:00
Richard Feldman 0584c934dd Gate sandboxed terminal tempdir to local projects (#58240)
[PR #57878](https://github.com/zed-industries/zed/pull/57878) introduced
a per-thread sandboxing temp directory that, for every terminal command,
overrode `TMPDIR`/`TMP`/`TEMP` and pushed the directory into the sandbox
writable scope. For remote projects this temp directory is created on
the client while the terminal actually runs on the remote host, so it
leaked client-side environment variables into the remote terminal and
pointed `$TMPDIR` at a path that doesn't exist there.

This gates the temp-directory logic behind `project.is_local()`, so
remote projects no longer get their terminal environment infected. This
doesn't restore the per-thread tempdir behavior for remoting, but it
undoes the regression.

Closes AI-348

Release Notes:

- Fixed remote terminals having their environment overridden by
client-side temp directory variables
2026-06-01 15:59:58 +00:00
Alex Lachance 09d5743f6d python: Fix splat parameter highlighting (#58136)
In the current Python Tree-sitter `highlights.scm`, splat parameters
(e.g., `*args`, `**kwargs`) and typed splat parameters are not
highlighted as `@variable.parameter` due to missing patterns.

This PR adds `list_splat_pattern` and `dictionary_splat_pattern` to the
function parameter rules so splat parameters are correctly colored.

| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
| <img width="688" height="482" alt="image"
src="https://github.com/user-attachments/assets/dbb04e09-51a2-401a-8239-d244a01a02f9"
/> | <img width="686" height="480" alt="image"
src="https://github.com/user-attachments/assets/f07518ec-30fd-4067-b59d-e090da8182c3"
/> |


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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed Python splat parameters highlighting
2026-06-01 15:07:09 +00:00
Ben Brandt 1977fb05fe terminal: Add backend-neutral terminal types (#57483)
Refactor to isolate alacritty types into the terminal crate and offers
comparable apis where needed for similar functionality. However, these
are Zed-owned types instead of the dependency leaking across multiple
crates, making alacritty an implementation detail of the terminal crate.

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-06-01 14:49:31 +00:00
Richard Feldman 72de52d291 Add context compaction markers (#58089)
Adds the flat context compaction marker data model and replays persisted
markers into native agent transcripts as static dividers. This lets
compacted thread boundaries deserialize, render, and export to Markdown
without enabling automatic compaction behavior yet.

Release Notes:

- Improved agent threads to show restored context compaction dividers in
conversations
2026-06-01 14:29:15 +00:00
MartinYe1234andCole Miller 4d1c71f5c1 Load project skills through worktree buffers (#58094)
Project-local skills now load through project buffers so remote
workspaces can resolve them consistently with other project files.

Validation:
- cargo check -p agent_skills -p agent
- cargo test -p agent_skills
- cargo test -p agent skills

Closes AI-329

Closes https://github.com/zed-industries/zed/issues/57877

Release Notes:

- Improved project skills support in remote workspaces.

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2026-06-01 13:23:28 +00:00
Finn Eitreim ee321d34d3 project: Add fuzzy search in remote projects dialogue (#54143)
Stacked on top of #54123
This is part 3 of 3 towards #51197
More details from the original PR
https://github.com/zed-industries/zed/pull/53551

This PR implements fuzzy search in the remote projects dialogue, using
the `fuzzy_nucleo::match_strings` introduced in #54123.

## remote project search

The reviews of https://github.com/zed-industries/zed/pull/51197 seemed
to indicate that performance was important here so it runs async and
cancels the previous stale request when a new character is typed.

other features:
text highlighting of what was being typed, similar to other fuzzy
searches.
reorder the projects on the list based on the maximum score from its
projects.

video of it in action:


https://github.com/user-attachments/assets/86b3ed85-fc29-46fb-b3c4-c0cbc3bf8edd

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

Release Notes:

- recent_projects: Added fuzzy search to the remote projects modal.
2026-06-01 13:14:28 +00:00
Henrique Ferreiro 65013c98f3 git_store: Coalesce refresh pathspecs (#56406)
Coalesce repo-relative paths before refreshing git status and diff
state. The worktree scanner can report both a directory and its
descendants in the same repository bucket, which makes git receive
redundant pathspecs.

This keeps refresh commands smaller for large repositories such as
Chromium, reducing git pathspec matching work and improving status
refresh performance during large worktree updates, as the initial repo
scan.

Partially fixes #43861

Release Notes:

- Reduced git CPU usage on large repos
2026-06-01 12:28:20 +00:00