This PR adds the ability to hear a sound notification when the agent is
done generating and/or needs user input. This setting is turned off by
default and can be used together with the visual notification. The
specific sound I'm using here comes from the [Material Design 2 Sound
Library](https://m2.material.io/design/sound/sound-resources.html#).
Release Notes:
- agent: Added the ability to have a sound notification when the agent
is done generating and/or needs user input.
Follow up to https://github.com/zed-industries/zed/pull/31353. Just
ensuring we're walking toward a more consistent use of the multiple
terms we have floating around in the AI realm. In this case, `thread` is
the term for the now default view, the one that has agentic features;
`text_thread` is the term for the original view, the one where it's just
text. The settings now reflect this. Also took advantage of the
opportunity to add some docs, too.
Release Notes:
- N/A
Editing JSON styles is not very helpful for bringing style changes back
to the actual code. This PR adds a buffer that pretends to be Rust,
applying any style attribute identifiers it finds. Also supports
completions with display of documentation. The effect of the currently
selected completion is previewed. Warning diagnostics appear on any
unrecognized identifier.
https://github.com/user-attachments/assets/af39ff0a-26a5-4835-a052-d8f642b2080c
Adds a `#[derive_inspector_reflection]` macro which allows these methods
to be enumerated and called by their name. The macro code changes were
95% generated by Zed Agent + Opus 4.
Release Notes:
* Added an element inspector for development. On debug builds,
`dev::ToggleInspector` will open a pane allowing inspecting of element
info and modifying styles.
Related discussions #30240#30596
Release Notes:
- Added an option on the settings file to choose either the `agent`
panel or the `thread` panel as the default assistant panel when you
first open it. On `settings.json`:
```json
{
"agent": {
"default_view": "thread", // default is agent
}
}
```
Release Notes:
- agent: Added a space after @-mentioning something in the message
editor to allow for continuous typing.
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Addresses an issue where the agent context token meter in the panel
toolbar (showing usage like "X / Y tokens") failed to update its count
after the user cleared the current context via the context editor UI.
While the meter updated correctly when adding items, clearing them left
the display showing the old count.
The root cause was traced to the `ContextStore::clear` method in
`crates/agent/src/context_store.rs`. This method correctly cleared the
internal data structures holding the context items but neglected to call
`cx.notify()` to inform listeners of the state change. Consequently, the
UI components responsible for displaying the token count were not
triggered to re-render with the new (presumably lower) count.
This PR fixes the issue by adding the missing `cx.notify()` call to the
`ContextStore::clear` method. This ensures listeners are notified when
the context set is cleared, allowing the token meter UI to update
correctly.
Release Notes:
- Fixed an issue where the agent context token meter did not update when
the context was cleared.
This PR introduces a new `agent: chat with follow` action that
automatically enables "Follow Agent" when submitting a chat message with
`cmd-enter` or `ctrl-enter`. This is experimental. I'm not super
thrilled with the name, but the root action to submit a chat is called
`agent: chat`, so I'm following that wording. I'm also unsure if the
binding feels right or not.
Release Notes:
- Added an `agent: chat with follow` action via `cmd-enter` on macOS and
`ctrl-enter` on Linux
Open inspector with `dev: toggle inspector` from command palette or
`cmd-alt-i` on mac or `ctrl-alt-i` on linux.
https://github.com/user-attachments/assets/54c43034-d40b-414e-ba9b-190bed2e6d2f
* Picking of elements via the mouse, with scroll wheel to inspect
occluded elements.
* Temporary manipulation of the selected element.
* Layout info and JSON-based style manipulation for `Div`.
* Navigation to code that constructed the element.
Big thanks to @as-cii and @maxdeviant for sorting out how to implement
the core of an inspector.
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Federico Dionisi <code@fdionisi.me>
- Rename current_user_account_too_young to account_too_young for
consistency
- Add has_overdue_invoices field to track billing status
- Block edit predictions when user has overdue invoices
- Add overdue invoice warning to inline completion menu
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This is a partial reversion of
https://github.com/zed-industries/zed/pull/30878 - having it always
scroll to bottom whenever a new message is added makes it so that when
you're scrolled up, you don't have time to read what you're trying to
read before it autoscrolls to the end.
@danilo-leal when you're back, we can pair on addressing that in a
different way!
Release Notes:
- Fixed bug where scrolling up in the agent panel didn't prevent
automatic scroll-to-end whenever a new message arrived.
By consuming the event during processing we save a few clones during
event processing.
Overall in this PR we save one Clone each during:
- Paste to the terminal
- Writing to the terminal
- Setting the title
- On every terminal transaction
- On every ViMotion when not using shift
Release Notes:
- N/A
This PR replaces some `update()` calls with either `read()` or
`read_with()` when the `update()` call performed read-only operations on
the entity.
Many more likely exist, will follow-up with more PRs.
Release Notes:
- N/A
Right now you find this out the first time you try and submit a
completion.
These changes communicate much earlier to the user what the issue is
with their account and what they can do about it.
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
This PR fixes an issue where the eval was incorrectly pulling the
provider/model from the user settings, which could cause problems when
running certain evals.
Was introduced in #30168 due to the restructuring after the removal of
the `assistant` crate.
Release Notes:
- N/A
This is a follow-up to https://github.com/zed-industries/zed/pull/31217
that removes the last turn after we get a `refusal` stop reason, as
advised by the Anthropic docs.
Meant to include it in that PR, but accidentally merged it before
pushing these changes 🤦🏻♂️.
Release Notes:
- N/A
https://github.com/zed-industries/zed/issues/30972 brought up another
case where our context is not enough to track the actual source of the
issue: we get a general top-level error without inner error.
The reason for this was `.ok_or_else(|| anyhow!("failed to read HEAD
SHA"))?; ` on the top level.
The PR finally reworks the way we use anyhow to reduce such issues (or
at least make it simpler to bubble them up later in a fix).
On top of that, uses a few more anyhow methods for better readability.
* `.ok_or_else(|| anyhow!("..."))`, `map_err` and other similar error
conversion/option reporting cases are replaced with `context` and
`with_context` calls
* in addition to that, various `anyhow!("failed to do ...")` are
stripped with `.context("Doing ...")` messages instead to remove the
parasitic `failed to` text
* `anyhow::ensure!` is used instead of `if ... { return Err(...); }`
calls
* `anyhow::bail!` is used instead of `return Err(anyhow!(...));`
Release Notes:
- N/A
Some providers sometimes send `{ "type": "text", "text": ... }` instead
of just the text as a string. Now we accept those instead of erroring.
Release Notes:
- N/A
This PR makes the edit tool call codeblock cards expanded by default, to
be consistent with https://github.com/zed-industries/zed/pull/30806.
Also, I am removing the collapsing behavior of Markdown codeblocks where
we'd add a gradient while capping the container's height based on an
arbitrary number of lines. Figured if they're all now initially
expanded, we could simplify how the design/code operates here
altogether.
Open for feedback, as I can see an argument where the previous Markdown
codeblock design of "collapsed but not fully; it shows a preview" should
stay as it is useful.
Release Notes:
- N/A
This PR also moves the context strip to be at the top, so it matches the
main message editor, making the arrow-up keyboard interaction to focus
on it to work the same way.
Release Notes:
- agent: Made the previous message editing UX more consistent with the
main message editor.
1. The `edit_file` tool tended to use `create_or_overwrite` a bit too
often, leading to corruption of long files. This change replaces the
boolean flag with an `EditFileMode` enum, which helps Agent make a more
deliberate choice when overwriting files.
With this change, the pass rate of the new eval increased from 10% to
100%.
2. eval: Added ability to run eval on top of an existing thread. Threads
can now be loaded from JSON files in the `SerializedThread` format,
which makes it easy to use real threads as starting points for
tests/evals.
3. Don't try to restore tool cards when running in headless or eval mode
-- we don't have a window to properly do this.
Release Notes:
- N/A
This is very basic support for them. There are a number of other TODOs
before this is really a first-class supported feature, so not adding any
release notes for it; for now, this PR just makes it so that if
read_file tries to read a PNG (which has come up in practice), it at
least correctly sends it to Anthropic instead of messing up.
This also lays the groundwork for future PRs for more first-class
support for images in tool calls across more image file formats and LLM
providers.
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
The MCP server item in the settings view has an indicator that used to
only use colors to communicate the connection status. From an
accessibility standpoint, relying on just colors is never a good idea;
there should always be a supporting element that complements color for
communicating a certain thing. In this case, I added a tooltip, when you
hover over the indicator dot, that clearly words out the status.
Release Notes:
- agent: Improved clarity of MCP server connection status in the
Settings view.
Ref: https://github.com/zed-industries/zed/pull/29919
This PR improves how inline assistants are detected and focused based on
cursor position.
### Problem
The current implementation has inconsistent behavior:
- When selecting text within an inline assistant's range, the assistant
properly focuses
- When placing a cursor on a line containing an assistant (without
selection), a new assistant is created instead of focusing the existing
one
### Solution
Enhanced the assistant detection logic to:
- Check if the cursor is anywhere within the line range of an existing
assistant
- Maintain the same behavior for both cursor placement and text
selection
- Convert both cursor position and assistant ranges to points for better
line-based comparison
This creates a more intuitive editing experience when working with
inline assistants, reducing the creation of duplicate assistants when
the user intends to interact with existing ones.
https://github.com/user-attachments/assets/55eb80d1-76a7-4d42-aac4-2702e85f13c4
Release Notes:
- agent: Improved inline assistant behavior to focus existing assistants
when cursor is placed on their line, matching selection behavior
---------
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
This is my first time contributing, so happy to make changes as needed.
## Problem
I found the LLM Provider settings to be pretty difficult to scan as I
was looking to enter my API credentials for a provider. Because all of
the provider configuration is exposed by default, providers that come at
the end of the list are pushed fairly far down and require scrolling. As
this list increases the problem only get worse.
## Solution
This is strictly a UI change.
* I put each provider configuration in a Disclosure that is closed by
default. This made scanning for my provider easy, and exposing the
configuration takes a single click. No scrolling is required to see all
providers on my 956px high laptop screen.
* I also added the success checkmark to authenticated providers to make
it even easier to find them to update a key or sign out.
* The `Start New Thread` had a class applied that was overriding the
default hover behavior of other buttons, so I removed it.
## Before

## After

Release Notes:
- Improved Agent Panel settings view scannability by making each
provider block collapsible by default.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>