Commit Graph
39151 Commits
Author SHA1 Message Date
Conrad Irwin b762980b3e Remove experimental microphone gain normalization option (#58677)
Release Notes:

- Removed the `experimental.auto_microphone_volume` setting (since
#58036 microphone volumes are now normalized by default)
2026-06-05 16:49:42 +00:00
Smit Barmase 0ee1a808bc project: Fix spurious git diff for symlinked files (#58655)
Opening a symlinked file showed the whole file as changed in the git
gutter/diff. Git stores only the symlink's target path as that entry's
blob, while the buffer holds the resolved target's contents, so diffing
the two is meaningless.

We now skip loading a git diff base whenever a buffer's worktree entry
is a symlink i.e. its `canonical_path` is set.

Release Notes:

- Fixed symlinked files showing the entire file as changed in the git
diff/gutter.
2026-06-05 16:29:28 +00:00
Lena 158378fc2c Split out Windows in community PR area-track mapping (#58671)
Release Notes:

- N/A
2026-06-05 16:00:09 +00:00
feeiyu 126c0ee41a Disable the IME on linux/wayland when text input is unexpected (#58237)
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
- [ ] Performance impact has been considered and is acceptable

This PR follows the approach from #51041 and currently includes only the
Wayland implementation.

[录屏 2026-06-01
23-11-17.webm](https://github.com/user-attachments/assets/c9f87503-4d64-4868-b9d8-5b832ade3e5a)



Release Notes:

- On Linux wayland, the IME is disabled in Vim normal and visual modes.
2026-06-05 15:39:59 +00:00
Tiou Lims 486cf9ef3c Fix macOS system font fallback cascade append (#58020)
Fixes #57916.

`append_system_fallbacks` used `.map(...)` for the `CFArrayAppendValue`
side effect, but the iterator was never consumed.

This changes it to a `for` loop so the fallback descriptors are actually
appended.
2026-06-05 15:21:46 +00:00
Danilo Leal dde98fa822 sidebar: Add small refinements to the header design (#58661)
- Improve icon colors and gradient overlay
- Fix a bug where the plus icon button as visible in the sticky header
despite the menu being closed
- Made menu positining consistent between the plus/ellipsis menu
- Other small spacing/wording tweaks

Release Notes:

- N/A
2026-06-05 15:05:31 +00:00
a8dc3579f1 settings_ui: Disable settings overridden by current organization (#58326)
<img width="2258" height="832" alt="image"
src="https://github.com/user-attachments/assets/47006348-0b51-4b4e-b427-4c016e45d4ec"
/>


Release Notes:

- N/A

---------

Co-authored-by: probablyneb <ben@zed.dev>
Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
2026-06-05 14:00:11 +00:00
Lukas Wirth 86effffd34 editor: Only compute word-diff highlights for visible rows (#58639)
Word diffs are stored per-hunk for the entire hunk range, but
layout_word_diff_highlights converted every word diff of every hunk
touching the viewport to display points each frame, even for the
off-screen portion of a large, partially-visible hunk. Each conversion
walks the inlay/fold/tab/wrap/block trees, so scrolling through a large
modified hunk (especially in split diff mode, where both editors lay out
every frame) caused frame drops proportional to the hunk's total size
rather than its visible portion.

Filter word diffs by the visible buffer-offset window before converting.
Buffer offset to display point is order-preserving, so this is
equivalent to the existing per-row filtering applied to the converted
ranges.

Release Notes:

- Improved scrolling performance in diff views containing large hunks
with many computed word diffs
2026-06-05 12:51:02 +00:00
Ben Kunkle d11d7c837d agent_skills: Instruct agent not to include unrelated instructions in /create-skill (#58599)
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-05 12:25:00 +00:00
Ben Brandt 116e4bc184 agent_ui: Inherit source agent without draft content (#58636)
Noticed that when you had an empty draft and created a worktree we
weren't respecting agent selection. It was because of an early ? return
on an option, and should be fixed now.

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:

- agent: Fix for current agent not being selected when creating a new
git worktree
2026-06-05 11:55:04 +00:00
Lena 1eefc3b9e9 Add upvotes to the community PR board (#58645)
Release Notes:

- N/A
2026-06-05 11:46:17 +00:00
Lukas Wirth e38043a209 recent_projects: Fix recent project picker icons (#57940)
Before we would render the icon of the active project for all of them
instead of the appropriate project per entry

Release Notes:

- Fixed a bug that caused the project icons to render in the recent
projects picker
2026-06-05 11:17:53 +00:00
Lukas Wirthandsaberoueslati de744e744c Correctly handle file links in markdown and agent threads (#56024)
Closes https://github.com/zed-industries/zed/issues/54840

There are likely more places we can use this new workspace function in,
but these are the known ones to me right now

Release Notes:

- Fixed file hyperlinks in the agent panel not opening files when
clicked

Co-authored-by: saberoueslati <saberoueslati12@gmail.com>
2026-06-05 11:17:44 +00:00
Liigo Zhuang 8807ac4f3b Agent: Improved auto scroll location when using read-file tool (#58640)
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](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #58612

Release Notes:

- Agent: Improved auto scroll location when using read-file tool.
2026-06-05 11:01:48 +00:00
Lukas Wirth 8b5db3582c Restore the focused workspace after quitting (#58392)
On quit, the handler activates every workspace in each window to surface
save prompts. Activating re-serializes the multi-workspace state, so the
persisted active_workspace_id ended up pointing at whichever workspace
was iterated last rather than the one the user had focused. On the next
launch the wrong (or empty) workspace was restored as active, even
though all projects still appeared in Open Recent.

Re-activate the originally-focused workspace after the close-prompt loop
(and on the cancel-quit path) so it is the one serialized as active.
Also harden read_serialized_multi_workspaces to prefer a workspace with
paths over a scratch/empty one when the persisted active workspace can't
be matched.

Release Notes:

- Fixed a workspace restoration issue where zed would restore a window
with none of its projects opened by default
2026-06-05 10:44:39 +00:00
Lukas Wirth 28bd200273 project: Normalize line endings in textual project search (#58628)
Release Notes:

- Fixed an issue with project search on windows where multiline string
searches would not work correctly due to newline differences
2026-06-05 10:44:29 +00:00
Lukas Wirth e77b18bad8 Prevent auto-restart of language servers after Stop All Servers (#51468)
Release Notes:

- When stopping all language servers, Zed will now no longer restart
language servers when language files change until the user restarts all
language servers explicitly
2026-06-05 10:36:03 +00:00
Lukas Wirthandzed-zippy[bot] a85f8ad090 Use no-op hasher for TypeId hashing (#58629)
TypeId is effectively already a hash, so re-hashing it with fxhash is
unnecessary.

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-06-05 10:32:57 +00:00
Lena e83c2d94d4 Add meta signals to the community PR board (#58635)
For the ease of finding something that fits the time that reviewers have
and for making it mechanically easier to prioritize the PRs from the
community champions, surface some meta information on the PR board (and
make it updatable). Meta information here means things like size and
whether there's an issue linked to the PR (and what is its type if there
is).

Release Notes:

- N/A
2026-06-05 10:16:52 +00:00
Ben Brandt 8ce658ffa7 acp: Support raw agent registry binaries (#58579)
It is valid to have raw binary paths in the registry but we didn't
handle them.

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:

- acp: Fix for certain ACP Registry agent downloads not starting
2026-06-05 09:26:19 +00:00
Justin SuandYara 🏳️‍⚧️ 33d8c7e7e3 Add envrc to Shell Script path_suffixes (#58573)
direnv's .envrc files are just Bash scripts.

---

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
- [ ] Performance impact has been considered and is acceptable

Release Notes:

- Detect .envrc files as Shell Script

Co-authored-by: Yara 🏳️‍⚧️ <git@yara.blue>
2026-06-05 09:17:31 +00:00
Chintan 0cab9eeaba project_panel: Do not ignore first focus clicks on items (#58562)
When handling click events on entries in project panel, we were
returning early if the click was the one that brought the Zed window
into focus. This effectively ignored the click action on the item. This
leads to two clicks being required to act on an item in the project
panel if the Zed window is out of focus. The existing behaviour is also
inconsistent with other UI controls, where clicking on them when the
window is out of focus actually acts upon them.

This behaviour was introduced in
https://github.com/zed-industries/zed/pull/9553.

This PR fixes the click handler on the entries so that events with
`first_focus() == true` are no longer ignored.

Before:


https://github.com/user-attachments/assets/d51ec11d-c47a-4ea3-af6d-63bf6daf3c44

After:


https://github.com/user-attachments/assets/87b9e6a8-9ef0-463f-8557-e15d25b519ca

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](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #58261 

Release Notes:

- Fixed project panel needing a second click to change the file if the
window is not in focus
2026-06-05 09:03:35 +00:00
Shuhei KadowakiandOleksiy Syvokon b93d14edf2 editor: Don't bypass show_edit_predictions when navigating diagnostics (#56055)
`go_to_diagnostic_impl` was calling `refresh_edit_prediction(false,
true)` with `user_requested = true`, which skips the
`should_show_edit_predictions` check inside `refresh_edit_prediction`
(`crates/editor/src/editor.rs`).

As a result, navigating between diagnostics in a buffer where the user
has set `show_edit_predictions: false` would still trigger
`EditPredictionProvider::refresh`. With the Zed provider this fans out
into many `textDocument/definition` and `textDocument/typeDefinition`
LSP requests for every identifier near the cursor
(`RelatedExcerptStore::fetch_excerpts`), which is surprising for users
who have explicitly disabled edit predictions for that language.

Jumping to a diagnostic is a navigation action, not a request for an
edit prediction, so pass `user_requested = false` and enable debouncing
here.

Release Notes:

- Fixed diagnostic navigation triggering unnecessary LSP requests when
edit predictions are disabled.

Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
2026-06-05 08:50:44 +00:00
Tianze Zhao 693356221e Fix symlinked root rename event handling (#58624)
Fixes #58619.

When a worktree is opened through a symlinked root, filesystem events
can arrive rooted at either the opened symlink path or the canonical
target path. The worktree event processing path already handled
canonical target paths, but dropped events reported under the opened
symlink root because it only derived relative paths from the canonical
root.

This PR adds a regression test that opens `/link -> /target`, renames
`/link/subdir-a` to `/link/subdir-aa`, and verifies
`subdir-aa/config.ini` remains visible in the worktree. The production
fix accepts event paths under the opened worktree root as a fallback
when deriving relative paths.

Testing:

- Verified the new regression test fails with only the test commit
applied.
- `cargo test -p worktree --test integration
test_renaming_subdir_under_symlinked_root_keeps_children`
- `cargo test -p worktree --test integration
test_symlinks_pointing_outside`
2026-06-05 08:23:17 +00:00
Dino ca63c88f50 editor: Reduce number of language server requests in go to definition (#58429)
These changes are a follow-up to #58244. That PR changed how Zed sends
`textDocument/definition` requests so that, once the language server has
answered for a given position, Zed doesn't re-query that same position
as the mouse jiggles within the same character, avoiding spamming the
server on every tiny mouse movement.

This PR adds two more cases on top of that:

**1. Preserve the deduplication state when the server returns an empty
response**

* Previously, an empty response called `Editor::hide_hovered_link`,
which sets `Editor::hovered_link_state` to `None`, discarding the
recorded `HoveredLinkState::last_trigger_point`.
* We now clear `HoveredLinkState::links` instead, resetting the links
while keeping `last_trigger_point`, so we don't re-query the same
position when the response was empty.

**2. Fall back to the surrounding word as the symbol range for no-origin
servers**

* The `editor::hover_links::show_link_definition` function already used
`surrounding_word` to pick the highlight range when the server returned
no symbol range.
* For servers that return a link (or links) but no
`originSelectionRange`, we now also treat that `surrounding_word` range
as the symbol range, so moving across characters of the same symbol will
not re-query the language server.
* There's caveat to this approach, for a language where something like
`run_function` is not a single symbol/node, if the server returns a
response for one character, we won't re-query for the others in
`run_function`, even if the server would have returned something
different for `_` or `function`. I believe this should be rare, can't
think of a language where this would be an issue, but I'm happy to
revisit or drop this part if we decide it's not worth it.

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:

- Improve go to definition in order to avoid repeatedly querying the
language server while moving the mouse over the same symbol or an
unresolved position
2026-06-05 07:37:56 +00:00
Bennet Bo FennerandDanilo Leal 5a318bad74 agent_ui: Improve thread import UX (#57791)
<img width="439" height="292" alt="image"
src="https://github.com/user-attachments/assets/90a39458-1ec5-4c73-922e-21cab8aa5a51"
/>

Release Notes:

- agent: Improved UX of agent import flow

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-06-05 07:18:05 +00:00
Lukas Wirth eac0687e23 Speed up collab test a bit by doing less repeated work in multi iteration tests (#53490)
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-05 07:14:12 +00:00
Richard Feldman 626dc16f02 Handle bracketed ellipsis title prefixes (#58269)
Terminal thread title prefixes now strip surrounding brackets before
condensing leading dots, so bracketed ellipsis prefixes render with the
same ellipsis icon as unbracketed prefixes.

Release Notes:

- Improved terminal thread icons for bracketed ellipsis title prefixes
2026-06-05 05:14:28 +00:00
Joseph T. Lyons fcb95aaee4 Add auto-surround support for tilde in Markdown (#58614)
This enables you to easily add strikethroughs to text you have selected
by typing `~` twice.
This matches VS Code's behavior.

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 surrounding selected Markdown text with `~` by
typing `~`
2026-06-05 03:26:15 +00:00
Joseph T. Lyons c83cef450f Add action to toggle block quotes in Markdown (#58383)
This PR adds an action to toggle block quotes on and off for the
selected lines while in Markdown. I'm using my own binding in the demo
video, this PR does not bind it to anything.


https://github.com/user-attachments/assets/5c1f4121-e863-459d-8a9b-8eefdbfb888e

When there's a mixture of quoted and "unquoted" lines, we normalize to
quoted:


https://github.com/user-attachments/assets/ca003844-0c4f-4cae-a7d0-a9d355258f2d

While adding this, I noticed that `editor.rs` had been through some
refactoring in order to reduce its size. Because of this, I introduced
`markdown_actions.rs`, as I intend to follow up with some other markdown
toggling actions (eg: `markdown: toggle bold`, `markdown: toggle
italic`, etc.)

The implementation reuses the existing `manipulate_mutable_lines` code
that all line manipulating actions run through.

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:

- Added a `markdown: toggle block quote` action
2026-06-04 23:34:13 +00:00
Chris Biscardi 5bcd6ea66a Remove double-click handling from git panel filenames (#58594)
Previously in the git panel, double clicking a filename would trigger
both the first-click action *and* the second-click action.

This PR removes the second click handling since we don't have a good
pattern for single-and-double-click handling.

### Before



https://github.com/user-attachments/assets/f03e53ae-a330-4f60-812d-a45a2d3f5f30

### After



https://github.com/user-attachments/assets/e09493a1-6477-4d43-80ea-26322dd1f083




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-04 22:59:00 +00:00
Ben Kunkle 9e455065db ep: Improve trigger granularity (#58561)
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-04 22:52:29 +00:00
Cole Miller 8612c626d9 Fix some overcomputation in the project diff (#57859)
- Don't emit unnecessary edited events from the multibuffer when setting
excerpts is a no-op
- Limit excerpt recomputation in the project diff when diffs or
conflicts change to just the affected buffer
- Ignore diff events in the project diff that can't affect excerpt
boundaries

Also includes some drive-by improvements to the handling of merge
conflicts:
- Await initial conflicts parse when opening a conflict set (like
diffs), so we don't see an initial incorrect "no conflicts" state
- Make the project diff subscribe to conflicts directly instead of
indirecting through the editor (also like diffs)
- Instead of saving the affected buffer when resolving a conflict, just
avoid re-registering dirty buffers with the project diff, so that
excerpts for conflicts don't disappear quite so eagerly (once more: like
diffs)

The combination of these changes greatly cuts down the amount of time
spent syncing the `DisplayMap`, which is especially bad for the split
view.

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:

- Improved the performance of the project diff, especially in the
presence of merge conflicts
- Fixed conflicts disappearing too quickly from the project diff when
editing
- Fixed conflicts sometimes taking a while to appear in the project diff
during large merges
2026-06-04 21:54:03 +00:00
Kunall Banerjee c40629d1a1 grammars: Stop treating fish modelines as Shell Script (#58550)
Bash listed `fish` in `modeline_aliases`, so a `filetype=fish` modeline
resolved to Shell Script before the real [Fish
language](https://zed.dev/extensions/fish) could match by name or
grammar. Fish is intentionally non-POSIX, so the Bash grammar is the
wrong fit here.

| Header | After |
|--------|--------|
| <img width="1912" height="1237" alt="image"
src="https://github.com/user-attachments/assets/ed212a24-92aa-4ede-a432-47c6c6724f08"
/> | <img width="1732" height="1125" alt="image"
src="https://github.com/user-attachments/assets/934140b3-9473-4cca-a3e5-84aa3c4d827a"
/> |

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
- [ ] Performance impact has been considered and is acceptable

Closes #58532.

Release Notes:

- Dropped `fish` from `modeline_aliases` which forced the file to be
detected as Shell Script instead of Fish
2026-06-04 21:48:52 +00:00
raptorandKunall Banerjee b36250a69b docs: Clarify Project Search runs on Enter (#58545)
This PR fixes the Project Search documentation to clarify that search is
triggered upon pressing Enter.

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

Release Notes:

- N/A

---------

Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
2026-06-04 21:25:58 +00:00
Finn Evers 50d001fe0a Add note about extension API changes to the contributing guidelines (#58369)
Release Notes:

- N/A
2026-06-04 20:50:01 +00:00
Oleksiy Syvokon d1271beee7 ep: Minor changes to evaluate context retrieval (#58572)
- Track average size of the retrieved context
- Support comma-separated values for `ep context --type`
- Exclude oracle from `editable` preset


Release Notes:

- N/A
2026-06-04 18:22:46 +00:00
MartinYe1234 b53b14d214 Restore access to old threads that mention rules (#58560)
Removing the `Rule` variant from `MentionUri` in #58080 broke
deserialization of any thread saved before the rules-to-skills
migration. Loading one failed with `unknown variant `Rule``, making
those threads inaccessible.

This restores access without bringing back the rules feature:

- Reintroduce a backward-compatible `Rule` mention variant so legacy
threads deserialize again.
- Preserve the original rule `id` through save/load so a thread re-saved
by a newer build still loads on older Zed versions (and synthesize a
valid placeholder when the id is missing).
- Clicking a legacy rule mention now opens the skill the rule was
migrated into, and shows a notification linking the Skills docs. On
remote/collab projects the migrated file lives on the local machine, so
it opens as a read-only buffer. If no matching skill exists, it does
nothing.

Closes https://github.com/zed-industries/zed/issues/58498
Closes AI-371

Release Notes:

- Fixed old threads that mention Rules being inaccessible after Rules
were migrated to Skills
2026-06-04 16:53:09 +00:00
Danilo Leal 0b87a03a29 worktree_picker: Add section for open in this window (#58555)
This PR adds a "This Window" section to the worktree picker that's
similar to the one that exists in the recent projects modal. This is
particularly helpful when, for a given project group/repository, you
have more than one worktree loaded, allowing you to more easily switch
between them.

<img width="600" alt="Screenshot 2026-06-04 at 12  53@2x"
src="https://github.com/user-attachments/assets/53a8fcdb-9c34-4b2a-b34e-9bdcad6c040e"
/>

Release Notes:

- Improved worktree navigation UX when a given project has more than one
loaded.
2026-06-04 16:16:38 +00:00
Zhiwei Liang 307ea5a0ee Refresh OpenRouter models after setting API key (#58551)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] 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

## Summary

Adding an OpenRouter API key did not populate the model list until the
app was
restarted. `set_api_key` stored the credential but never triggered a
model
fetch, so until re-authentication happened (on restart or a settings
change)
the picker showed only the user-configured `settings.available_models`,
not the
models returned by the OpenRouter API.

This makes `set_api_key` refresh the models right after the key is
stored,
mirroring how `authenticate` already does it.

## Changes

- `set_api_key` awaits the credential store and then calls
`restart_fetch_models_task`, so the API model list loads immediately
after a
  key is entered (and is cleared when the key is removed).
- `fetch_models` now maps `list_models` errors via
`LanguageModelCompletionError::from`, preserving the real OpenRouter
error
  message instead of wrapping it in a generic `Other(...)`.

Release Notes:

- Fixed OpenRouter models not appearing until restart after adding an
API key

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
2026-06-04 16:03:35 +00:00
morgankrey 99739ef047 Restructure AI docs (#57614)
## Summary

- Restructures the AI docs around quick routing, agent paths, provider
access, and company-specific entry points.
- Moves account-owned AI billing/model pages into Account & Billing
while preserving legacy AI redirects.
- Adds focused pages for Zed Agent, external agents, terminal threads,
agent profiles, skills, instructions, API access, subscriptions,
gateways, and local models.
- Updates related links across Git, authentication, business, migration,
and settings reference docs.

## Validation

- `pnpm dlx prettier@3.5.0 . --write`
- `pnpm dlx prettier@3.5.0 . --check`
- `git diff --check -- docs/src`
- Changed-doc local markdown link sanity check
- `mdbook build docs` was attempted; it is currently blocked by an
unrelated existing `docs/src/vim.md:542` action schema error for
`vim::HelixJumpToWord`.

## Follow-up

- Create a ticket to align Zed's in-app AI configuration surfaces with
this documentation model, including Agent Settings, Configure buttons,
Tools, Profiles, MCP, Skills/Instructions, and plain settings.

## Suggested .rules additions

N/A

Release Notes:

- N/A
2026-06-04 15:55:21 +00:00
Marshall Bowers a599b951eb collab: Remove writes to github_user_id and github_login (#58474)
This PR removes writes to the `github_user_id` and `github_login`
columns on the `users` table.

These writes were only being done in tests, as the production codepaths
that referenced these columns have already been removed.

Depends on https://github.com/zed-industries/cloud/pull/2743 to make the
`github_user_id` column nullable.

The corresponding database schema migration has been created in the
Cloud repo and applied to the production database.

Closes CLO-831.

Release Notes:

- N/A
2026-06-04 15:43:03 +00:00
Smit Barmase bb33fea173 editor: Fix panic on newline below with a cursor on deleted diff hunk (#58542)
Closes FR-62

Release Notes:

- Fixed crash on newline below with a cursor on a deleted line of a
diff.
2026-06-04 15:39:18 +00:00
MartinYe1234 c29c9ba4de Hide Always Allow option for agent skills edits (#58463)
Edits targeting the agent skills directory (project `.agents/skills/`
and global `~/.agents/skills/`) always prompt regardless of permission
settings, because they route through `authorize_always_prompt` which
never consults the persisted `always_allow` rules.

The permission prompt still rendered an "Always allow" button, though.
Clicking it wrote an `always_allow` rule into settings that was then
silently ignored on the next skills edit, so users were re-prompted
every time despite having chosen "always allow" — exactly the confusion
reported in AI-346.

This keeps the always-prompt behavior intact and just hides the
misleading "Always allow" / "Always deny" options for skills, leaving
once-only Allow/Deny. Applies to all mutating skills tools: `edit_file`,
`write_file`, `copy_path`, `move_path`, `delete_path`, and
`create_directory`.

Implementation:
- New `ToolPermissionScope::AgentSkills`, set via
`ToolPermissionContext::for_agent_skills()`.
- `build_permission_options` returns flat once-only Allow/Deny for that
scope (mirrors the existing `SymlinkTarget` handling).
- Wired into both authorization entry points (`authorize_file_edit` and
`authorize_with_sensitive_settings`).
- Tests assert no `AllowAlways` option is offered for each affected
tool.

Settings-file prompts (`.zed/settings.json`, global config) are
intentionally left unchanged.

Closes AI-346

Release Notes:

- Removed the misleading "Always allow" button from agent permission
prompts for edits to the agent skills directory, since those edits
always require confirmation.
2026-06-04 15:39:02 +00:00
Joseph T. Lyons 8eaca43266 Rename Stash tab to Stashes (#58505)
This PR unifies the naming of the tabs in the branch selector by
updating `stash` to `stashes` (to match `branches`). Also updates the
enum variant to match the label.

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-04 15:29:35 +00:00
Oleksiy Syvokon d1c1cc01fa ep: Add BM25 context retriever (#58526)
Release Notes:

- N/A
2026-06-04 15:26:06 +00:00
Anant GoelandBen Brandt 27191913e9 agent: Accumulate and persist cumulative token usage for threads (#58378)
`Thread::cumulative_token_usage` has been dead code since the agent2
rewrite: the field was added as a persistence placeholder in #36483 with
`#[allow(unused)]`, and the accumulation logic was deleted along with
agent1 in #40495. Since then, every saved thread persists
`cumulative_token_usage` as `{}` in `threads.db`, breaking offline
token-usage analysis and silently degrading eval reporting (`eval_cli`
prefers this value and was always falling back to the last request's
snapshot, undercounting multi-step turns).

This PR restores the accumulation, mirroring the original agent1
implementation:

- Providers emit multiple cumulative-per-request `UsageUpdate` snapshots
during a single request, so naive `+=` would double-count. We track the
previous snapshot for the in-flight request
(`current_request_token_usage`) and accumulate only the delta, resetting
the tracker each time a new completion request is built in
`run_turn_internal`. This counts each request exactly once, including
tool-call rounds and retries within a turn.
- Unlike agent1, the delta uses per-field `saturating_sub` instead of
the panicking `Sub` impl, so a provider reporting a smaller snapshot
can't crash Zed.
- Removed the `#[allow(unused)]`; the value now round-trips through
`to_db`/`from_db`, surviving restarts and continuing to grow when a
thread is reopened.
- Added a `cumulative_token_usage()` accessor following the
`latest_request_token_usage` convention.

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: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-06-04 15:24:02 +00:00
Oleksiy Syvokon 569511a1a3 ep: Cap identifiers for LSP context retriever (#58539)
Release Notes:

- N/A
2026-06-04 14:30:21 +00:00
Sathwik ChirivelliandYara 🏳️‍⚧️ 3d4d879681 git_ui: Disable CommitView diff hunk controls (#58514)
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:

- Fixed a bug where diff hunk controls were being displayed in the
non-editable commit view multibuffer.

Co-authored-by: Yara 🏳️‍⚧️ <git@yara.blue>
2026-06-04 12:55:44 +00:00
Oleksiy Syvokon 61cdd8d180 Fix infinite loop when inferring outline body range (#58536)
This test would cause an infinite loop without the fix.

Closes #53298 and #54069

Release Notes:

- Fixed high CPU usage when using Zeta in some cases (thanks
@clupprich!)
2026-06-04 12:26:03 +00:00