This PR adds a "Resolve with Agent" button in each merge conflict block,
as well as "Resolve Conflicts with Agents" button on a notification for
resolving conflicts across all the files that have any. When clicking on
either of these buttons, the agent panel opens up with a template prompt
auto-submitted. For the first case, the specific content of the merge
block is already attached as context for the agent to act quickly, given
it's a local and small context. For the second case (all conflicts
across the codebase), the prompt just indicates to the agent which files
have conflicts and then it's up for the agent to see them. This felt
like a simpler way to go as opposed to extracting the content for all
merge conflicts across all damaged files.
Here's how the UI looks like:
<img width="550" height="1964" alt="Screenshot 2026-02-21 at 11 04@2x"
src="https://github.com/user-attachments/assets/96815545-ba03-40e5-9cb0-db0ce9588915"
/>
---
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- Git: Added the ability to quickly resolve merge conflicts with the
agent.
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
This will help with test times (in some cases), as nextest cannot figure
out whether a given rdep is actually an alive edge of the build graph
Closes #ISSUE
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Previously we required AgentSessionInfo all over the place, which meant
there were lots of unnecessary fake ones created all over the place.
Made the methods and functions only take the data they need so we only
use these in history contexts now, as intended.
Release Notes:
- N/A
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
---------
Co-authored-by: Eric <eric@zed.dev>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: John Tur <john-tur@outlook.com>
Store the user's unsent message editor text in DbThread so it survives
quitting and reloading Zed. The draft flows through Thread → AcpThread →
AcpThreadView on load, and back via a debounced observer on the message
editor for saves.
Currently works for native Zed agents only; external ACP agents will
pick this up once general ACP history persistence lands.
## Changes
- **`DbThread`** / **`Thread`**: New `draft_prompt: Option<String>`
field, included in `to_db()`/`from_db()`
- **`AcpThread`**: Bridge field with getter/setter, populated during
`register_session()`
- **`NativeAgent::save_thread()`**: Copies draft from `AcpThread` →
`Thread` before persisting
- **`AcpThreadView`**: Restores draft into `MessageEditor` on load;
syncs editor text → `AcpThread` via observer; debounced (500ms) Thread
notify triggers DB save
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
If you place your cursor inside an agent diff you can now jump to the
corresponding file by running `editor: Open excerpts`/`editor: Open
excerpts split`.
https://github.com/user-attachments/assets/cf3dba4e-68b7-4643-b9a9-844c2df58295
Release Notes:
- agent: Allow jumping to a file from a diff inside the agent
conversation with option-enter (`editor: Open excerpts`)
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This PR includes the following adjustments:
- Add divider in the full screen view to expose what part of a
subagent's output is actually sent to the parent model
- Auto-expand the subagent card if there's only one running on a turn
- Adjust errors display within the subagent card
Release Notes:
- N/A
- Increase hit area of both the preview expansion as well as the full
screen expansion
- Add the ability to stop a subagent from the full screen view
- Fix subagent state display in the full screen view (e.g., we were
showing the green check mark even when the subagent was cancelled)
- Make card header font size consistent with the thread through a new
enum value in `LabelSize`
- Refine tooltip content and display
- Fix slight layout shift happening between the "there is no thread" and
"there is a thread" states
---
Closes #ISSUE
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Allow the parent agent to handle cases where the subagent is running on
of context window. Also communicates if it has completely out of
context.
Release Notes:
- N/A
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
After looking around a bit, I felt like subagent wasn't the right way to
introduce this tool to the model. And with some back and forth
verification + market research, we both agreed spawn_agent was a better
name for what this tool is doing.
It still calls the right tool if you ask for a subagent, but especially
if we move these to be running in the background, spawn will be a better
name anyway.
Release Notes:
- N/A
This PR adds a button in the `git: branch diff` view that allows to
quickly and easily send the entire diff to your last used agent for a
review. What this does is automatically submits a (pre-written and
generic) prompt to the last agents you were using in the agent panel
with the whole content of your diff.
<img width="750" height="1964" alt="Screenshot 2026-02-18 at 3 35@2x"
src="https://github.com/user-attachments/assets/493d8cf4-4815-4b01-91a0-6a39ad6219fe"
/>
Release Notes:
- Added a "Review Branch" button in the `git: branch diff` view so that
the whole diff can be quickly sent for review to an agent.
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
<img width="800" height="1200" alt="image"
src="https://github.com/user-attachments/assets/2b765edc-4be4-476e-891a-9dd81fac2626"
/>
Add icon decorations on the agent icon in the sidebar to show thread
status:
- **Generation done**: blue dot (existing behavior, unchanged)
- **Blocked on tool permission/confirmation**: yellow warning triangle
- **Thread stopped due to an error**: red X
Priority order for decorations: confirmation > error > done > running
spinner.
Confirmation and error decorations persist as long as the thread is
actually in that state and always show regardless of whether the
workspace is active (unlike the blue dot which is notification-based).
(No release notes because this is all feature-flagged.)
Release Notes:
- N/A
This PR fixes issues with subagent cancellation, prior to this we would
still show a wait indicator for subagents that were cancelled from the
parent thread. We also removed the `stop_by_user` workaround, that code
path now uses `thread.cancel` directly
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This showed up mostly in agents that stream terminal output to Zed that
the title wasn't updated in time to see the command when needing to
provide permissions.
Release Notes:
- acp: Fix for ACP terminal titles not always being updated to their
latest value.
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Removes the feature flag around listing and loading existing sessions
for external agents.
Release Notes
- acp: Expose session history for all external agents that support it.
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
### Description
Related Discussions: #44499, #35742, #31851
Display cost multiplier for GitHub Copilot models in the model selectors
(Both in Chat Panel and Inline Assistant)
<img width="436" height="800" alt="image"
src="https://github.com/user-attachments/assets/c9ebd8fa-4d55-4be8-b3e1-f46dbf1f0145"
/>
### Some technical notes
Although this PR's primary intent is to show the cost multiplier for
GitHub Copilot models alone, I have included some necessary plumbing to
allow specifying costs for other providers in future. I have introduced
an enum called `LanguageModelCostInfo` for showing cost in different
ways for different models. Now, this enum is used in `LanguageModel`
trait to get the cost info.
For now to begin with, in `LanguageModelCostInfo`, I have specified two
ways of pricing: Request-based (1 Agent request - GitHub Copilot uses
this) and Token-based (1M Input tokens / 1M Output tokens). I had
initially thought about adding a `Free` type, especially for Ollama but
didn't do it after realizing that Ollama has paid plans. Right now, only
the Request-based pricing is implemented and used for Copilot models.
Feel free to suggest changes on how to improve this design better.
Release Notes:
- Show cost multiplier for GitHub Copilot models
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
## Summary
Fixes https://github.com/zed-industries/zed/issues/48684
- Await `parsing_idle()` after `set_language()` in both
`Diff::finalized()` and `PendingDiff::finalize()` so that tree-sitter
parsing completes before buffer snapshots are taken for excerpts
- Without this, the 1ms sync parse timeout almost always expires for
non-trivial files, causing excerpts to be created with empty syntax
trees and missing syntax highlighting
## Root Cause
When the agent panel creates or finalizes a diff, it creates a new
`Buffer`, calls `set_language()` (which triggers async tree-sitter
parsing), then immediately proceeds to take buffer snapshots and create
excerpts **without waiting for parsing to complete**. The sync parse
timeout is only 1ms in production (`buffer.rs:1138`), so large files
almost always fail the sync parse and fall back to async parsing — but
no one awaits the async parse before building the diff.
## Fix
Add `buffer.update(cx, |buffer, _| buffer.parsing_idle()).await` after
`set_language()` in both code paths (`Diff::finalized()` and
`PendingDiff::finalize()`). This is the same pattern already used in
`buffer_diff.rs:1728-1731`.
## Test plan
- [x] `cargo test -p acp_thread` — all relevant tests pass
- [x] `./script/clippy` — no warnings
- [x] Manual test: open agent panel, ask it to generate a Python file
with multiline strings (`"""`), verify syntax highlighting is correct
after diff is finalized
Release Notes:
- Fixed missing syntax highlighting for multiline strings in agent panel
diffs
Closes #ISSUE
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- Fixed an issue where no error was shown when an LLM request exceeded
the maximum tokens supported by the model
This PR actually fixes two issues:
- the thread title being overridden even after it's been manually
edited; as you go and come back from the thread history view, the edited
title would get swapped for the auto-summarized one
- the parent thread title sometimes displaying the title of a subagent
thread; this would also override the manual edit
- - -
- [x] Tests
- [x] Code Reviewed
- [x] Manual QA
Release Notes:
- Agent: Fixed thread titles being overridden even when manually edited.
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This PR updates the model selector to highlight the latest models that
are available through the Zed provider:
<img width="388" height="477" alt="Screenshot 2026-02-06 at 1 46 41 PM"
src="https://github.com/user-attachments/assets/70760399-ecf6-46e3-80a7-cb998216c192"
/>
Closes CLO-205.
Release Notes:
- Added a "Latest" indicator to highlight the latest models available
through the Zed provider.
This PR extends error telemetry coverage in the agent panel, building on
#46836 which added telemetry for thread errors.
`"Agent Panel Error Shown"` (extended)
Now also fires for:
- **Load errors** - when an agent fails to start
- **Configuration errors** - when LLM provider setup is incomplete
`"Agent Token Limit Warning"` (new event)
Fires when a thread approaches or exceeds its token/context limit. This
is tracked separately from errors because it's an informational warning,
not a failure.
## Implementation Notes
- All telemetry fires **once per error occurrence**, not on every render
- Load error telemetry fires in `handle_load_error()` when the error is
first received
- Token limit telemetry uses a flag to track state transitions (Normal →
Warning → Exceeded)
- Configuration error telemetry tracks the last emitted error kind to
avoid duplicates
Release Notes:
- N/A *or* Added/Fixed/Improved ...
---------
Co-authored-by: Michael Benfield <mbenfield@zed.dev>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Follow up to https://github.com/zed-industries/zed/pull/47637
- Removes the requirement for the terminal to be focused to use the
`cmd->` keybinding. This way, we match the behavior of buffer selections
and you can always add what's selected in the terminal inside the agent
panel
- Add number of lines selected in the mention button as well
- Make the "Selection" menu item inside the "Add Context" menu also
observe terminal selections
<img width="420" height="254" alt="Screenshot 2026-01-29 at 1 36@2x"
src="https://github.com/user-attachments/assets/25d2eb00-096f-44d9-8882-273932ca43e4"
/>
Release Notes:
- Agent: Add number of liners selected in the terminal context mention
Summary
This PR adds the ability to quote terminal selections into Agent
threads, similar to how editor selections can be quoted. Users can now
select text in the terminal and add it as context to their agent
conversation.
### Features
- **Context menu**: Added "Add to Agent Thread" option to the terminal's
right-click menu (only shows when text is selected)
- **Keyboard shortcut**: The existing `cmd->` / `ctrl->` shortcut now
works in the terminal
- **Collapsed display**: Terminal output appears as a collapsed
"Terminal" crease in the chat, just like code references
- **Works with both thread types**: Supports both ACP-style threads
(Claude Code) and text threads
### Implementation
- Extended `quote_selection` handler to check for terminal panel focus
after checking for editor selections
- Terminal content is formatted as ` ```terminal` code blocks via new
`insert_terminal_crease` method
- Refactored crease insertion into `insert_crease_impl` helper to
support both code snippets (with `TextSnippet` icon) and terminal output
(with `Terminal` icon)
- Added automatic detection and folding of ` ```terminal` blocks in
`set_message` so terminal content stays collapsed in sent message
history
- Terminal creases use a trailing space instead of newline so cursor
behavior matches user expectations
### Demo
1. Select text in terminal
2. Right-click → "Add to Agent Thread" (or press `cmd->`)
3. Terminal content appears as collapsed "Terminal" block in chat
4. Send message - AI receives full terminal output, but chat history
shows it collapsed
### General note
I'm new to open source and the codebase in general so let me know if
anything should be different!
I tried to stay in line with other patterns I saw.
I didn't see a way to setup an end to end test with a real terminal so I
just added a unit test for the adding of the text to the chat, if it
exists and I missed it then I think the test coverage could be improved
with a test that uses a real terminal + running the command
<img width="431" height="148" alt="image"
src="https://github.com/user-attachments/assets/854732f9-2a7f-4f31-867e-d54af068c97c"
/>
Release Notes:
- agent: Added the ability to send selections from terminals into the
Agent thread
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
## Summary
This PR extends the `always_allow` tool permission patterns to work with
Nushell, Elvish, and Rc shells. Previously, these shells were
incorrectly excluded because they don't use `&&`/`||` operators for
command chaining. However, brush-parser can safely parse their command
syntax since they all use `;` for sequential execution.
## Changes
- Add `ShellKind::Nushell`, `ShellKind::Elvish`, and `ShellKind::Rc` to
`supports_posix_chaining()`
- Split `ShellKind::Unknown` into `ShellKind::UnknownWindows` and
`ShellKind::UnknownUnix` to preserve platform-specific fallback behavior
while still denying `always_allow` patterns for unrecognized shells
- Add comprehensive tests for the new shell support
- Clarify documentation about shell compatibility
## Shell Notes
- **Nushell**: Uses `;` for sequential execution. The `and`/`or`
keywords are boolean operators on values, not command chaining.
- **Elvish**: Uses `;` to separate pipelines. Does not have `&&` or `||`
operators. Its `and`/`or` are special commands operating on values.
- **Rc (Plan 9)**: Uses `;` for sequential execution and `|` for piping.
Does not have `&&`/`||` operators.
## Security
Unknown shells still return `false` from `supports_posix_chaining()`, so
`always_allow` patterns are denied for safety when we can't verify the
shell's syntax.
(No release notes because granular tool permissions are still
feature-flagged.)
Release Notes:
- N/A
---------
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Mirrors
3d4582d4dc.
We skip setting language on the secondary diff buffer which is not
needed and will improve performance and memory usage.
Release Notes:
- Improved memory usage of large ACP thread diff multibuffers.
- **title_bar: Extract platform_title_bar from title_bar**
- **file_finder no longer depends on search and agent_servers no longer
depend on language_models**
Release Notes:
- N/A
---------
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
We might interface with the LSP using URL heres across remotes that have
differing path styles which then breaks every now and then when we have
windows to unix connections. This should helps us fix these occurences
more correctly
Release Notes:
- N/A *or* Added/Fixed/Improved ...
This is behind the beta flag. But some agents don't support a full load
flow, but rather just a resume from the current state of the session.
They don't emit notifications for past thread messages, which isn't
ideal, but the user can at least resume their work without completely
losing it.
We use it as a fallback if the agent doesn't support loading only, and
signal to the user that they won't be able to see previous messages.
Release Notes:
- N/A
Many editors such as vim and emacs support "modelines", a comment at the
beginning of the file that allows the file type to be explicitly
specified along with per-file specific settings
- The amount of configurations, style and settings mapping cannot be
handled in one go, so this opens up a lot of potential improvements.
- I left out the possiblity to have "zed" specific modelines for now,
but this could be potentially interesting.
- Mapping the mode or filetype to zed language names isn't obvious
either. We may want to make it configurable.
This is my first contribution to zed, be kind. I struggled a bit to find
the right place to add those settings. I use a similar approach as done
with editorconfig (merge_with_editorconfig). There might be better ways.
Closes#4762
Release Notes:
- Add basic emacs/vim modeline support.
Supersedes #41899, changes:
- limit reading to the first and last 1kb
- add documentation
- more variables handled
- add Arc around ModelineSettings to avoid extra cloning
- changed the way mode -> language mapping is done, thanks to
`modeline_aliases` language config
- drop vim ex: support
- made "Local Variables:" handling a separate commit, so we can drop it
easily
- various code style improvements
---------
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Closes#44003
Supersedes https://github.com/zed-industries/zed/pull/45777
Co-authored-by: Lukas <lukas@zed.dev>
Release Notes:
- Fixed an issue where the terminal would sometimes fail to write shell
history.
---------
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>