Commit log

43a04dc Treat invalid JSON in tool calls as failed tool calls (#29375)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Richard Feldman , Max , and Max Brunsfeld created

00e92e3 Rename "Prompt Library" to "Rules Library" (#29349)

Click to expand commit body
There's probably more to do to fully make the transition, and we'll
still debate a bit internally whether this is the name, but just opening
this PR up now for visibility.

Release Notes:

- N/A

Danilo Leal created

9e703ac gemini: Fix issue when deserializing tool call (#29363)

Click to expand commit body
Fixes a regression introduced in #29322

Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <hi@aguz.me>

Bennet Bo Fenner and Agus Zubiaga created

44d5976 Introduce LanguageModelToolUse::raw_input (#29322)

Click to expand commit body
This is to enable alternative streaming solutions at the application
layer. I'm not sure we really should have performed parsing of the input
at this layer. Either way I want to experiment with streaming approaches
in a separate crate on a branch, and this will help.

/cc @maxdeviant @bennetbo @rtfeldman

Closes #ISSUE

Release Notes:

- N/A

Nathan Sobo created

44fc004 agent: Do not reuse assistant message across generations (#29360)

Click to expand commit body
#29354 introduced a bug where we would append tool uses to the last
assistant message even if it was from a previous request.

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>

Agus Zubiaga and Bennet Bo Fenner created

c60b731 zed 0.184.2

Joseph T. Lyons created

b85bfba agent: Do not create user messages for tool results in thread (#29354)

Click to expand commit body
We used to insert empty user messages into the `Thread::messages` `Vec`
when tools finished running and then we would attach the results when
creating the request. This approach was very easy to mess up during
state handling, leading to empty user messages displayed in the
conversation and API failures.

Instead, we will no longer insert actual user messages for tool results
to the `Thread`, and will only do this on the fly when creating the
model request. This simplifies a lot of code and show fix the mentioned
errors.

Release Notes:

- agent: Improve reliability of LLM requests when including tool results

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>

Agus Zubiaga , Bennet Bo Fenner , and Oleksiy Syvokon created

f743cdc agent: Simplify user message design more (#29326)

Click to expand commit body
Follow-up to https://github.com/zed-industries/zed/pull/29165 where the
user message design is simplified even more. The edit button is not
visible anymore, and you can click on the whole message block to edit a
message.

Release Notes:

- N/A

Danilo Leal created

808d9c9 Fix ctrl-enter opening inline-assistant in assistant text threads (#29313)

Click to expand commit body
Closes: https://github.com/zed-industries/zed/issues/24501

This has been broken for a while on linux (at least since Feb 8th!) for Assistant1.
It is also broken for Text Threads in Assitant2 (on macos and linux).

This should fix both.

Potentially related:
- https://github.com/zed-industries/zed/pull/29107

Release Notes:

- Fix for `ctrl-enter` shortcut in Assistant text threads incorrectly
opening inline assist instead of triggering Send.

Co-authored-by: Conrad Irwin <conrad@zed.dev>

Peter Tripp and Conrad Irwin created

a53e561 agent: Improve initial file search quality (#29317)

Click to expand commit body
This PR significantly improves the quality of the initial file search
that occurs when the model doesn't yet know the full path to a file it
needs to read/edit.

Previously, the assertions in file_search often failed on main as the
model attempted to guess full file paths. On this branch, it reliably
calls `find_path` (previously `path_search`) before reading files.

After getting the model to find paths first, I noticed it would try
using `grep` instead of `path_search`. This motivated renaming
`path_search` to `find_path` (continuing the analogy to unix commands)
and adding system prompt instructions about proper tool selection.

Note: I know the command is just called `find`, but that seemed too
general.

In my eval runs, the `file_search` example improved from 40% ± 10% to
98% ± 2%. The only assertion I'm seeing occasionally fail is "glob
starts with `**` or project". We can probably add some instructions in
that regard.

Release Notes:

- N/A

Agus Zubiaga created

80bac1c eval: New `add_arg_to_trait_method` example (#29297)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>

Agus Zubiaga and Richard Feldman created

4171bbb agent: Encourage model to include displayed fields first (#29308)

Click to expand commit body
Instructs the model to include the fields that we display first in the
input object, so that e.g the user can see the path of a file while the
model generates the content.

Release Notes:

- N/A

Agus Zubiaga created

2a88867 agent: Read the user's plan from the `UserStore` (#29305)

Click to expand commit body
This PR updates the Agent panel to read the user's plan from the
`UserStore` instead of hard-coding it.

Release Notes:

- N/A

Marshall Bowers created

9d420ae agent: Add "copy to clipboard" button to error message popups (#29299)

Click to expand commit body
This change makes agent errors copy-able to clipboard:


![image](https://github.com/user-attachments/assets/bd34a3f2-ecd4-4092-9b3b-960953ed1879)



Release Notes:

- N/A

Oleksiy Syvokon created

b431886 editor: Fix broken mouse scrolling on main (#29307)

Click to expand commit body
This PR is a quick follow-up to #29234 , which unfortunately broke
scrolling with the mouse in editors on main.

The linked PR introduced the possiblilty to completely disable scrolling
for editors. Unfortunately, it also disabled scrolling for editors by
default. This PR fixes this by re-enabling it by default.

This change also needs to be backported to v0.184.x. Otherwise, mouse
scrolling in the next preview release will not work!

Release Notes:

- N/A

Finn Evers created

43c99ad agent: Improve feedback text and buttons wrapping (#29302)

Click to expand commit body
Just a little UI improvement here.

Release Notes:

- N/A

Danilo Leal created

f802b56 agent: Render diffs for the edit file tool (#29234)

Click to expand commit body
This PR implements the `ToolCard` for the edit file tool, which allow us
to display an editor with a diff in the thread view with the changes
performed by the model.

- [x] Fix buffer sometimes displaying empty
- [x] Stop buffer from scrolling together with the thread
- [x] Fix multibuffer header sometimes appearing
- [x] Fix buffer height issue
- [x] Implement "full height" expand button
- [x] Add "Jump To File" functionality
- [x] Polish and refine styles

Release Notes:

- agent: Added diff preview cards in the thread view for edits performed
by the agent.

---------

Co-authored-by: João Marcos <marcospb19@hotmail.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

Danilo Leal , João Marcos , Richard Feldman , Agus Zubiaga , and Conrad Irwin created

0c292b6 zed 0.184.1

Joseph T. Lyons created

8446005 More graceful invalid JSON handling (#29295)

Click to expand commit body
Now we're more tolerant of invalid JSON coming back from the model
(possibly because it was incomplete and we're streaming), plus if we do
end up with invalid JSON once it has all streamed back, we report what
the malformed JSON actually was:

<img width="444" alt="Screenshot 2025-04-23 at 1 49 14 PM"
src="https://github.com/user-attachments/assets/480f5da7-869b-49f3-9ffd-8f08ccddb33d"
/>

Release Notes:

- N/A

Richard Feldman created

5b028ac Fix relative paths not properly resolved in the terminal during cmd-click (#29289)

Click to expand commit body
Closes https://github.com/zed-industries/zed/pull/28342
Closes https://github.com/zed-industries/zed/issues/28339
Fixes
https://github.com/zed-industries/zed/pull/29274#issuecomment-2824794396

Release Notes:

- Fixed relative paths not properly resolved in the terminal during
cmd-click

Kirill Bulatov created

57d0276 v0.184.x preview

Joseph T. Lyons created

19fb1e1 Fix workspace bottom obscured when bottom dock is full height (#27689)

Click to expand commit body
When dragging the pane separator of the bottom dock to full window
height, the contents at the bottom of the dock and workspace window
overflowed the screen, becoming obscured. This happened because setting
a new size in resize_bottom_dock(...) was not taking in consideration
the top bounds of the workspace window, which caused the bottom bounds
of both dock and workspace to overflow. The issue was fixed by
subtracting the workspace.bounds.top() value to the dock's new size.

Closes #12966

Release Notes:

- N/A

Bibiana André created

f2cb6d6 collab: Add `head_commit_details` column to `project_repositories` (#29284)

Click to expand commit body
This PR adds the `head_commit_details` column to the
`project_repositories` table, since it was missed in
https://github.com/zed-industries/zed/pull/29007.

Release Notes:

- N/A

Marshall Bowers created

822b6f8 agent: Expose web search tool to beta users (#29273)

Click to expand commit body
This gives all beta users access to the web search tool

Release Notes:

- agent: Added `web_search` tool

Bennet Bo Fenner created

09db312 Fix panic when copying smart quotes in MarkdownElement (#29285)

Click to expand commit body
Release Notes:

- Fixed a panic that could sometimes happen when copying text in the
agent.

Antonio Scandurra created

a320d32 Fix shift-y on empty line in vim mode (#29253)

Click to expand commit body
Release Notes:

- Fixes a regression where `shift-v up` on an empty line would appear to
have selected the line after (though in reality it did not)

Conrad Irwin created

266c41e collab: Add `can_use_web_search_tool` to LLM token claims (#29278)

Click to expand commit body
This PR adds a `can_use_web_search_tool` field to the LLM token claims.

Currently anyone in the `assistant2` feature flag will have access to
the web search tool.

Co-authored-by: Bennet <bennet@zed.dev>

Release Notes:

- N/A

Marshall Bowers created

4f4bbf2 theme_importer: Handle comma-separated token scopes (#27740)

Click to expand commit body
This PR allows the `theme-importer` utility to handle comma-separated
token scopes.

Normally, a token in a VS Code theme is defined as either a string or a
string array:
```json
    {
      "scope": "token.debug-token",
      "settings": {
        "foreground": "#d55fde"
      }
    },
    {
      "name": "String interpolation",
      "scope": [
        "punctuation.definition.template-expression.begin",
        "punctuation.definition.template-expression.end",
        "punctuation.section.embedded"
      ],
      "settings": {
        "foreground": "#d55fde"
      }
    },
```

However, [some
themes](https://github.com/tal7aouy/theme/blob/ac85540d6494cf3b7dffd6adc8a06af6c1dd4b0d/src/variants/TokenColors.ts#L1771-L1777)
seem to use comma-separated values in a single scope string which VS
Code seems to accept as well:
```json
    {
      "name": "Comments",
      "scope": "comment, punctuation.definition.comment",
      "settings": {
        "foreground": "#7f848e"
      }
    },
```

This PR handles these definitions by splitting scopes by commas before
trying to match them with the scopes that match Zed syntax tokens.

Release Notes:

- N/A

Variant9 created

990ca48 docs: Update macOS development instructions (#27611)

Click to expand commit body
Updating macOS development readme with some gotchas that I ran into
while getting setup.
- Linked to collab readme because that contained the steps to setup the
postgres database so integration tests pass
- Added section under troubleshooting. Recommending `cargo-nextest`
since the CI uses it and it got me past the failures I was seeing.

Release Notes:

- N/A

---------

Co-authored-by: KyleBarton <kjbarton4@gmail.com>

Peter Finn and KyleBarton created

f69aeb6 Do not log unfinished tools use that are in the middle of streaming (#29275)

Click to expand commit body
Release Notes:

- N/A

Oleksiy Syvokon created

d5f3fbd Lookup relative paths in a worktree more robustly (#29274)

Click to expand commit body
Attempt to lookup exact relative paths before full worktree traversal,
only do the full traversal if all other methods fail.

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

Release Notes:

- Fixed wrong paths opening when cmd-clicking in the terminal

Kirill Bulatov created

76a78b5 eval: Write JSON-serialized thread (#29271)

Click to expand commit body
This adds `last.message.json` file that contains the full request plus
response (serialized as a message from assistant for consistency with
other messages).

Motivation: to capture more info and to make analysis of finished runs
easier.

Release Notes:

- N/A

Oleksiy Syvokon created

e515b2c Polish agent checkpoints (#29265)

Click to expand commit body
Release Notes:

- Improved performance of agent checkpoint creation.
- Fixed a bug that sometimes caused accidental deletions when restoring
to a previous agent checkpoint.
- Fixed a bug that caused checkpoints to be visible in the Git history.

Antonio Scandurra created

55ea481 Restore file to original content when rejecting file recreated by agent (#29264)

Click to expand commit body
Release Notes:

- Fixed a bug that could sometimes cause a file to be deleted when
rejecting an agent change.

Antonio Scandurra created

5e31d86 Fix panic in vim selection restoration (#29251)

Click to expand commit body
Closes #27986

Closes #ISSUE

Release Notes:

- vim: Fixed a panic when using `gv` after `p` in visual line mode

Conrad Irwin created

4a8f114 Fix panic when collaborating with new multibuffers (#29245)

Click to expand commit body
Before this change, when syncing a multibuffer (such as
find-all-references) to a remote, we would renumber the excerpts from 1.
This did not matter in the past because the buffers' list of excerpts
could not change. In #27876, I added the ability for excerpts to merge,
which meant that the excerpt list could change. This manifested as
people seeing "invalid excerpt id" panics when syncing.

The initial fix to this (to re-use the excerpt ids from the host) ran
into problems because `insert_excerpts_with_ids_after` assumes that you
call it in excerpt-id order. This change de-optimizes that code to
insert the excerpts 1-by-1 in excerpt-id order, but with the
insert_after set to preserve the correct UI order.

I hope to soon remove this code path and use something more like
set-excerpts-for-path for syncing, but in the meantime we should not
panic.

Release Notes:

- Fix a panic when joining a project with a multibuffer with merged
excerpts

Conrad Irwin created

ce1a674 eval: Fine-grained assertions (#29246)

Click to expand commit body
- Support programmatic examples
([example](https://github.com/zed-industries/zed/blob/17feb260a0919e102ae4e220669c467885bf4b57/crates/eval/src/examples/file_search.rs))
- Combine data-driven example declarations into a single `.toml` file
([example](https://github.com/zed-industries/zed/blob/17feb260a0919e102ae4e220669c467885bf4b57/crates/eval/src/examples/find_and_replace_diff_card.toml))
- Run judge on individual assertions (previously called "criteria")
- Report judge and programmatic assertions in one combined table

Note: We still need to work on concept naming 

<img width=400
src="https://github.com/user-attachments/assets/fc719c93-467f-412b-8d47-68821bd8a5f5">

Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Thomas Mickley-Doyle <tmickleydoyle@gmail.com>

Agus Zubiaga , Richard Feldman , Max Brunsfeld , and Thomas Mickley-Doyle created

0d3fe47 editor: Use quantize score for code completions sort + Add code completions tests (#29182)

Click to expand commit body
Closes #27994, #29050, #27352, #27616

This PR implements new logic for code completions, which improve cases
where local variables, etc LSP based hints are not shown on top of code
completion menu. The new logic is explained in comment of code.

This new sort is similar to VSCode's completions sort where order of
sort is like:

Fuzzy > Snippet > LSP sort_key > LSP sort_text 

whenever two items have same value, it proceeds to use next one as tie
breaker. Changing fuzzy score from float to int based makes it possible
for two items two have same fuzzy int score, making them get sorted by
next criteria.

Release Notes:

- Improved code completions to prioritize LSP hints, such as local
variables, so they appear at the top of the list.

Smit Barmase created

6a009b4 debugger: Open debugger panel on session startup (#29186)

Click to expand commit body
Now all debug sessions are routed through the debug panel and are
started synchronously instead of by a task that returns a session once
the initialization process is finished. A session is `Mode::Booting`
while it's starting the debug adapter process and then transitions to
`Mode::Running` once this is completed.

This PR also added new tests for the dap logger, reverse start debugging
request, and debugging over SSH.

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Zed AI <ai@zed.dev>
Co-authored-by: Remco Smits <djsmits12@gmail.com>

Conrad Irwin , Anthony Eid , Anthony , Cole Miller , Cole Miller , Zed AI , and Remco Smits created

75ab8ff zlog: Add default filters (#29244)

Click to expand commit body
Added default filters to `zlog`, a piece that was present in our
`simple_log` setup, but was missed when switching to `zlog`, resulting
in logspam primarily on linux.

also - more explicit precedence & precedence testing

Release Notes:

- N/A

Ben Kunkle created

3705986 Adjust image cache APIs to enable ElementState based APIs (#29243)

Click to expand commit body
cc: @sunli829 @huacnlee @probably-neb 

I really liked the earlier PR, but had an idea for how to utilize the
element state so that you don't need to construct the cache externally.
I've updated the APIs to introduce an `ImageCacheProvider` trait, and
added an example implementation of it to the image gallery :)

Release Notes:

- N/A

Mikayla Maki created

aefb3aa Fix handling of `--system-specs` argument so it happens before `Application::new` (#29240)

Click to expand commit body
Fixes issue described in [description of
#28683](https://github.com/zed-industries/zed/issues/28683#issue-2992849891)

Makes sure that the `--system-specs` arg is handled before
`Application::new` is called, so that it can be used even when Zed is
panicking during app initialization (e.g. Failing to create a Vulkan
context in blade)

Release Notes:

- Fixed an issue where the `--system-specs` arg wouldn't work if Zed
panicked during app initialization (e.g. When failing to create a Vulkan
context in blade)

Ben Kunkle created

8e7c145 inline_completion_button: Show the usage limits returned from the API (#29239)

Click to expand commit body
This PR updates the usage meter for edit predictions to use the limits
returned from the API instead of basing it off the plan.

This will allow limits to be updated from the server rather than being
embedded in the client.

Release Notes:

- N/A

Marshall Bowers created

a2a502f zed_extension_api: Release v0.4.0 (#29237)

Click to expand commit body
This PR releases v0.4.0 of the Zed extension API.

Support for this version of the extension API will land in Zed v0.184.x.

Release Notes:

- N/A

Marshall Bowers created

c231c95 platform/blade: Improve `ZED_DEVICE_ID` parsing (#29235)

Click to expand commit body
Closes #28533

Release Notes:

- Linux: Improved parsing of `ZED_DEVICE_ID` environment variable in an
attempt to fix some cases where it erroneously failed to parse. The
`ZED_DEVICE_ID` is now expected to always be a 4 digit hexadecimal
number (as it is in the output of `lcpci`) with an optional `0x` or `0X`
prefix.

Ben Kunkle created

fcc6a86 agent: Show the usage limits returned from the API (#29236)

Click to expand commit body
This PR updates the usage banners in the Agent panel to use the limits
returned from the API instead of basing it off the plan.

This will allow limits to be updated from the server rather than being
embedded in the client.

Release Notes:

- N/A

Marshall Bowers created

338a6a3 ci: Only run scheduled evals, not on main/release branch commits (#29238)

Click to expand commit body
Release Notes:

- N/A

Peter Tripp created

a0eaede collab: Limit customers to one free trial (#29232)

Click to expand commit body
This PR makes it so customers can only subscribe to the trial once.

Release Notes:

- N/A

Marshall Bowers created

abf2b9d gpui: Add ImageCache (#27774)

Click to expand commit body
Closes #27414

`ImageCache` is independent of the original image loader and can
actively release its cached images to solve the problem of images loaded
from the network or files not being released.

It has two constructors:

- `ImageCache::new`: Manually manage the cache.
- `ImageCache::max_items`: Remove the least recently used items when the
cache reaches the specified number.

When creating an `img` element, you can specify the cache object with
`Img::cache`, and the image cache will be managed by `ImageCache`.

In the example `crates\gpui\examples\image-gallery.rs`, the
`ImageCache::clear` method is actively called when switching a set of
images, and the memory will no longer continuously increase.


Release Notes:

- N/A

---------

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

Sunli and Ben Kunkle created

a50fbc9 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