Commit graph

37809 commits

Author SHA1 Message Date
Richard Feldman
29ca37fdcc
Load global AGENTS.md into native agent system prompt (#56757)
Watches a user-global `AGENTS.md` file alongside `settings.json` (at
`~/.config/zed/AGENTS.md` on macOS/Linux, `%APPDATA%\Zed\AGENTS.md` on
Windows) and includes its trimmed contents in the native agent's system
prompt.

This matches the pattern used by Codex (`CODEX_HOME/AGENTS.md`,
defaulting to `~/.codex/AGENTS.md`) and OpenCode
(`~/.config/opencode/AGENTS.md`): personal instructions live next to
other app config and apply across every project the user opens.

## Behavior

- Native Zed agent only. Not passed to ACP / external agents.
- Reads the local config dir, so SSH-remoted projects still get the
local user's personal `AGENTS.md` (project rules continue to come from
the remote workspace).
- Missing, empty, or whitespace-only files are silently treated as no
`AGENTS.md`.
- Read errors surface through the same notification UI as settings
errors, with a stable notification ID that's dismissed once the file
becomes readable again.
- The file is read in full, matching how existing project rules / repo
`AGENTS.md` files are loaded today.

## System prompt rendering

In the system prompt, the user-global `AGENTS.md` appears as `###
Personal AGENTS.md` immediately before `### Project Rules`, so the model
sees personal defaults first and project guidance later (project rules
take precedence on conflicts).

## Tests

- `user_agents_md` watcher: initial load, empty/whitespace ignored,
reacts to file edits.
- `SystemPromptTemplate`: renders personal `AGENTS.md` before project
rules; omits the section when no user `AGENTS.md` is present.

Closes AI-231

Release Notes:

- Added support for a global `AGENTS.md` file alongside `settings.json`
that is automatically included in the agent's instructions for every
project.
2026-05-14 15:02:33 +00:00
Ben Brandt
d4a3e0d5c9
sidebar: Track terminal agent thread telemetry (#56723)
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-05-14 14:47:30 +00:00
Danilo Leal
e80b7443ea
git_ui: Improve GitHub avatar display (#56755)
We had a problem that became more evident to me in the newly-introduced
History tab in the Git panel where the avatars wouldn't show up for a
long time. Problem was that we were trying to render the avatar before
the GitHub user email came in, and that wouldn't work well because it
would 1) skip the fast CDN (which could get rate-limited fast), and 2)
cache the `None` result. So this improvement works by only attempting to
render the avatar when the email is available.

Release Notes:

