Commit graph

37941 commits

Author SHA1 Message Date
María Craig
814443a466
docs: Fix skill installation instructions (#57289)
Fixes the skill installation instructions in `docs/src/ai/skills.md`.

The previous steps used a `git sparse-checkout` approach that was
inaccurate — the cloned repo would land nested inside the skills folder,
and the sparse-checkout path was wrong for repos that store skills in a
subdirectory. Replaced with a simple instruction to copy the skill's
folder into the appropriate location.

Release Notes:

- N/A
2026-05-20 17:54:47 +00:00
liam
d2953a2b57
Hide agent actions in embedded terminal menus (#56256)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / extension_tests (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
Resolves https://github.com/zed-industries/zed/issues/56138

This diff hides terminal agent actions from context menus shown by
embedded terminal views, such as terminal tool output in agent threads.
Those surfaces render through `TerminalView`, but they are not normal
interactive terminal panes, and actions like Inline Assist and Add to
Agent Thread do not currently resolve the embedded terminal as their
target.

Previously, choosing Inline Assist from terminal tool output could
target the workspace’s active editor instead of the terminal output. The
context menu now limits these agent actions to non-embedded terminal
views, so regular terminal panes keep their existing behavior while
terminal tool output no longer offers actions that cannot resolve to it.

Add to Agent Thread _could_ make sense for embedded terminal selections
in the future, but it would need explicit target-resolution support for
focused embedded terminals. This change keeps that as separate follow-up
work instead of leaving a misleading menu item that does not reliably
act on the selected tool output.

Release Notes:
- Fixed embedded terminal context menus showing agent actions that could
target the wrong item.
2026-05-20 16:03:16 +00:00
María Craig
bb63046a08
docs: Add Skills settings documentation (#57273)
Adds documentation for the Skills settings UI introduced alongside the
Skills feature.

## Changes

- **Updated** `docs/src/ai/skills.md`:
- Updated "Create your own" to lead with `/create-skill` and mention the
Skill Creator UI as a secondary option
- Added "Managing Skills" section documenting the Settings Editor Skills
page (view, open, delete skills)

Release Notes:

- N/A
2026-05-20 15:34:06 +00:00
zed-zippy[bot]
3a81f8e9ab
Bump Zed to v1.5.0 (#57272)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-05-20 14:45:29 +00:00
Kirill Bulatov
80c0f7de0a
Stop building semantic highlights on the main thread (#57264)
Trace on `main` that showed the hogged main thread: 
[Sample of Zed
Nightly.txt](https://github.com/user-attachments/files/28060310/Sample.of.Zed.Nightly.txt)


Release Notes:

- N/A
2026-05-20 14:12:42 +00:00
María Craig
dd528e3efb
docs: Add Skills documentation (#57095)
Adds documentation for the new Skills feature, which replaces Rules
starting in Zed v1.4.0.

## Changes

- **New page**: `docs/src/ai/skills.md` — covers what skills are,
finding and installing skills from skills.sh, using skills via slash
commands and model invocation, creating a skill (folder structure,
SKILL.md format, frontmatter fields, bundled resources), where skills
live (global vs project-local), security model, and limitations
- **Updated**: `docs/src/ai/rules.md` — added deprecation notice
pointing to Skills
- **Updated**: `docs/src/SUMMARY.md` — added Skills entry above Rules in
the AI section
- **Updated**: `docs/src/ai/agent-panel.md` — replaced reference to
"rules files" with "skills" in the Adding Context section

Release Notes:

- Added documentation for the Skills feature

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-05-20 14:10:59 +00:00
Danilo Leal
a4c6a8392d
settings_ui: Fix skills link (#57265)
This PR ensures clicking to copy the skills link in the settings UI
works properly.

Release Notes:

- N/A
2026-05-20 14:00:43 +00:00
Ben Brandt
43b7ca9cc2
terminal: Fix pty info change detection race (#57257)
I think I introduced this at some point in the terminal agent situation.

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-20 13:13:00 +00:00
Ben Brandt
1103bd8055
agent_ui: Improve agent terminal notification visibility logic (#57248)
Aligns Terminal notifications much closer to Thread notifications

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-20 12:47:18 +00:00
Oleksiy Syvokon
d33a3186aa
Respect max line limit for invisible character replacements (#57137)
This change makes sure that `LineWithInvisibles::from_chunks` applies
the max line length limit to invisible character replacements as it does
to normal text chunks.

Without this change, pathological lines containing many invisible
characters could produce unbounded number of line fragments.

Closes FR-6.

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:

- Fixed a rare panic that could occur when lines in the editor contained
many invisible characters.
2026-05-20 12:41:02 +00:00
Marshall Bowers
bc363322af
Upgrade tree-sitter to v0.26.9 (#57183)
This PR upgrades `tree-sitter` to v0.26.9.

We're interested in
https://github.com/tree-sitter/tree-sitter/pull/5605, which should fix a
panic when loading certain grammars.

Closes FR-1.

Release Notes:

- Fixed a panic when loading certain Tree-sitter grammars containing
supertypes.
2026-05-20 10:46:54 +00:00
Cameron Mcloughlin
e82c04b356
agent: Pull diagnostics (#56663)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_style (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
Currently, the `diagnostics` tool queries the current state of the
workspace. However, if the LSP is slow to update diagnostics, this can
lead to stale diagnostics being given to the agent.

This PR changes the `diagnostics` tool to attempt to pull fresh
diagnostics. If it fails, it informs the agent and falls back to the old
behaviour (not all LSPs support pull-based diagnostics).

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-20 08:57:46 +00:00
Bennet Bo Fenner
80d41375e5
agent: Save files when model uses rename tool (#57228)
Release Notes:

- N/A
2026-05-20 08:36:32 +00:00
Tom Houlé
5656f3eb3f
client: Use cloud as source of truth for the selected organization (#57140)
Now that the cloud platform exposes a system-settings endpoint for the
user's selected organization, switch `UserStore` over to it and drop the
local database persistence. The server already returns the current
selected organization for `get_authenticated_user()`.

set_current_organization becomes a optimistic, with the in-memory
selection updated immediately. hen a background task POSTs to the system
settings endpoint.

Stale current_organization_id rows from older installs are left dangling
— harmless and not worth a migration. This is the second step in moving
organization selection to cloud; the first added the
update_system_settings client method.

Part of CLO-716

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2026-05-20 07:00:02 +00:00
Tom Houlé
0f6ebdd269
cli: Respect --new when opening URLs from the CLI (#54408)
`zed --new ssh://host/path/to/file` only created a new window on the
first call. Subsequent invocations silently reused the existing SSH
workspace for the same host, which then tried to open the new path
against the existing worktree and surfaced a
`DevServerProjectPathDoesNotExist` popup when the path didn't belong to
any open worktree.

The CLI correctly translated `--new` to `OpenBehavior::AlwaysNew`, but
the URL branch of `handle_cli_connection` dropped the `open_behavior`.
`handle_open_request` then called `open_remote_project` (and
`open_paths_with_positions` for `file://`) with
`OpenOptions::default()`, which is `WorkspaceMatching::MatchExact`, so
any existing SSH window for the same host won the match. The issue
applies to `file://` URLs and `-a` / `-e` / `--reuse` for URL-shaped
arguments in general; `--new` was just the most visible symptom.

The fix is making sure the translation of `OpenRequest` is uniform
across plain paths and URL-shaped arguments.

Closes #52679.

Release Notes:

- Fixed `zed --new ssh://host/path` reusing an existing SSH window
instead of opening a new one. This also applied to other URL-shaped path
arguments.
2026-05-20 06:58:10 +00:00
Liber
068d64edd6
vim: Fix n/N and */# selecting text after cmd+f search (#54027)
The cmd_f_search flag introduced in #51073 was never cleared when
switching to vim-style search commands, causing collapse_matches to
remain false and match ranges to appear as visual selections.

Reset cmd_f_search when n/N or */# are used, restore Normal mode if
Visual was entered due to the non-collapsed selection, and fix an early
return in visual select_match that leaked collapse_matches.

Fixes #53896

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 ...

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-05-20 03:39:36 +00:00
MartinYe1234
e2c38b5358
Replace Rules UI with Skills creation UI (#56924)
Replaces the legacy Rules creation UI with a focused "New Skill"
creation window when the `SkillsFeatureFlag` is on.

The new `skills_library` crate provides a single-skill form with:
- Name, Description, and Body fields (placeholders double as labels)
- Live validation matching the SKILL.md spec (name: 1–64 lowercase +
digits + hyphens, no leading/trailing hyphen; description: non-empty,
≤1024 chars)
- A scope dropdown listing every local worktree in the originating
workspace plus "Global"
- An Optional Parameters card with the `disable-model-invocation`
checkbox
- Save writes `<scope>/.agents/skills/<name>/SKILL.md` via
`serde_yaml_ng` (YAML-safe escaping), refuses to overwrite existing
skills, shows a success toast in the originating workspace, then closes
the window

The "Rules" entry in the agent panel triple-dot menu is renamed to
"Skills" when the flag is on. The existing `cmd-alt-l` keyboard shortcut
still works: `AgentPanel::deploy_rules_library` reroutes to
`deploy_skills_library` when the flag is on, so any persisted keymaps
and the menu's automatic shortcut lookup keep functioning without
changes to the default keymap files.

The old `rules_library` crate is intentionally left in place for this PR
— once the flag rolls out and the few remaining `OpenRulesLibrary {
prompt_to_select }` call sites (in thread_view link handlers and
@-mention crease) are migrated to an "open existing skill" flow, a
follow-up can delete the crate entirely.

15 unit tests cover the validation rules, frontmatter formatting
(including YAML-special-character round-tripping), and disk write
behavior (creates directory, refuses overwrite).

Closes AI-247

Release Notes:

- Added a new Skills creation UI that replaces the old Rules library
when the Skills feature flag is enabled.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-05-20 02:40:57 +00:00
David
661f185f9f
Add file icon for Ballerina (.bal) files (#56799)
## Summary

- Adds a `ballerina` icon key to the default icon theme, mapping the
`.bal` file suffix to a new SVG under
`assets/icons/file_icons/ballerina.svg`.
- Icon is the monochrome Ballerina mark from the official WSO2 VS Code
extension, rescaled to Zed's 16×16 viewBox.

## Icon source / license

The SVG is adapted from `ballerina-inverse.svg` in
[wso2/vscode-extensions](https://github.com/wso2/vscode-extensions),
which is Apache-2.0 licensed. The original 400×400 geometry is preserved
via the existing `translate`/`scale` transform; only the viewBox and
fill were normalized to match the convention used by the other icons in
`assets/icons/file_icons/`.

## Test plan

- [x] `cargo build --release --bin zed`
- [x] Opened a folder containing `.bal` files and confirmed the icon
renders in the project panel and tabs.
- [x] Alphabetical ordering preserved in both
`FILE_SUFFIXES_BY_ICON_KEY` and `FILE_ICONS`.

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-05-20 02:33:07 +00:00
Agus Zubiaga
7c10059340
ui: Add thousands separators to diff stats (#56754)
<img width="282" height="90" alt="CleanShot 2026-05-14 at 11 28 40@2x"
src="https://github.com/user-attachments/assets/34516022-0e26-4380-9e80-568256483309"></img>

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 diff stats by formatting large line counts with thousand
separators.
2026-05-20 02:22:25 +00:00
Danilo Leal
1ddf7407e9
Use the announcement toast for skills support (#56873)
Closes AI-244

This PR changes the approach for announcing skills support. It uses the
announcement toast, the same thing used for parallel agents, which
observes a specific version number to be displayed. I ended up
simplifying things a bit by thinking we could rely on documentation for
more detailed information (with more extensive paths and whatnot).

Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <richard@zed.dev>
Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
Co-authored-by: Martin Ye <martinye022@gmail.com>
2026-05-20 01:26:06 +00:00
Richard Feldman
2e70059cd9
Remove Skills feature flag (#57162)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / check_scripts (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
Removes the `skills` feature flag now that Skills are ready to ship to
all users. Cleans up all `cx.has_flag::<SkillsFeatureFlag>()` gates
across the agent, agent_ui, prompt_store, and title_bar crates, drops
the now-unused `feature_flags` dependency from `prompt_store` and
`title_bar`, and removes the dead `update_flags(true, vec!["skills"])`
calls from the agent's skills tests.

Closes AI-269

Release Notes:

- Enabled Skills for all users.

---------

Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
Co-authored-by: Martin Ye <martinye022@gmail.com>
2026-05-20 00:28:09 +00:00
Mikayla Maki
952119de41
Fix window crash (#57203)
Closes ZED-86Q

Fixes this (rare) crash by making entity creation via a window context
infallible.

The shape of the result is a bit clunky due to the type signatures
involved. The real solution is to remove AsyncWindowContext entirely and
move it's fallible APIs into WindowHandle, but until then this will give
you a simple starting point.

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-20 00:05:34 +00:00
Helmer Nordström
d42edc15f9
grammars: Add runnables.scm for C++ (#57161)
Added a runnables.scm for cpp grammar so that tasks can be made with the
play button. It is already implemented for C.
2026-05-19 22:03:01 +00:00
Tom Zaspel
1d207b02e0
docs: Update Tree-sitter reference in OpenTofu and Terraform languages (#57168)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-05-19 21:57:50 +00:00
Jakub Konka
7b6be29669
linux: Bundle libstdc++.so for release (#57132)
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 https://github.com/zed-industries/zed/issues/57073

Release Notes:

- Fixed running Zed on Ubuntu 20.04 installed via the installer by
bundling the required `libstdc++.so`.
2026-05-19 21:43:35 +00:00
Joseph T. Lyons
a11af20495
Disable auto watch when leaving a call (#57196)
Auto watch's lifespan should be tied to that of the call and it should
not be assumed the user wants to have this on indefinitely (until app
restart), as it's more of a niche feature. This PR disables it when the
user leaves a call.

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-19 21:31:34 +00:00
Danilo Leal
be0fc7fdf5
Add settings UI page for skills (#57101)
Closes AI-267

This PR adds a skills subpage in the settings UI, where we display
global skills in the user tab and project skills in the corresponding
project tab. The approach taken here was the simplest one out of the
possible avenues we could've taken to implement this (which would
possibly require bigger refactors), given this is potentially the very
first page in the settings UI where we're displaying stuff that does not
correspond to data available in the `settings.json`.

Important to note that a major limitation of the global approach is that
it's dependent on the native agent having loaded the skill index,
meaning there's an edge case where, if you open the settings UI _before_
having opened the agent panel, you won't immediately see the available
skills. Something to discuss but that it felt like a viable option for a
first ship.

Release Notes:

- Agent: Added a skills section to the settings UI.
2026-05-19 21:12:44 +00:00
Ben Brandt
0535f47291
sidebar: Don't block worktree archival on empty drafts (#57145)
If we have empty drafts, they don't show up in the UI, so you can't get
rid of them. But they currently blocked worktree archival. Which is
particularly troublesome with terminal agents in a few cases.

This should hopefully solve the issue for terminals, but I think I need
to do a follow-up to investigate what happens when the last draft is
closed.

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-19 21:08:39 +00:00
Ben Brandt
a39f1d163d
docs: Add more agent configuration examples (#57188)
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-19 21:08:14 +00:00
Ben Kunkle
ad042e5c9d
fs: Don't opt into polling for virtiofs based file systems (#57184)
Technically we don't know if a `virtiofs` file system supports `inotify`
or not, but it seems like it's mostly used inside virtual machines
provided by:
- OrbStack (`inotify` works)
- Docker Desktop (`inotify` works)
- Lima (`inotify` works with flag)
- Colima (`inotify` works with flag)
- QEMU + virtiofs setup (`inotify` doesn't work without extra setup)

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

Closes FR-9

Release Notes:

- Fixed an issue where file system watching would default to the polling
backend inside of `OrbStack` VMs on MacOS
2026-05-19 20:14:50 +00:00
María Craig
40d3c79f2f
Update workspace mentions in the sidebar (#54833)
Replaces "workspace" labels in the sidebar with more accurate
terminology:

- "Focus Last Workspace" → "Focus Last Project"
- "Focus Workspace" → "Focus Project"
- "Close Workspace" tooltip → "Close Worktree"

Release Notes:

- N/A
2026-05-19 20:05:13 +00:00
María Craig
69effe73d9
docs: Document Terminal Threads feature (#56679)
Adds documentation for the Terminal Threads feature — the ability to
open interactive terminals in the Agent Panel alongside threads.

## Changes

- **`agent-panel.md`**: Adds a new `## Terminals` section covering how
to open terminals, terminal titles, bell notifications, and closing.
Also adds a Terminal bullet to the `+` menu description in "Creating New
Threads".
- **`parallel-agents.md`**: Updates the page title, description, and
opening paragraph to include terminals alongside threads. Adds a note in
the Threads Sidebar section that terminals appear there too.

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-05-19 19:21:41 +00:00
Richard Feldman
8dff89c8d1
Fix Gemini schema conversion dropping anyOf and nullability (#57160)
Follow-up to #49292:

- **Bug fix in `push_any_of_constraint`**: when both an `anyOf` and a
non-empty `allOf` were already present at the same level, the existing
`anyOf` was silently dropped. Now it's always preserved.
- **Canonical OpenAPI nullability**: collapse `{nullable: true}`-only
entries out of `anyOf` onto the parent so `anyOf: [{type: "string"},
{type: "null"}]` becomes `{type: "string", nullable: true}` (the form
Gemini actually expects) instead of `anyOf: [{type: "string"},
{nullable: true}]`.
- **Compile-time path consistency**: route `ToJsonSchemaSubsetTransform`
through the same `convert_null_in_types_to_nullable` helper so
Rust-defined tools using `Option<T>` also keep nullability on Gemini,
instead of silently truncating to the non-null type.
- Drop an unnecessary clone in `push_any_of_constraint` and simplify
`convert_types_to_any_of_defs`.
- Add a small `obj()` test helper and a regression test for the `anyOf +
allOf + multi-type` case.

Release Notes:

- Fixed `Option<T>` tool parameters being sent to Gemini without their
nullability, and fixed tool schemas with `anyOf` + `allOf` losing
constraints during the OpenAPI 3.0 conversion

Co-authored-by: Daniel Strobusch <1438302+dastrobu@users.noreply.github.com>
2026-05-19 19:04:48 +00:00
Ben Kunkle
a0aa3e842f
fs: Poll until watched path is created instead of watching parent (#57152)
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

Part of FR-9.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-19 17:55:54 +00:00
Cole Miller
57a64fc824
Add some more logging to diagnose lost FS events and stale git state (#57173)
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 Kunkle <ben@zed.dev>
2026-05-19 17:53:00 +00:00
Tom Houlé
0d832bc6d5
Implement MCP OAuth client preregistration (#52900)
In the interactive MCP OAuth flow, the MCP client registers itself with
the authorization in one of three ways:

- Client ID Metadata Document aka CIMD (recommended default). This is
already implemented: https://zed.dev/oauth/client-metadata.json.
- Dynamic Client Registration (DCR). This is the traditional method.
Also already implemented in Zed.
- Pre-registration: the client is registered out of band, typically in
the IdP or SaaS provider's UI. You get a client id and maybe a client
secret, that have to be provided by the MCP client when it wants to
exchange an access token. This is what this pull request is about.

This PR has two main parts:

- Allow users to configure a client id and optional client secret for an
MCP server in their configuration, under a new `oauth` key, and take it
into account
- Make the MCP server state and the configuration modal aware of the
intermediate states (client secret missing) and error cases stemming
from client pre-registration.

The client secret can be stored either in the system keychain or in
plain text in the MCP server configuration. The UI tries to steer user
towards the more secure option: the keychain.

<img width="715" height="201" alt="Screenshot 2026-04-10 at 16 48 06"
src="https://github.com/user-attachments/assets/5e64103e-6746-4ef0-8bd9-533d492b6912"
/>

<img width="884" height="544" alt="Screenshot 2026-04-10 at 16 47 07"
src="https://github.com/user-attachments/assets/0e35bb3c-cbc4-4e8c-a713-66323597b2e2"
/>


<img width="785" height="558" alt="Screenshot 2026-04-10 at 16 47 23"
src="https://github.com/user-attachments/assets/03339187-1508-461a-87ae-a7c2647df9a5"
/>



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/issues/assigned?issue=zed-industries%7Czed%7C52198

**Note for the reviewer: I know how busy the AI team is at the moment so
please treat this as low priority, we don't have signal that this is a
highly desired feature. It's a rather large PR, so I'm happy to pair
review / walk through it.**

Release Notes:

- Added support for OAuth client pre-registration (client id, client
secret) to the built-in MCP client.
2026-05-19 17:45:07 +00:00
alkinun
c0596fade7
markdown: Fix escaping non-ASCII chars (#55782)
Fixes #55704

The `escape` function in `crates/markdown/src/markdown.rs` was calling
`c as u8` on the `char`s before passing to `MarkdownEscaper::next()`.
This strips non ASCII Unicode codepoints down to just their low 8 bits
which might be in the ASCII punctuation range and thus cause an extra
backslash to be added in front of these non ASCII chars.
 
Release Notes:

- Fixed a bug where non-ASCII chars in diagnostic messages were
incorrectly rendered with spurious `\` characters
2026-05-19 17:20:24 +00:00
Oleksiy Syvokon
a949cabb32
Fix crash in manipulate_text on multibuffers (#57165)
In `Editor::manipulate_text`, we computed selection boundaries for the
updated text assuming the requested edit would be applied exactly. This
is not always true. As a result, we could produce an invalid selection
range and panic.

This change replaces manual selection boundary computation with anchors.
It also skips edits when `new_text == old_text`.

Closes FR-10.

Release Notes:

- N/A
2026-05-19 17:04:29 +00:00
Daniel Strobusch
ae47ec9ac0
language_models: Fix Gemini tool parameter nullability and multi-type schema (#49292)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
Transform JSON schemas for Google AI tools to use `nullable: true`
instead of `type: ["type", "null"]`, which is not supported by the
Gemini API.

Additionally, convert multi-type arrays (e.g., `type: ["string",
"number"]`)
to `anyOf` constraints, as Gemini expects a single string for the `type`
field.

This handles recursive transformation of properties, items, definitions,
and logical operators, safely merging conflicting `anyOf` and `allOf`
constraints.

Closes https://github.com/zed-industries/zed/issues/44875
Closes https://github.com/zed-industries/zed/issues/32429

Release Notes:

- Fixed a bug where using Gemini with certain tools (especially via MCP)
resulted in "Invalid JSON payload received" errors due to incompatible
JSON schema formats.

## Testing

Added unit tests in `crates/language_model/src/tool_schema.rs` covering
nullability, multi-types, and `oneOf` conversions.

### Manual Testing with MCP Test Server
The [MCP Test Server](https://github.com/dastrobu/mcp-test-server) was
used to verify these edge cases with Gemini 3 Flash.

#### Setup
1. Install the test server: `cargo install --git
https://github.com/dastrobu/mcp-test-server`
2. Add to Zed `settings.json`:
   ```json
   "context_servers": [
     {
       "command": "mcp-test-server"
     }
   ]
   ```


Use the following pattern in a chat window:

```
call the add_tool function to create a new tool: weather with input schema: 

  {
    "type": "object",
    "properties": {
      "city": { "type": ["string", "null"] }
    }
  }
```
Afterwards:
...

```
call it
```

Without fix: 

<img width="671" height="448" alt="image"
src="https://github.com/user-attachments/assets/e8b6e7bd-d431-4a7e-8c9a-fff73d82127d"
/>

With fix:

<img width="729" height="334" alt="image"
src="https://github.com/user-attachments/assets/eb758765-4c34-4915-a8cf-dd4bfb993619"
/>

#### Cases verified manually:



**1. Nullability in properties**
- **Input:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": { "type": ["string", "null"] }
    }
  }
  ```
- **Converted:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": { "type": "string", "nullable": true }
    }
  }
  ```

**2. Multi-type properties**
- **Input:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": { "type": ["string", "number"] }
    }
  }
  ```
- **Converted:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": {
        "anyOf": [
          { "type": "string" },
          { "type": "number" }
        ]
      }
    }
  }
  ```

**3. Explicit `anyOf` with nullability**
- **Input:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": {
        "anyOf": [
          { "type": "string" },
          { "type": "null" }
        ]
      }
    }
  }
  ```
- **Converted:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": {
        "anyOf": [
          { "type": "string" },
          { "nullable": true }
        ]
      }
    }
  }
  ```

**4. Conflicting `anyOf` sources (Multi-type + existing `anyOf`)**
- **Input:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": {
        "type": ["string", "number"],
        "anyOf": [
          { "minLength": 5 }
        ]
      }
    }
  }
  ```
- **Converted:**
  ```json
  {
    "type": "object",
    "properties": {
      "city": {
        "allOf": [
          { "anyOf": [{ "minLength": 5 }] },
          { "anyOf": [{ "type": "string" }, { "type": "number" }] }
        ]
      }
    }
  }
  ```

Co-authored-by: Richard Feldman <richard@zed.dev>
2026-05-19 15:56:34 +00:00
Ben Brandt
ad437c93c2
sidebar: Fix stale sidebar thread header state (#57017)
There was a case where if you archived or closed all threads, you
wouldn't see the empty state again.

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-19 14:43:38 +00:00
Danilo Leal
c5f6fca756
Don't show trust modal for linked worktrees if main is trusted (#57153)
Follow up to https://github.com/zed-industries/zed/pull/57056 — This PR
ensures we're refreshing the security modal so that it consumes the
trust given to the main worktree when creating a new linked (Git)
worktree.

Release Notes:

- N/A
2026-05-19 14:32:46 +00:00
Ben Brandt
589dc95c87
agent_ui: Restore last active agent panel entry (#57150)
Makes sure we can reload the last terminal, and also keeps track more
globally what your last agent type was so we can carry that over to new
workspaces

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-19 14:07:09 +00:00
Danilo Leal
3a821765e5
icons: Update some icon SVGs (#57151)
Just some house-keeping here, aligning and fixing size on some SVGs.

Release Notes:

- N/A
2026-05-19 13:28:45 +00:00
Bennet Bo Fenner
da43bdb648
agent: Support image output from MCP tools (#57134)
Release Notes:

- agent: Support image output from MCP tools
2026-05-19 12:51:42 +00:00
Bennet Bo Fenner
c352cad169
agent: Replay image output (#57143)
Release Notes:

- agent: Fix image output from tools not being reloaded when restoring
thread
2026-05-19 12:29:35 +00:00
Conrad Irwin
46b08f9d7d
gpui: Trim trailing whitespace and punctuation before ellipsis (#57106)
When truncating text at the end with an ellipsis, the truncation point
can land right after a space or punctuation character, producing results
like `"some text …"` or `"some text-…"`.

This trims trailing whitespace and ASCII punctuation from the truncated
prefix before appending the ellipsis affix, so you get clean results
like `"some text…"` instead.

Release Notes:

- Improved text truncation to avoid trailing spaces or punctuation
before the ellipsis.
2026-05-19 11:46:05 +00:00
Ben Brandt
4557ad7ad1
eval_cli: Initialize themes in eval headless mode (#57139)
Also fix patch generation

Release Notes:

- N/A
2026-05-19 11:29:00 +00:00
Kunall Banerjee
85f410004c
agent_ui: Trigger @-mention menu after opening brackets (#55504)
Typing `@` immediately after `(`, `[`, or `{` did not open the Agent
Panel’s @-mention completion menu, so `(@file)`, `[@file]`, and
`{@file}` were unusable. This has been bothering me for quite some time
now. Overall, I believe this is a QoL improvement, albeit a small one.

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

Release Notes:

- Fixed the Agent Panel’s @-mention menu not appearing when `@`
immediately follows `(`, `[`, or `{`.

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-05-19 10:05:49 +00:00
Ben Brandt
938490639a
agent_ui: Activate workspace from terminal notifications (#57096)
We weren't activating and focusing the right thing before.

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-19 09:55:02 +00:00
Bennet Bo Fenner
8708a6fa74
agent: Do not decode images during render (#56866)
Turns out we were creating an ImageDecoder on every frame (added in
#46167) when a tool returned an image as output, because we were trying
to get its dimensions. That is now cached on `ContentBlock::Image`.

Release Notes:

- N/A
2026-05-19 09:51:42 +00:00