Commit log

6874c0d zed 0.183.10

Joseph T. Lyons created

2fb5f57 language: Fix `language_scope_at` for markdown code comments (#29230)

Click to expand commit body
Closes #29176

This PR fix an issue where uncommenting a code block in Markdown would
add Markdown comments instead of removing the language-specific
comments.

Why?
`language_scope_at` for comments in a code block in Markdown would
result in the language being detected as Markdown. This happens because
the smallest range, such as `//` or `#` on the Markdown layer, is
preferred over `// whole comment line` for any other language. This
results in language detection as Markdown for that point.

To fix this, we also use a depth factor and try to prefer the layer with
greater depth over one with lesser depth. In this case, the code block's
language depth would be preferred over Markdown. The smallest range is
now used as a tiebreaker.

Added test for this case.

Release Notes:

- Fixed issue where uncommenting a code block in Markdown would add
Markdown comments instead of removing the language comments.

Smit Barmase created

2a72164 agent: Improve the review changes UX (#29221)

Click to expand commit body
Release Notes:

- agent: Improved the AI-generated changes review UX by clearly exposing
the generating state in the multibuffer tab.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Bennet Bo Fenner and Danilo Leal created

f7130eb agent: Add small design tweaks (#29218)

Click to expand commit body
Nothing too serious over here, just spacing and other small-ish tweaks.

Release Notes:

- N/A

Danilo Leal created

57cbea7 Streaming tool calls (#29179)

Click to expand commit body
https://github.com/user-attachments/assets/7854a737-ef83-414c-b397-45122e4f32e8



Release Notes:

- Create file and edit file tools now stream their tool descriptions, so
you can see what they're doing sooner.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>

Richard Feldman and Marshall Bowers created

a4665c2 agent: Show project name in the Agent notification (#29211)

Click to expand commit body
Release Notes:

- agent: Added the project name in the Agent Panel notification.

Danilo Leal created

7bd0822 zed 0.183.9

Joseph T. Lyons created

89384ca Add example agent tool preview (#28984)

Click to expand commit body
This PR adds an example of rendering previews for tools using the new
Agent ToolCard style.

![CleanShot 2025-04-17 at 13 03
12@2x](https://github.com/user-attachments/assets/d4c7d266-cc32-4038-9170-f3e070fce60e)

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>

Nate Butler and Marshall Bowers created

c3239ca agent: Refine the web search tool call UI (#29190)

Click to expand commit body
This PR refines a bit the web search tool UI by introducing a component
(`ToolCallCardHeader`) that aims to standardize the heading element of
tool calls in the thread.

In terms of next steps, I plan to evolve this component further soon
(e.g., building a full-blown "tool call card" component), and even move
it to a place where I can re-use it in the active_thread as well without
making the `assistant_tools` a dependency of it.

Release Notes:

- N/A

Danilo Leal created

029b343 agent: Simplify user message design (#29165)

Click to expand commit body
Mainly removing the "You" label, which didn't add a lot of value. Still
figuring out an issue with font size Markdown rendering before merging
this PR.

Release Notes:

- N/A

Danilo Leal created

d3113ef agent: Support inserting selections as context via `@selection` (#29045)

Click to expand commit body
WIP

Release Notes:

- N/A

Bennet Bo Fenner created

7cb9b46 agent: Add support for google gemini 2.5 flash preview (#29205)

Click to expand commit body
Adds support for the new gemini-2.5-flash-preview-04-17

Release Notes:

- agent: Added support for gemini-2.5-flash-preview

Stephan Seidt created

9c3ea6d gemini: Add support for passing images as part of the prompt (#29203)

Click to expand commit body
Release Notes:

- agent: Add support for adding images as context when using Google
Gemini

Bennet Bo Fenner created

cc8d096 agent: Support pasting images as context (#29177)

Click to expand commit body
https://github.com/user-attachments/assets/d6a27b05-3590-4f40-a820-f6f99f6bd581

Release Notes:

- agent: Added support for pasting images as context

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Bennet Bo Fenner and Danilo Leal created

937f57a agent: Do not add `<using_tool>` placeholder (#29194)

Click to expand commit body
Our provider code in `language_models` filters out messages for which
`LanguageModelRequestMessage::contents_empty` returns `false`. This
doesn't seem wrong by itself, but `contents_empty` was returning `false`
for messages whose first segment didn't contain non-whitespace text even
if they contained other non-empty segments. This caused requests to fail
when a message with a tool call didn't contain any preceding text.

Release Notes:

- N/A

Agus Zubiaga created

06c4720 agent: Fix file context renames affecting display + simplify loading code (#29192)

Click to expand commit body
Release Notes:

- N/A

Michael Sloan created

1255a1b agent: Make directory context display update on rename (#29189)

Click to expand commit body
Release Notes:

- N/A

Michael Sloan created

aefa9e7 Bump to 0.183.8 for @probably-neb

Zed Bot created

2009abb editor: Expand selection to word under cursor before expanding to next enclosing syntax node (cherry-pick #28864) (#29184)

Click to expand commit body
Cherry-picked editor: Expand selection to word under cursor before
expanding to next enclosing syntax node (#28864)

Closes #27995

For strings in any language and Markdown, `select_larger_syntax_node`
will first select the word and then expand from there if:
- The cursor is on the word.
- The selection is inside the word.

It will not select the word and will directly proceed to expand if:
- The word is already selected.
- Multiple partial words are selected.

Todo:
- [x] Tests

Release Notes:

- Fixed `select_larger_syntax_node` to first expand to the word within a
string, and then to the larger syntax node.

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

gcp-cherry-pick-bot[bot] and Smit Barmase created

f0f56d7 Use buffer size for markdown preview (cherry-pick #29172) (#29183)

Click to expand commit body
Cherry-picked Use buffer size for markdown preview (#29172)

Note:

This is implemented in a very hacky and one-off manner. The primary
change is to pass a rem size through the markdown render tree, and scale
all sizing (rems & pixels) based on the passed in rem size manually.
This required copying in the `CheckBox` component from `ui::CheckBox` to
make it use the manual rem scaling without modifying the `CheckBox`
implementation directly as it is used elsewhere.

A better solution is required, likely involving `window.with_rem_size`
and/or _actual_ `em` units that allow text-size-relative scaling.

Release Notes:

- Made it so Markdown preview uses the _buffer_ font size instead of the
_ui_ font size.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Nate Butler <nate@zed.dev>

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Nate Butler <nate@zed.dev>

gcp-cherry-pick-bot[bot] , Mikayla Maki , Ben Kunkle , and Nate Butler created

6c53ee2 Add ability to attach rules as context (#29109)

Click to expand commit body
Release Notes:

- agent: Added support for adding rules as context.

Michael Sloan created

18ac673 Fix ctrl-c in vim normal mode (cherry-pick #29167) (#29169)

Click to expand commit body
Cherry-picked Fix ctrl-c in vim normal mode (#29167)

This was broken when we added helix keybindings because we populate the
menu's shortcut based on the "last" seen binding for an action ignoring
context.

Release Notes:

- Fix `ctrl-c` in vim normal mode

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

4464589 zed 0.183.7

Joseph T. Lyons created

754c5f2 agent: Migrate tool names in settings (#29168)

Click to expand commit body
Release Notes:

- agent: Add migration to rename `find_replace_file` tool to
`edit_file`, and `regex_search` to `grep`.

Agus Zubiaga created

0860283 agent: Add additional fields to `Agent Tool Finished` telemetry event (#29163)

Click to expand commit body
This PR adds additional fields to the `Agent Tool Finished` telemetry
event:

- `model`
- `model_provider`
- `thread_id`
- `prompt_id`

Release Notes:

- N/A

Marshall Bowers created

b1ac0d9 agent: Update Switch color in the settings view (#29154)

Click to expand commit body
Just using the color method for the Switch component added in
https://github.com/zed-industries/zed/pull/29074.

Release Notes:

- N/A

Danilo Leal created

98f2208 edit tool: Handle over-indentation in `replace_with_flexible_indent` (#29153)

Click to expand commit body
Release Notes:

- agent: Correct over-indentation in search/replace strings from model

Agus Zubiaga created

2084e0b ui: Add `.color` method to the Switch (#29074)

Click to expand commit body
This allows to pass, for example, `.color(SwitchColor::Accent)` to the
Switch component and have it render differently.

<img
src="https://github.com/user-attachments/assets/c60bac8a-c5ae-4693-912a-c754e5081f45"
width="550"/>

Release Notes:

- N/A

Danilo Leal created

7c0db88 inline assistant: Fix model picker (#29136)

Click to expand commit body
Release Notes:

- inline assistant: Fixed a bug where the default model would be used
even when a specific inline assistant model was configured

Agus Zubiaga created

9330320 Rename regex search tool to grep and accept an include glob pattern (#29100)

Click to expand commit body
This PR renames the `regex_search` tool to `grep` because I think it
conveys more meaning to the model, the idea of searching the filesystem
with a regular expression. It's also one word and the model seems to be
using it effectively after some additional prompt tuning.

It also takes an include pattern to filter on the specific files we try
to search. I'd like to encourage the model to scope its searches more
aggressively, as in my testing, I'm only seeing it filter on file
extension.

Release Notes:

- N/A

Nathan Sobo created

5ac0baa editor: Improve selection highlights speed (#29097)

Click to expand commit body
Before, we used to debounce selection highlight because it needed to
search the whole file to show gutter line highlights, etc. This
experience felt extremely laggy.

This PR introduces a new approach where:
1. We query only visible rows without debounce. The search function
itself is async and runs in a background thread, so it's not blocking
anything. With no debounce and such a small search space, highlights
feel realtime.
2. In parallel, we also query the whole file (still debounced, like
before). Once this query resolves, it updates highlights across the
file, making scrollbar markers visible.

This hybrid way gives the feeling of realtime, while keeping the same
functionality.


https://github.com/user-attachments/assets/432b65f1-89d2-4658-ad5e-048921b06a23

P.S. I have removed the user setting for custom debounce delay, because
(one) now it doesn't really make sense to configure that, and (two) the
whole logic is based on the assumption that the fast query will resolve
before the debounced query. A static debounce time makes sure of that.
Configuring it might lead to cases where the fast query resolves after
the debounced query, and we end up only seeing visible viewport
highlights.

Release Notes:

- Improved selection highlight speed.

Smit Barmase created

05b8a6d agent: Reorder some linux keybindings to match mac keybindings (#29107)

Click to expand commit body
Release Notes:

- Made keybindings for agent panel closer to the precedence order used
on Mac. This fixes use of `enter` to add context from the menu triggered
by `@` referencing.

Michael Sloan created

e0e46da Default to fast model for thread summaries and titles + don't include system prompt / context / thinking segments (#29102)

Click to expand commit body
* Adds a fast / cheaper model to providers and defaults thread
summarization to this model. Initial motivation for this was that
https://github.com/zed-industries/zed/pull/29099 would cause these
requests to fail when used with a thinking model. It doesn't seem
correct to use a thinking model for summarization.

* Skips system prompt, context, and thinking segments.

* If tool use is happening, allows 2 tool uses + one more agent response
before summarizing.

Downside of this is that there was potential for some prefix cache reuse
before, especially for title summarization (thread summarization omitted
tool results and so would not share a prefix for those). This seems fine
as these requests should typically be fairly small. Even for full thread
summarization, skipping all tool use / context should greatly reduce the
token use.

Release Notes:

- N/A

Michael Sloan created

220b2cd Don't send dummy user text with tool results (#29099)

Click to expand commit body
Previously, we were including the dummy text "Here are the tool
results." whenever reporting tool call results. I'm worried this is
adding noise and confusing the model, because the user didn't actually
say anything. This inserts an empty message to be populated later. My
preference would be something less stateful, where tool results (or
batches of them requested simultaneously) would be sent to the model as
soon as they were ready, without bothering to do this message
association dance. But for now, this seems to work.

Release Notes:

- N/A

Nathan Sobo created

9375cb2 agent: Preserve thinking blocks between requests (#29055)

Click to expand commit body
Looks like the required backend component of this was deployed.

https://github.com/zed-industries/monorepo/actions/runs/14541199197

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>

Bennet Bo Fenner , Antonio Scandurra , Agus Zubiaga , Richard Feldman , and Nathan Sobo created

9e8af50 agent: Add item to add custom MCP server in the panel's menu (#29091)

Click to expand commit body
This is based on user feedback that the Agent Panel menu was only
linking to extensions as a way to add MCP servers while we also support
adding "custom" servers, too, which don't go through the extensions
flow.

Release Notes:

- N/A

Danilo Leal created

b7eb695 Simplify language model registry + only emit change events on change (#29086)

Click to expand commit body
* Now only does default fallback logic in the registry

* Only emits change events when there is actually a change

Release Notes:

- N/A

Michael Sloan created

bf64cd4 Systematically optimize agentic editing performance (#28961)

Click to expand commit body
Now that we've established a proper eval in tree, this PR is reboots of
our agent loop back to a set of minimal tools and simpler prompts. We
should aim to get this branch feeling subjectively competitive with
what's on main and then merge it, and build from there.

Let's invest in our eval and use it to drive better performance of the
agent loop. How you can help: Pick an example, and then make the outcome
faster or better. It's fine to even use your own subjective judgment, as
our evaluation criteria likely need tuning as well at this point. Focus
on making the agent work better in your own subjective experience first.
Let's focus on simple/practical improvements to make this thing work
better, then determine how we can craft our judgment criteria to lock
those improvements in.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Agus <agus@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Michael Sloan <mgsloan@gmail.com>

Nathan Sobo , Max , Antonio , Agus , Richard , Max Brunsfeld , Antonio Scandurra , and Michael Sloan created

0b9ae6e agent: Make copy button show while hovering the codeblock container (#29075)

Danilo Leal created

ba9c033 language_models: Fix passing of `thread_id` and `prompt_id` (#29071)

Click to expand commit body
This PR is a follow-up to
https://github.com/zed-industries/zed/pull/29069 that fixes an issue
where the thread ID and prompt ID were not being sent up correctly.

Release Notes:

- N/A

Marshall Bowers created

07ca5a6 agent: Attach thread ID and prompt ID to telemetry events (#29069)

Click to expand commit body
This PR attaches the thread ID and the new prompt ID to telemetry events
for completions in the Agent panel.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>

Marshall Bowers and Mikayla Maki created

0c13b42 Add hidden `prompt_to_focus` field to `OpenPromptLibrary` action (#29062)

Click to expand commit body
Release Notes:

- N/A

Michael Sloan created

bb1b132 Init prompt store in agent eval (#29068)

Click to expand commit body
Needed after #28915

Release Notes:

- N/A

Michael Sloan created

eefdcb3 agent: Simplify design of the settings view (#29041)

Click to expand commit body
Containing everything in boxes wasn't super necessary here. Want to
still improve the switch color contrast here, but will probably do that
in a separate PR.

<img
src="https://github.com/user-attachments/assets/f826a7a8-beaf-45d0-9dc2-36dc210c418e"
width="700"/>

Release Notes:

- N/A

Danilo Leal created

2ac8a84 agent: Use default prompts from prompt library in system prompt (#28915)

Click to expand commit body
Related to #28490.

- Default prompts from the prompt library are now included as "user
rules" in the system prompt.
- Presence of these user rules is shown at the beginning of the thread
in the UI.
_ Now uses an `Entity<PromptStore>` instead of an `Arc<PromptStore>`.
Motivation for this is emitting a `PromptsUpdatedEvent`.
- Now disallows concurrent reloading of the system prompt. Before this
change it was possible for reloads to race.

Release Notes:

- agent: Added support for including default prompts from the Prompt
Library as "user rules" in the system prompt.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Michael Sloan and Danilo Leal created

d35ffc7 debugger: Fix gutter tasks display for users without the debugger feature flag (#29056)

Kirill Bulatov created

093248a zed 0.183.6

Joseph T. Lyons created

21ff2bb agent: Do not insert selection as context when selection is empty (#29031)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

843a621 agent: Remove selections as context once message is sent (#29030)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

bbe956f Make Copy and Trim ignore empty lines, and fix vim line selections (cherry-pick #29019) (#29023)

Click to expand commit body
Cherry-picked Make Copy and Trim ignore empty lines, and fix vim line
selections (#29019)

Close #28519 

Release Notes:

Update `editor: copy and trim` command:

1. Ignore empty lines in the middle:

    ```
      Line 1

      Line 2
    ```

    Will copy text to clipboard:

    ```
    Line 1

    Line 2
    ```

    Before this commit trim not performed

1. Fix select use vim line selections, trim not works

Co-authored-by: redforks <redforks@gmail.com>

gcp-cherry-pick-bot[bot] and redforks created