- Git UI: Improve the display of user avatars in Git-related surfaces.
2026-05-14 14:43:03 +00:00
Marshall Bowers
58d24a610b
client: Attach system ID to sign-in request (#56675)
This PR makes it so we send up the system ID as a query parameter
alongside the native app sign-in request.

Closes CLO-769.

Release Notes:

- N/A
2026-05-14 13:29:49 +00:00
Danilo Leal
c937fc6e33
git_panel: Allow to switch between changes and history tab with keyboard (#56743)
Follow-up to https://github.com/zed-industries/zed/pull/56500. Was
missing this ability very much :)

Release Notes:

- Git Panel: Added the ability to switch between the changes and history
tabs with the keyboard.
2026-05-14 13:11:14 +00:00
Cameron Mcloughlin
80b11f4839
git: Add setting to hide stage/restore buttons (#56740)
With long lines or a small viewport, the stage/restore buttons often
cover code.

Adds a setting to hide the buttons altogether. Defaults to showing them.

Release Notes:

- Added: Setting to hide Git Stage/Restore buttons
2026-05-14 12:37:00 +00:00
Ben Kunkle
4742e75bc9
ep: Send settled data to cloud (#56572)
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-05-14 11:55:18 +00:00
Danilo Leal
29db565437
markdown: Fix default UI font rendering in Mermaid diagrams (#56695)
Release Notes:

- Fixed Mermaid diagrams not rendering with the default UI typeface.
2026-05-14 11:15:08 +00:00
procr1337
9fe2931297
agent: Fix tool paths preferring files in subdirectories named after the project root (#56230)
The tool definition is very clearly contradicting the previous behavior.
Performance impact is unclear to me, we increase the work in a
potentially expensive loop, but it seems necessary to have both the
specified behavior from the tool definition, as well as the
heuristic/fallback for misbehaving models that seems to be intended.

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

Release Notes:

- Fixed tool paths preferring files in subdirectories named after the
project root
2026-05-14 10:12:56 +00:00
Kirill Bulatov
1376b200c8
Remove code lens from the diff view (#56726)
RHS does not show code runnables already, and lens blocks break the
background highlights, hence remove them too.

Before:

<img width="1728" height="1084" alt="before"
src="https://github.com/user-attachments/assets/6e942568-dcbf-4624-86f6-7f3f31d01d31"
/>

After:

<img width="1728" height="1084" alt="Screenshot 2026-05-14 at 11 13 05"
src="https://github.com/user-attachments/assets/ec3bfcb9-daab-4a33-b799-db86ac352488"
/>

Release Notes:

- Removed code lens from the diff view
2026-05-14 09:39:44 +00:00
Mikhail Pertsev
b01a145fd0
editor: Extract navigation out of editor.rs (#56634)
cc @SomeoneToIgnore

## Summary

Follow-up to #56409. I addressed the formatting issues and other stuff
from the previous PR

This keeps `editor.rs` around 15k lines.

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-05-14 07:20:51 +00:00
HuaGu-Dragon
75f0940a58
Vim/Helix: Prevent undo grouping when any LSP completion (#53980)
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

## Summary  
Prevent undo grouping when an LSP completion includes extra edits so
that the completion and its extra edits are applied and reverted
atomically.

## Problem
When applying an LSP completion that also applies extra edits, the
editor may merge that completion into the surrounding undo group or
split the transaction while waiting for edits, causing undo to leave the
buffer in an inconsistent state.

## Solution
* Always block undo merging for completions

Closes #ISSUE

Release Notes:

- Prevent undo grouping when any LSP completion
2026-05-14 06:39:33 +00:00
Ben Brandt
cad7406d52
agent_ui: Require an open project for agent panel (#56577)
A bit brute force, but it works.

<img width="1106" height="988" alt="image"
src="https://github.com/user-attachments/assets/d23f9a80-01c5-4ad3-a280-faf8b8bc9dbe"
/>


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: Danilo Leal <daniloleal09@gmail.com>
2026-05-14 01:24:30 +00:00
Nathan Sobo
3a8d012d1a
Fix macOS find query seeding (#56681)
Closes #55619

### Summary

- Route `buffer_search::UseSelectionForFind` through
`BufferSearchBar::deploy` instead of updating the query editor directly.
- Add an explicit seed-query override to `deploy`, so the Cmd-E action
can force `SeedQuerySetting::Always` while regular deploy callers
continue to pass `None` and respect the user’s
`seed_search_query_from_cursor` setting.
- By going through `deploy`, Cmd-E now also runs the search path that
keeps buffer-search navigation state in sync:
  - shows/initializes the search bar for the active searchable item
  - applies the seeded query via `search_suggested`
- calls `search`, which updates the query editor, search options, active
search query, search history, and macOS find pasteboard
  - refreshes `searchable_items_with_matches` and `active_match_index`
  - activates the current match after the search completes
- This ensures the subsequent Cmd-G action has the expected active
query, match list, search token, and active match index to select the
next result.
- Add a macOS-only end-to-end regression test using the default macOS
keymap with `simulate_keystrokes("cmd-e")` and
`simulate_keystrokes("cmd-g")`.

### Validation

- `cargo test -p search test_cmd_e_then_cmd_g_uses_selection_for_find`
- `cargo fmt --check --package search --package zed_actions`
- `./script/check-keymaps`
- `cargo check -p search`
- `cargo check -p workspace`
- `cargo check -p vim`

Release Notes:

- Fixed macOS Cmd-E/Cmd-G find behavior so Cmd-E seeds find from the
cursor or selection and Cmd-G advances through the newly seeded matches.
2026-05-13 23:35:10 +00:00
Anthony Eid
41c710b0a2
git: Allow choosing branch diff target in branch diff view (#56569)
### Summary

Added a branch diff base branch picker that shows the selected diff base
and prioritizes branches on the active branch’s remote. This also
generalizes the branch picker’s checkout vs. select only behavior so its
UI/search/rendering can be reused by a future git graph picker, and
makes branch diff drop stale in progress base update tasks when the base
or repository changes for faster response.

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

Release Notes:

- git: Allow choosing branch diff base in branch diff view

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
2026-05-13 23:15:35 +00:00
Ben Brandt
ffe4f4f5be
agent_ui: Fix full-width thread view layout (#56684)
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

Closes #56677

Release Notes:

- Agent: Fix squashed message editor when `limit_content_width=false`
2026-05-13 21:29:21 +00:00
Ben Brandt
a7f037d94b
sidebar: Remove agent panel terminal feature flag (#56678)
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:

- Add the ability to create Terminal Threads in the Sidebar and Agent
Panel.
2026-05-13 21:21:52 +00:00
zed-zippy[bot]
7d8fe38b56
Bump Zed to v1.4.0 (#56653)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-05-13 17:25:55 +00:00
Caio Piccirillo
ae9e177300
Add colors for vim mode in One theme (#56662)
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:

- Update vim mode colors on One theme

# Screenshots:
## Dark

### Vim:
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/5d74753e-d79f-4507-874e-eee8e8ad77de"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/cf3a1945-1a14-48a8-aeb2-ed1a525f91b7"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/77b83ff3-ee1c-465c-a783-4e1deefbe65b"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/2e4ebb69-7bfc-407c-b04e-d4a8fc6df220"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/2d736682-54c1-4db3-9fd1-9ab72b1e1497"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/d796c7a9-c8c9-4bc8-81de-0a44f8b5b0e3"
/>

### Helix:
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/9de5d340-db45-4597-b3fe-2ea503f11909"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/fcdce0e4-3a90-44da-80ff-6d524495dfe8"
/>

## Light

### Vim:
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/34b74e45-4bb4-4388-b7de-50351bf3860c"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/3a66fa4b-0911-4a02-931a-1dda2cf0a33c"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/7bd4492d-4dec-4f1d-b05c-7e60ecc8d549"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/b510107d-39d5-4841-9859-ed27261c9809"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/fb80f295-dcc6-4a73-8d65-15dc133eb3ce"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/d21249ce-fd29-48a3-9c0f-e92e1aacba36"
/>

### Helix:
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/f748cfb4-4584-481b-b880-e77b6be92041"
/>
<img width="338" height="28" alt="image"
src="https://github.com/user-attachments/assets/5cad3bf0-591d-4436-82a6-cb65af9f9be7"
/>
2026-05-13 17:19:00 +00:00
Danilo Leal
477e524e56
Improve update button version display (#56647)
This PR adds a small refinement to the update button, removing
truncation from the version we display. Instead of just showing the
short version of a SHA, we now display it in full, providing more
detailed information that sometimes was lost. Also am making the button
disabled when it's in the checking, downloading, and installing states,
given clicking on it at these moments doesn't do anything.

Release Notes:

- N/A
2026-05-13 16:29:58 +00:00
Ben Kunkle
49c6f78fc1
ep: Allow setting expected patch in rate completions modal (#56629)
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

Closes #ISSUE

Release Notes:

- Added the ability to input the "expected patch", i.e. what the model
should have predicted in the `edit prediction: rate completions` modal
2026-05-13 16:03:01 +00:00
Ben Kunkle
f56219e503
Fix basic_terminal test flake (#56659)
Missed a test in #56194 with the same issue, and it bit me today :(

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-05-13 15:51: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
Piotr Osiewicz
048831a453
build: Reduce dev debug info level from full to limited (#56656)
This reduces a rebuild time from editor (a legit one) from 28s to 18s.
For those of you who do use the debugger, there's a new `dbg` profile.

Self-Review Checklist:

- [ ] 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 #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-13 15:41:13 +00:00
Ben Kunkle
8c74db00c4
acp: Fix startup error race condition test flake (#56654)
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

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-13 15:24:17 +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
Ben Kunkle
074585934c
copilot: Bypass Copilot LSP node shim (#56635)
We currently run node on the JS wrapper around the native binaries
shipped with https://github.com/github/copilot-language-server-release.
According to their README, this is not required, and it seems like it is
just an option provided so that you can run the server with `npx`.

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

Closes #55891

Release Notes:

- Stopped relying on node for running the Copilot language server that
provides edit predictions. The system node version should no longer
affect whether Copilot edit predictions work in Zed
2026-05-13 14:48:39 +00:00
Smit Barmase
7ef2aff7c8
agent_ui: Fix Agent Panel terminal New Thread panic (#56645)
Fixes a panic when `agent::NewThread` creates an Agent Panel terminal
while the workspace is already being updated.

Release Notes:

- N/A
2026-05-13 14:38:09 +00:00
María Craig
cd2b80710e
docs: Clarify how to open new threads from the empty state (#56640)
Clarifies that in the empty state, the "New Thread…" menu is exposed as
the agent selector button on the left, rather than the `+` button in the
top-right toolbar. Adds this note to the Getting Started sections for
Gemini CLI, Claude Agent, and Codex in `external-agents.md`, and
reorders the description in `agent-panel.md` to mention the empty state
first.

Release Notes:

- N/A
2026-05-13 13:59:37 +00:00
Ben Brandt
8109e55acf
sidebar: Omit placeholder agent terminal titles (#56612)
there was a "flicker" because it was showing "Terminal" for a
split-second

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-05-13 13:58:10 +00:00
Bennet Bo Fenner
956dbea79a
copilot: Fix cache control error (#56632)
#56472 broke Copilot chat

> Failed to connect to API: 400 Bad Request {"message":"cache_control:
Extra inputs are not permitted"}

This PR makes it so that we still use the legacy caching approach for
Copilot

Release Notes:

- N/A
2026-05-13 13:34:47 +00:00
Xiaobo Liu
6aaea4d10a
file_finder: Support line range queries with path:start-end syntax (#53958)
Release Notes:

- Added support for opening a file with a line range selected in the
file finder using the `path:start-end` syntax (e.g. `file.rs:10-20`).

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-05-13 12:43:39 +00:00
Ben Kunkle
481854f754
ep: Various ep CLI improvements (#56587)
- limit diagnostics sent to teacher
- improve parallelism in `ep` commands when using `--max-parallelism` by
only grouping by repo when instructed too (repo grouping is only useful
for context collection)
- update rejected and rated queries to also fetch settled editable
region

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-05-13 11:34:50 +00:00
Finn Evers
3d8495757d
docs: Clarify more extension publishing steps (#56620)
Release Notes:

- N/A
2026-05-13 10:42:38 +00:00
Cameron Mcloughlin
2301e61d2a
agent_ui: Mermaid diagrams (#56430)
Adds mermaid diagrams to the agent UI

Defaults to rendering the diagram, toggle to switch back to code.

<img width="605" height="837" alt="image"
src="https://github.com/user-attachments/assets/ed87f4e3-77f3-4602-b783-65eda909ad01"
/>
<img width="615" height="334" alt="image"
src="https://github.com/user-attachments/assets/1a422c83-fed4-4099-b895-b5a16e9d2222"
/>


Also makes markdown preview markdown rendering use theme colors:

Before:
<img width="593" height="781" alt="image"
src="https://github.com/user-attachments/assets/8598ca42-d44a-426b-ac4a-fb3cd1288780"
/>

<img width="593" height="781" alt="image"
src="https://github.com/user-attachments/assets/737fdd62-0a37-48dd-a13a-4e11bf80f038"
/>


Release Notes:

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

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-05-13 09:57:17 +00:00
Bennet Bo Fenner
495f8ba717
agent: Show checkpoints as soon as the model edits files (#56611)
Makes it so that "Restore checkpoint" shows up as soon as the model
performs an edit, instead of waiting until the turn ends

Release Notes:

- Fixed the agent panel to show "Restore checkpoint" as soon as the
agent starts editing instead of waiting until the turn ends
2026-05-13 09:35:49 +00:00
Cameron Mcloughlin
394f022be1
editor: Extend underlines into inlay hints (#56407)
bad:
<img width="577" height="118" alt="image"
src="https://github.com/user-attachments/assets/52fc13a3-d644-42c3-bd69-048caf85d7bd"
/>
good:
<img width="617" height="130" alt="image"
src="https://github.com/user-attachments/assets/040b26b7-8ee9-4202-bc26-2c995c735286"
/>

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-13 06:52:46 +00:00
Peter Tripp
cc84bed4eb
Support SCP style SSH URLs (#56304)
Closes: 
- https://github.com/zed-industries/zed/discussions/56359

Self-Review Checklist:

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

Open to feedback or alternate approaches.
Could do `--ssh user@host:~code/proj` if preferred.
Or really cowboy it: regex replace `s|:~|/~|` and `s|:/|/|`; re-attempt
`Url::parse`

CC: @ConradIrwin

Release Notes:

- Add support for SCP style SSH urls: `zed ssh://user@host:~/code/proj`
2026-05-13 02:05:59 +00:00
Oleksandr Kholiavko
ef341146d2
csv_preview: Add settings UI panel with debug tools during development (#53496)
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

------

This PR adds a settings panel above the CSV table with dropdown menus to
control rendering behavior, and a performance metrics overlay for
debugging.

Currently it's mostly used for me during dev phase, but before release
of CSV preview feature all dev-only options will be cleaned up, and
future features like "copy selected" will have their settings in this
bar

<img width="2260" height="1674" alt="image_2026-04-09_11-52-24"
src="https://github.com/user-attachments/assets/9039fd59-5c46-4be4-9f33-b9825a3cdce3"
/>


**What changed:**

- Adds `render_settings_panel()` method with dropdown menus for:
- **Rendering Mode**: Variable Height (multiline support) vs Uniform
Height (better performance)
  - **Text Alignment**: Top vs Center vertical alignment within cells
- **Font Type**: UI Font vs Monospace for better readability (will be
exposed to user settings)
  - **Experimental**: Popover menu with toggles for debug features
- Adds `render_performance_metrics_overlay()` method showing:
  - CSV parsing duration
  - Rendered row count and indices
  - Positioned in bottom-right corner with semi-transparent styling

Context:
Will iterate on it with @Anthony-Eid 

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-05-13 00:44:26 +00:00
Richard Feldman
fe9f956460
Restrict tools from editing sensitive agents folders (#56456)
Treat `.agents/skills/` (project-local) and `~/.agents/skills/` (global)
as **sensitive paths**, on par with `.zed/` and the global config
directory. The agent's built-in editing tools (`edit_file`,
`write_file`, `create_directory`, `delete_path`, `move_path`,
`copy_path`) now require explicit user authorization before modifying
anything inside those paths, because the contents of skill files control
agent behavior.

This protection is worth landing on its own, ahead of Zed adding its own
skills support: other agents (e.g. Claude Code) already write skill
files into these locations, so a Zed installation may already have
skills on disk that should not be silently editable by the agent.

Also tightens the **pre-existing `.zed/` check** to compare path
components case-insensitively. macOS and Windows use case-insensitive
filesystems by default, so without this fix a malicious settings author
could bypass the local-settings classifier with `.ZED/settings.json`
(the canonicalized inode would match, but the path-component comparison
would miss it). The new `.agents/skills/` check has the same hazard and
now shares a single `component_matches_ignore_ascii_case` helper with
the `.zed/` check.

Introduces the `agent_skills` crate, scoped for now to just the path
constants and helpers (`global_skills_dir`,
`project_skills_relative_path`, `SKILL_FILE_NAME`) so the
tool-permission machinery can recognize the agent skills tree without
depending on a skill discovery / parsing / loading layer. Those will
land in follow-up PRs.

Closes AI-217

Release Notes:

- Agent: Require user confirmation before letting tools modify files
inside `.agents/skills/` (per-project) or `~/.agents/skills/` (global),
so skills installed by any agent are protected from unsolicited edits

---------

Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
Co-authored-by: Martin Ye <martinye022@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-05-12 22:47:51 +00:00
Richard Feldman
800a795545
bedrock: Add system-prompt cache anchor on caching-capable models (#56474)
The Bedrock Converse API supports placing `CachePoint` blocks inside the
`system` field, but we were sending the system prompt as a single
`SystemContentBlock::Text`, which leaves the system tokens dependent on
whatever message-level breakpoint happens to fall within the 20-block
lookback window.

This widens `bedrock::Request.system` from `Option<String>` to
`Vec<BedrockSystemContentBlock>` and has `into_bedrock` emit
`[Text(system), CachePoint(Default)]` whenever the model supports prompt
caching. The system prompt now anchors its own cache prefix, on top of
the existing tool-list anchor and per-message breakpoint, so a stable
system prompt keeps producing cache hits even when earlier conversation
turns change.

Bedrock does not support automatic caching or the 1-hour TTL, so the
default 5-minute ephemeral cache is the only option for this provider.

Release Notes:

- Improved Bedrock prompt cache utilization by anchoring the system
prompt as its own cache prefix
2026-05-12 22:46:29 +00:00
Mikhail Pertsev
249f427f10
vim: Add Helix jump-to-word support to Vim mode (#55492)
Closes #55481

Adds Vim-mode access to the existing Helix jump-to-word overlay via `g
z`. We use `g z` because it is currently unassigned in Vim mode, while
`g w` is already used for rewrap.

Most of the implementation lives in `helix.rs` because the existing jump
overlay, label generation, and Helix/Vim modal behavior are currently
intertwined there. This keeps the change small and reuses the existing
navigation overlay logic instead of doing a broader refactor.

In Vim normal mode, jump labels behave like a cursor motion: selecting a
label moves the cursor to the start of the target word without selecting
it. In Vim visual mode, jump labels extend the selection like a Vim
word-start motion, preserving Vim’s inclusive visual-selection 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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added Vim-mode jump-to-word navigation on `g z`.
2026-05-12 21:46:18 +00:00
Matthias Endler
064a17fd12
agent_ui: Fix panic when multiple rewrite tool uses share a char offset counter (#52458)
## Context

The process_tool_use closure used a single chars_read_so_far counter
shared across all REWRITE_SECTION_TOOL_NAME tool use events. When the
LLM produced multiple separate rewrite tool uses (different IDs), the
counter from the first tool use carried over into the second. If the
second tool use had a shorter replacement_text, the slice indexing
panicked with index out of bounds.

(This caused my first ever Zed panic today.)

Fix by tracking bytes-read per tool use ID using a HashMap keyed on
LanguageModelToolUseId. Also replace the direct slice index with .get()
so any remaining out-of-bounds case is handled gracefully instead of
panicking.

Looks like it hasn't been reported yet. At least I couldn't find any
related issues.

## How to Review

I hope the fix is pretty self-explanatory. We keep track of multiple
rewrite tools, which explains the extra ceremony around getting the
right character count, but apart from that it's pretty straightforward.

The performance impact should be neglible because:

1. Once the completion stream ends (or the task is dropped/cancelled),
the entire Arc<Mutex<HashMap>> is freed.
2. The number of entries is tiny. In a single completion request the LLM
will produce at most a handful of
REWRITE_SECTION_TOOL_NAME tool uses. Each entry is just an Arc<str> key
+ usize value.

So the HashMap grows for the duration of one handle_completion call and
is then dropped wholesale.

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

- Fixed an out-of-bounds panic when the AI produced multiple inline
rewrites in a single completion.
2026-05-12 21:35:17 +00:00
Richard Feldman
ad916ca1af
anthropic: Use automatic prompt caching with long-lived anchors on tools and system (#56472)
Switches the Anthropic provider from hand-stamping `cache_control` onto
the last message content block over to Anthropic's top-level automatic
prompt caching, paired with explicit long-TTL (1h) anchors on the last
tool definition and on the system prompt.

The prefix order `tools` → `system` → `messages` satisfies Anthropic's
requirement that longer TTLs appear earlier in the prefix, so the static
prefix is cached for 1h (surviving idle gaps longer than the 5-minute
default) while the rapidly-changing conversation tail uses the
free-to-refresh 5-minute TTL via the top-level automatic breakpoint.
Three of the four available cache breakpoints are used (last tool,
system, automatic conversation), leaving one in reserve.

As a side benefit, this fixes a latent issue where the previous stamping
loop could place `cache_control` on a `Thinking` content block, which
the Anthropic API does not allow. Automatic caching is documented to
walk past ineligible blocks (including thinking) when selecting its
breakpoint, so we now delegate that responsibility to the server.

The new shape we send (when caching is enabled):

```json
{
  "tools": [{ "...": "...", "cache_control": {"type": "ephemeral", "ttl": "1h"} }],
  "system": [
    {"type": "text", "text": "...", "cache_control": {"type": "ephemeral", "ttl": "1h"}}
  ],
  "messages": [ /* no per-block cache_control */ ],
  "cache_control": {"type": "ephemeral"}
}
```

Release Notes:

- Improved Anthropic prompt cache utilization, reducing latency and cost
for ongoing conversations

---------

Co-authored-by: Martin Ye <martinye022@gmail.com>
2026-05-12 21:09:39 +00:00
Cameron Mcloughlin
4074eabb3d
agent_ui: Images (#56427)
Adds images to the agent panel

Release Notes:

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

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-05-12 21:03:27 +00:00
liam
aa9f4ede6c
Clip flex editor blocks to the text viewport (#56549)
Resolves https://github.com/zed-industries/zed/issues/56518

This diff fixes code lens decorations continuing to paint into the
gutter when the editor is horizontally
scrolled. Code lens entries were rendered as flex editor blocks with
explicit gutter padding, which allowed
them to bypass the text viewport clipping used by content-only blocks.

With this change, code lens entries render as spacer-style custom blocks
instead. Spacer blocks already
scroll with buffer content and paint through the text-side mask, so the
code lens padding can be relative to
the editor text area and decorations clip at the left edge of the
viewport.

| Before | After |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/dc567ce5-ad04-4ba2-9156-ec4ec087bd41"
controls width="320"></video> | <video
src="https://github.com/user-attachments/assets/abb5ba2c-981f-4399-903b-0f8fa9a560e4"
controls width="320"></video> |

Release Notes:
- Fixed code lens decorations painting outside the editor viewport when
horizontally scrolling.
2026-05-12 20:06:01 +00:00
Conrad Irwin
54188321be
Fix token refresh for HTTP requests (#56559)
Code had been assuming (erroneously, but understandably) that
LlmApiToken::acquire would give them a valid token.

This is not true, as those tokens expire and you must call refresh
explicitly.

Add some helpers to do the retry for you, and rename acquire to cached
to be
clearer about the intent.

Closes #ISSUE

Release Notes:

- Fixed some rare cases where API requests would fail with Unauthorized
2026-05-12 19:40:00 +00:00
Smit Barmase
64f624773f
git_ui: Add force delete for worktrees (#56519)
Follows similar approach as
https://github.com/zed-industries/zed/pull/55927

Adds a force-delete path to the worktree picker. Normal delete now
prompts when Git reports modified or untracked files, and
Alt/Option-delete can force delete directly.

  Release Notes:

- Added support for force deleting worktrees that contain modified or
untracked files.
2026-05-12 19:17:49 +00:00
KlausUllrich
1c61cc3fc2
gpui: Fix scrollbar drag position calculation in list (#53378)
## Summary

Fixes scroll position inversion when content height changes during a
scrollbar drag (e.g. in the agent panel while streaming responses).

### Root cause

`set_offset_from_scrollbar` used the **live** `items.summary().height`
for `content_height` and computed a `drag_offset` correction (`live −
frozen`). However, `max_offset_for_scrollbar()` → `max_scroll_offset()`
already uses the **frozen** `scrollbar_drag_start_height` during drag.
This mismatch means:

1. The scrollbar computes thumb position using the frozen height range
2. `set_offset_from_scrollbar` converts that position using the live
height range
3. As content grows during drag, `drag_offset` increases
4. `(point.y - drag_offset).abs()` produces an incorrectly large value,
overshooting `scroll_max`

The `.abs()` call also masked the sign convention:
`compute_click_offset` (in `scrollbar.rs`) returns `-max_offset *
percentage` — a negative value — but `.abs()` converted it regardless of
sign, hiding the mismatch.

### Fix

- Use `scrollbar_drag_start_height` (frozen during drag) for
`content_height` in `set_offset_from_scrollbar`, matching
`max_scroll_offset()`. Both sides of the scrollbar mapping now use the
same height reference.
- Replace `(point.y - drag_offset).abs()` with `(-point.y)` to correctly
convert the negative scroll offset.
- Remove the symmetric `drag_offset` from
`scroll_px_offset_for_scrollbar`, which reported position back to the
scrollbar and suffered from the same inconsistency.
- Update existing tests to use negative offsets, matching the actual
values produced by the scrollbar component.
- Add a regression test that freezes height, grows content, drags the
scrollbar, and asserts the position is correct.

## Test plan

- [x] Existing tests updated to use correct sign convention (negative
offsets)
- [x] New regression test `test_scrollbar_drag_with_growing_content`:
verifies scroll position remains correct when content grows during a
scrollbar drag
- [ ] Manual: open agent panel, start a long generation, drag scrollbar
while content is streaming — position should track the thumb correctly

Release Notes:

- Fixed scrollbar position jumping or inverting when content height
changes during a scrollbar drag (e.g. in the agent panel while
streaming).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-05-12 19:17:38 +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