Commit Graph
994 Commits
Author SHA1 Message Date
Max Brunsfeld b0a1bc16a0 Allow agent and terminal panels to be either flexible or fixed (#52694)
This PR adds the ability to change both the terminal and agent panels
between fixed and flexible sizing using the status bar button right
click menu. The value persists in your settings, similar to the dock
position.

I've also slightly tweaked the styling of the "Dock Left" and "Dock
Right" items in the right-click menu, adding the current value as an
item with a check beside it, to make it clear that it's a selectable
option.

Release Notes:

- N/A
2026-03-30 07:56:00 -07:00
Om ChillureandBennet Bo Fenner 2d74e9569a acp_thread: Clarify max token limit error message (#52724)
When generation stops due to the per-response output limit, Zed was
surfacing "Max tokens reached", which implies the full context window
was exhausted. In reality, `max_output_tokens` (the per-response cap)
may have been hit a different condition.

This change distinguishes between the two cases: if `output_tokens >=
max_output_tokens`, it surfaces "Maximum output tokens reached";
otherwise it falls back to "Maximum tokens reached".

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
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #50254


Note : Reopens #50372 suggested by @bennetbo 

Release Notes:

- Fixed misleading "Max tokens reached" error by distinguishing between
per-response output token limit and total context window limit.

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-30 13:55:03 +00:00
Ben Brandt 3c07f2d87c eval_cli: Make things a bit more resilient to different Docker envs (#52731)
Release Notes:

- N/A
2026-03-30 13:18:22 +00:00
Danilo Leal edfea87b80 agent_ui: Fix auto-scroll in subagent cards (#52719)
Due to the async nature of markdown parsing, sometimes subagent cards
would not scroll fully to the bottom of the content because the
`scroll_to_bottom` function was being called just while the agent was
running... and sometimes, it'd finish running before the markdown had
fully finished parsing. The solution is to remove the `is_running`
conditional.

Release Notes:

- Agent: Improved auto-scroll of subagent content in preview cards,
ensuring the content is always visible until the end.
2026-03-30 08:09:58 -03:00
Danilo Leal 11cb2aba83 agent_ui: Refine the thinking block display design (#52608)
Follow up to https://github.com/zed-industries/zed/pull/51525
Closes https://github.com/zed-industries/zed/issues/52452

This PR further refines the behavior of thinking blocks in the agent
panel. In the PR linked above, I had previously made it auto-expand
while running but then auto-collapse when finished. Although that
reduced the sense of staleness when the model is thinking for too long,
it caused layout shift that many found jarring.

Therefore, this PR changes the behavior so that, by default, thinking
blocks render "almost" fully expanded. They will have a max-height and
will auto-scroll as content streams in. Therefore, this design fully
removes layout shift and still allows you to sort of follow along the
generated thinking content, even though sometimes it can be fast, in
which case you can always fully expand it. Lastly, I'm also adding a
"thinking display" setting that allows to choose between the "automatic"
behavior (what I just described, the default), always expanded, or
always collapsed.

Here's a preview:


https://github.com/user-attachments/assets/c96c89c7-40ed-4e9b-9ffc-f70b0659be47

Release Notes:

- Agent: Refined thinking block display, removing layout shift while
still allowing it to be readable while it streams in. It comes together
with a "Thinking Display" setting to control the behavior
2026-03-30 07:34:05 -03:00
Bennet Bo FennerandBen Brandt 788318ffdd sidebar: Rework archive feature (#52534)
## Context

<!-- What does this PR do, and why? How is it expected to impact users?
     Not just what changed, but what motivated it and why this approach.

Link to Linear issue (e.g., ENG-123) or GitHub issue (e.g., Closes #456)
     if one exists — helps with traceability. -->

## How to Review

<!-- Help reviewers focus their attention:
- For small PRs: note what to focus on (e.g., "error handling in
foo.rs")
- For large PRs (>400 LOC): provide a guided tour — numbered list of
files/commits to read in order. (The `large-pr` label is applied
automatically.)
     - See the review process guidelines for comment conventions -->

## Self-Review Checklist

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] 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
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-03-30 10:17:48 +00:00
Ben Brandt 063dd8c780 eval_cli: Simplify build setup for more datasets (#52686)
Cleans up build setup and simplifies it a bunch so that we can use the
binary in more eval docker containers

Release Notes:

- N/A
2026-03-29 20:58:50 +00:00
Cameron Mcloughlin d64fa1b10d sidebar: Switch with ctrl-tab (#52423)
Overrides `ctrl-tab` when the sidebar/agent panel is focused to switch
between recently viewed threads

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-03-28 17:48:34 +00:00
Danilo Leal 312dfa4395 agent_ui: Use the CircularProgress component also for split token display (#52599)
This PR swaps numbers for two circular progress components for the
models that support displaying token usage broken down by input and
output tokens. Here's how the UI looks like:

<img width="500" height="386" alt="Screenshot 2026-03-27 at 5  03@2x"
src="https://github.com/user-attachments/assets/1fa01f6e-a8d8-40fd-a663-b95de6c79174"
/>

Release Notes:

- Agent: Make token usage display consistent between the models that
support displaying split usage (input and output) and those that don't.
2026-03-27 18:21:43 -03:00
Piotr Osiewicz 5bfedcb023 theme: Split out theme_settings crate (#52569)
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
2026-03-27 14:41:25 +01:00
Ben BrandtandBennet Bo Fenner eb4ce6c860 agent_ui: Delete metadata for empty released threads (#52563)
Keep sidebar metadata only for threads with entries. Important for ACP
agents especially that won't persist the thread.

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: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-27 10:11:50 +00:00
João SoaresandDanilo Leal 5ae99cf766 agent_ui: Fix message editor not expanding after sending a message (#52545)
Context

Tracks the previous `v2_empty_state` so `set_mode()` only fires on
actual state transitions, not every render frame.

Closes #52424

## Demo
### Before:


https://github.com/user-attachments/assets/76b61861-cebc-44ce-b483-596eeed19bb1

### After:




https://github.com/user-attachments/assets/9da9f3bc-2fc0-4182-8712-4f42d108650b



<!-- Videos/screenshots showing before and after go here -->

## How to review

1. `crates/agent_ui/src/conversation_view/thread_view.rs` — adds a
`was_v2_empty_state` field to gate the `set_mode()` call in
`render_message_editor()` so it only runs on transitions
2. `crates/agent_ui/src/agent_panel.rs` — test verifying that manually
setting the editor to Full mode survives a render cycle without being
reset back to AutoHeight

## Self-review checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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 agent chat input box not expanding after sending a message
(#52424)

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-03-27 01:47:48 -03:00
Danilo Leal 9bbb313f9a agent_ui: Move fully complete plan to the thread view (#52462)
When a plan generate by the plan tool fully completes, there's no need
for that to be in the activity bar anymore. It's complete and in the
next turn, the agent may come up with another plan and the cycle
restarts. So, this PR moves a fully complete plan to the thread view, so
that it stays as part of a given turn:

<img width="600" height="1858" alt="image"
src="https://github.com/user-attachments/assets/43ad4eb0-49d0-488c-bbbf-ab7956c1dd5a"
/>

The way this PR does this is by adding a new entry to `AgentThreadEntry`
and snapshotting the completed plan so we can display it properly in the
thread.

Release Notes:

- N/A
2026-03-26 18:23:19 -03:00
Danilo Leal 6a2baed5ae agent_ui: Display an activity bar for subagents waiting for permission (#52460)
Closes https://github.com/zed-industries/zed/issues/52346

Given the parallel nature of subagents calls, it's possible that there
is a subagent way out of view that's waiting for the user to give
permissions. Right now, it's kind of hard to know this and you may think
something wrong is happening given the thread generation isn't making
any progress.

This PR adds an "activity bar" to the thread view that displays
subagents on a "waiting for confirmation" status. We display the
subagent's summary label as well as allow clicking on it to quickly
scrolling to that subagent.

<img width="500" height="1100" alt="Screenshot 2026-03-25 at 10  09@2x"
src="https://github.com/user-attachments/assets/17d2d398-25fc-4660-85c2-bf66ec98c1f1"
/>

Release Notes:

- Agent: Improved the experience of interacting with subagents waiting
for confirmation.
2026-03-26 18:23:03 -03:00
Danilo LealandRichard Feldman 3618914994 agent_ui: Make thread generation top-down (#52440)
Ever since we introduced the agent panel the way it is right now back in
May 2025, we wanted to make the thread generation be top-down. Now, with
the changes we're planning to launch very soon revolving around parallel
agents, doing this become even more important for a better experience.
Particularly because in the agent panel's new empty state, the message
editor is full screen. We want to minimize as much as possible layout
shift between writing your first prompt and actually submitting it. So
this means that content will stream down from your first prompt and
auto-scroll you if it goes beyond the viewport.

To pull this off, we added a `follow_tail` feature directly to the GPUI
list so that we could only call it in the thread view layer as opposed
to doing it all there.


https://github.com/user-attachments/assets/99961819-6a79-40e0-b482-dca68c829161

Release Notes:

- Agent: Made the thread generation be top-down instead of bottom-up.
Agent content now streams from the top and auto-scroll as they go beyond
the viewport.

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2026-03-26 08:52:26 -03:00
Mikayla MakiandEric 29ab42c3d9 Add a setting for moving the sidebar to the right (#52457)
## Context

This adds a setting for controlling the sidebar side

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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: Eric <eric@zed.dev>
2026-03-26 01:35:10 +00:00
16a546a342 agent_ui: Add agent connection restart controls (#52401)
Track agent connection status in the configuration UI, show a
restart action for connected custom agents, and only render the
External Agents menu section when entries exist.

<img width="505" height="218" alt="image"
src="https://github.com/user-attachments/assets/117edd94-dd06-4b1f-a530-308b7219404b"
/>


Release Notes:

- acp: Allow for restarting agent servers from the Agent Settings panel.

---------

Co-authored-by: MrSubidubi <dev@bahn.sh>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-03-25 21:29:52 -03:00
Danilo Leal 01b9f4711e sidebar: Use last used agent when creating a new thread from it (#52446)
The "new thread" buttons as well as the `cmd-n` keybinding were
resetting the agent to the Zed one instead of following the agent
panel's behavior to use whatever agent was recently selected, as per the
key-value store.

Release Notes:

- N/A
2026-03-25 19:19:41 -03:00
Mikayla Maki 13b2ef0023 Add a button to remove the plan UI (#52360)
## Context

This PR adds a button to remove the plan UI, if the user wants.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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-03-25 09:01:15 -07:00
Ben Kunkle 4d94c640f4 Remove Sweep Integration (#52348)
Closes #52115

## Context

Removes the third party edit prediction integration for Sweep AI ahead
of their servers shutting down.

This PR will not affect those who are already use or plan to use their
open weighted models. The code removed by this PR was required for
integrating with their proprietary API.


## Self-Review Checklist

<!-- Check before requesting review: -->
- [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:

- Removed support for using the Sweep AI edit prediction provider
through their proprietary API, as the servers are shutting down
https://discord.com/channels/1100625416022138902/1100625417272045639/1480644297903575142,
https://x.com/wwzeng1/status/2033302698360180949
2026-03-25 10:23:05 -04:00
Bennet Bo FennerandGaauwe Rombouts d14c5c94e0 agent: Reduce DB load in ThreadMetadataStore (#52313)
## Context

We now batch multiple db operations together if they happen very
frequently (similar to how we handle it in `thread_history.rs`)

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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: Gaauwe Rombouts <mail@grombouts.nl>
2026-03-25 09:09:22 +01:00
Marshall Bowers 301dbe2dd2 cloud_llm_client: Move CompletionIntent to language_model (#52359)
This PR moves the `CompletionIntent` enum from the `cloud_llm_client`
crate to the `language_model` crate, as it is no longer part of the
Cloud interface.

Release Notes:

- N/A
2026-03-25 08:39:17 +01:00
Smit Barmase 24067e83ad agent_ui: Add support for pasting external files and directories (#52300)
This PR adds support to paste external files and directories in Agent
Panel, along with the existing image paste path.

  Release Notes:

  - Added support for pasting files and folders into the Agent Panel.
2026-03-25 04:17:45 +05:30
Ben Brandt a4f12354c9 eval: Port over evals for streaming edit tool (#52317)
Setting up the infra for unit evals on the new tool. For now,
replicating the eval setup as close as possible to the old tool.


## Self-Review Checklist

<!-- Check before requesting review: -->
- [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-03-24 21:28:17 +01:00
Max Brunsfeld 6c59fbb0c8 Make the agent panel have a flexible width (#52276)
Release Notes:

- The agent panel now has a flexible width, similar to the center panes
of the workspace.
2026-03-24 18:45:43 +00:00
Danilo Leal 829f3af7f5 agent_ui: Add some thread view design improvements (#52322)
This PR adds some small design refinements to the thread view: making
keybinding size consistent throughout, improving the activity bar
shadow, fixing the keybinding to open a file from an edit tool diff, and
other smaller spacing/color tweaks.

Release Notes:

- N/A
2026-03-24 11:08:34 -03:00
Danilo Leal 35ab3ef108 ui: Clean up unused icons (#52282)
This PR removes a bunch of unused icons in the codebase. Just cleaning
it up!

Release Notes:

- N/A
2026-03-24 09:16:13 -03:00
Danilo Leal 8b9e921cb1 agent_ui: Don't reset cursor position when editing queued messages (#52210)
## Context

When typing on the read-only queued message editor, we push the content
to the main, editable message editor. However, the cursor position was
being reset when that happened. This PR fixes that by tracking the
cursor offset when doing that, also accounting for the case where there
could be pre-existing content in the message editor.

## How to Review

- Queue a message in the agent panel
- Place your cursor somewhere in the middle of your queued message and
type something
- See how the cursor position is preserved once it goes down to the main
message editor

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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:

- Agent: Fix cursor position being reset when editing queued messages.
2026-03-23 20:12:44 -03:00
Danilo Leal c665cd3694 agent_ui: Fix full screen behavior on worktree creation (#52269)
## Context

This PR removes the behavior in which we turn the agent panel full
screen on worktree creation, even if there aren't any files open.
Changing the width behavior of the panel will ultimately solve this, and
auto-full screening it turned out to be surprising. Also, in reaction to
this, I've added an icon button in the agent panel's toolbar when in
full screen so it's easier to get out of it. Eventually though, we can
probably remove it (also because of the flexible width work).

## How to Review

- Create a new worktree from a thread and see the panel with the same
width
- See the "disable full screen" icon button in the toolbar when you full
screen it

--- 

- [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-03-23 20:07:40 -03:00
Mikayla Maki 392cdc5e86 Change the default panel layout (#52232)
This PR adjusts the default panel layout for anyone on the agent v2
feature flag.

Note that this changes the right status bar items to show in reverse
priority order, and then adjusts priorities so that the "project
management" buttons appear to the right, and the outline panel appears
to the far left. The reversal "cancels out" most of the priority
changes, except the outline panel and the collab panel.


## Self-Review Checklist

<!-- Check before requesting review: -->
- [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:

- Swapped the order of the collab and outline status bar buttons
2026-03-23 20:51:23 +00:00
6ae22a9b8f agent: Wait until linked git worktree state is loaded (#51395)
### Context 

This fixes a bug where the sidebar would show a newly created git
worktree thread as its own project while the recently created workspace
is loading its git state. The fix is adding project APIs to await the
initial worktree store scan and then each git repo initial snapshot;
then awaiting on them before adding the new workspace to the
multi-workspace.

### Architecture:

I added the `Worktree::Remote::wait_for_snapshot` API to
`Worktree::Local` to enable `WorktreeStore` to await for both remote and
local projects until there's an initial scan. The `WorktreeStore` uses
the watcher pattern so it can update the initial scan state whenever
visible worktrees are added or removed from the store.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added 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 Kunkle <ben@zed.dev>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-03-23 18:12:02 +01:00
Bennet Bo Fenner 109a59de77 Log when migrating thread metadata in ThreadMetadataStore (#52230)
## Context

This will make it easier to diagnose issues if any come up when
migrating thread metadata for the sidebar

## How to Review

<!-- Help reviewers focus their attention:
- For small PRs: note what to focus on (e.g., "error handling in
foo.rs")
- For large PRs (>400 LOC): provide a guided tour — numbered list of
files/commits to read in order. (The `large-pr` label is applied
automatically.)
     - See the review process guidelines for comment conventions -->

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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-03-23 16:57:12 +00:00
Anthony Eid 62b4e83284 agent: Make branch diff completion use same default branch as branch diff action (#52223)
## Context

Before this change the branch diff would compare with local main instead
of upstream main. This causes confusion because it's a different diff
than the branch diff action would show users, and cause agents to
potentially review a much larger diff then it has too.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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-03-23 17:14:35 +01:00
Eric Holk fa94d0eaee Move permission outcome construction out of the UI layer (#52050)
Follow-up to the terminal permission params refactor, addressing
@benbrandt's [review
feedback](https://github.com/zed-industries/zed/pull/51782#pullrequestreview-2926899804)
about string formatting leaking into the UI layer.

## Changes

### Outcome construction moved to acp_thread

- Added `PermissionOptionChoice::build_outcome(is_allow)` — builds a
`SelectedPermissionOutcome` from a choice, attaching
`SelectedPermissionParams::Terminal` when the choice carries
`sub_patterns`.
- Added
`PermissionOptions::build_outcome_for_checked_patterns(checked_indices,
is_allow)` — handles the `DropdownWithPatterns` per-command checklist
flow, returning `None` when zero patterns are checked (degrading to
once).

The UI's `authorize_with_granularity` no longer does any
`format!("always_allow:{}",...)` string formatting or
`SelectedPermissionParams` construction.

### `option_kind` folded into `SelectedPermissionOutcome`

`SelectedPermissionOutcome` now carries `option_kind:
acp::PermissionOptionKind`, eliminating the separate parameter that was
threaded through the entire `authorize_tool_call` chain:

```
ThreadView::authorize_tool_call
  → Conversation::authorize_tool_call
    → AcpThread::authorize_tool_call
```

Every signature in this chain dropped one parameter.

### `SelectedPermissionParams` removed from UI imports

The type is now only referenced by `acp_thread` (construction) and
`agent` (consumption). The UI passes `SelectedPermissionOutcome`
opaquely.

Release Notes:

- N/A
2026-03-23 09:13:58 -07:00
Richard Feldman bb75ad0644 Replace typewriter/hash worktree naming with adjective-noun pairs (#52221)
Replace the typewriter-brand + random-hash naming scheme for
auto-generated git worktree branches with an adjective-noun approach
(e.g. `swift-falcon`, `calm-meadow`).

- Removed the ~650-entry typewriter brand name list and hash generation
- Added 235 adjectives and 228 nouns (~53,500 unique combinations)
- Branch names are now checked for exact-match collisions against
existing branches
- Updated error messaging

Closes AI-101

Release Notes:

- Improved auto-generated git worktree branch names to use friendlier
adjective-noun pairs (e.g. `swift-falcon`) instead of typewriter brand
names with random hashes.
2026-03-23 11:43:53 -04:00
Ben BrandtandBennet Bo Fenner 7c6a1f7617 agent_ui: Don't reset provisional title if we already have one (#52193)
## Context

If you went back and edited the first message, we were resetting the
provisional title, even though the title had previously already been set
from a summarization pass.

In order to achieve this, we moved the default thread title logic up the
UI layer, and allowed AcpThreads to have an optional title.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-23 12:27:12 +00:00
Tom HouléandDanilo Leal 1d60d399fc MCP remote server OAuth authentication (#51768)
Closes #43162

Implements the OAuth 2.0 Authorization Code + PKCE authentication flow
for remote MCP servers using Streamable HTTP transport, as specified by
the [MCP auth
specification](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization).

Previously, connecting to a remote MCP server that required OAuth would
silently fail with a timeout — the server's 401 response was never
handled. Now, Zed detects the 401, performs OAuth discovery, and guides
the user through browser-based authentication.

Step-up authentication and pre-registered clients are not in scope for
this PR, but will be done as follow-ups.

## Overview

- **401 detection** — When the HTTP transport receives a 401 during
server startup, it surfaces a typed `TransportError::AuthRequired` with
parsed `WWW-Authenticate` header info.
- **OAuth discovery** — Protected Resource Metadata (RFC 9728) and
Authorization Server Metadata (RFC 8414) are fetched to locate the
authorization and token endpoints.
- **Client registration** — Zed first tries CIMD (Client ID Metadata
Document) hosted at `zed.dev`. If the server doesn't support CIMD, falls
back to Dynamic Client Registration (DCR).
- **Browser flow** — A loopback HTTP callback server starts on a
preferred fixed port (27523, listed in the CIMD), the user's browser
opens to the authorization URL, and Zed waits for the callback with the
authorization code.
- **Token exchange & persistence** — The code is exchanged for
access/refresh tokens using PKCE. The session is persisted in the system
keychain so subsequent startups restore it without another browser flow.
- **Automatic refresh** — The HTTP transport transparently refreshes
expired tokens using the refresh token, and persists the updated session
to the keychain.

## UI changes

- Servers requiring auth show a warning indicator with an
**"Authenticate"** button
- During auth, a spinner and **"Waiting for authorization..."** message
are shown
- A **"Log Out"** option is available in the server settings menu for
OAuth-authenticated servers
- The configure server modal handles the auth flow inline when
configuring a new server that needs authentication.

Release Notes:

- Added OAuth authentication support for remote MCP servers. Servers
requiring OAuth now show an "Authenticate" button when they need you to
log in. You will be redirected in your browser to the authorization
server of the MCP server to go through the authorization flow.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-03-23 12:54:08 +01:00
Suphachai Phetthamrong 51928dd730 agent_ui: Fix pasted image context showing Image instead of actual filename (#52082)
## What

Fix image context mentions always showing the generic label `Image`
instead of the actual filename when pasting from Finder or picking via
the `+` → Image button in the Agent Panel.

## Why

`insert_images_as_context` hardcoded the crease label to
`MentionUri::PastedImage.name()` (`"Image"`) for every image, regardless
of whether it originated from a named file. Both code paths that load
images from file paths — `paste_images_as_context` and
`add_images_from_picker` — discarded the filename before passing images
to the shared insert function.

## Fix

- `agent_ui/src/mention_set.rs`: Changed `insert_images_as_context` to
accept `Vec<(gpui::Image, SharedString)>` instead of `Vec<gpui::Image>`,
using the provided name as the crease label. In
`paste_images_as_context`, extract `file_name()` from each path and pair
it with the loaded image. Raw clipboard images (screenshots, copy from
image editors) continue to use `"Image"` as there is no filename.

- `agent_ui/src/message_editor.rs`: Same fix for
`add_images_from_picker` — extract `file_name()` from each selected path
and pass it alongside the image.

Closes #52079

## Test Plan

- [x] `cargo build -p agent_ui` compiles clean
- [x]  `cargo fmt --all -- --check` format check
- [x] Manual verification of:
- [x] Copy an image file in Finder (`Cmd+C`), paste into Agent Panel —
mention shows actual filename
   - [x] `+` → Image → pick a file — mention shows actual filename
   - [x] Screenshot paste (`Cmd+Shift+4`) still shows `Image`
   - [x] Regular text paste still works

## Screenshots

<img width="638" height="569" alt="image"
src="https://github.com/user-attachments/assets/859d852c-66f6-4faa-a5fe-59bd34cd3d85"
/>

---
Release Notes:

- Fixed image context mentions always showing `Image` instead of the
actual filename when pasting from Finder or using the image picker in
the Agent Panel
2026-03-23 10:58:32 +01:00
Bennet Bo Fenner e584b85b95 agent_ui: Focus prompt editor when clicking start in git worktree (#52181)
Release Notes:

- N/A
2026-03-23 09:53:21 +00:00
Bennet Bo Fenner c84eb6facc agent_ui: Remove duplicated function from agent panel (#52179)
Release Notes:

- N/A
2026-03-23 09:34:42 +00:00
Cameron Mcloughlin 89e861e7c5 agent: Set message editor language to markdown (#52113) 2026-03-22 04:15:35 +00:00
Danilo Leal 8dde5efe02 sidebar: Add another round of refinements (#52101)
- Change the branch button's tooltip to be more accurate given it
displays more stuff than only branches
- Hide the worktree dropdown menu when in a non-Git repo project
- Improve provisioned title truncation
- Remove the plus icon from the "view more" item to improve sidebar's
overall feel
- Remove the always visible "new thread" button but make it visible only
when you're in an empty thread state
- Add worktree icon in the thread item and tooltip with full path
- Space out the worktree name from the branch name in the git picker in
the title bar
- Swap order of views in the git picker to "worktree | branches | stash"
- Improve the "creating worktree" loading indicator

---
<!-- Check before requesting review: -->
- [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-03-21 16:22:32 -03:00
Gnome!andPiotr Osiewicz 591b3a0650 Swap arrayvec crate for heapless to use LenT optimization (#47101)
Swaps the `arrayvec` dependency for `heapless`, as the `heapless`
library allows changing the type used for the `len` field, which
`arrayvec` hard-codes to `usize`. This means that, for all the
`ArrayVec`s in Zed, we can save 7 bytes on 64 bit platforms by just
storing the length as a `u8`.

I have not benchmarked this change locally, as I don't know what
benchmarking tools are in this project.

As a small bit of context, I wrote the PR to `heapless` to add this
`LenT` generic after seeing a PR on the `arrayvec` crate that seems to
be dead now. Once I saw some of Zed's blog posts about the `rope` crate
and noticed the usage of `arrayvec`, I thought this might be a welcome
change.

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-03-21 14:05:30 +01:00
Ben Brandt 34d0a32479 acp: Add agent websites to the registry page (#52002)
## Context

The registry now distinguishes between websites and repos, so we can
show either or both if available.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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-03-20 21:54:59 +00:00
Bennet Bo Fenner eab4c9279b sidebar: Only migrate some threads (#52018)
## Context

We now only migrate up to 10 threads per project to the sidebar and also
ignore threads that do not have a workspace

## How to Review

<!-- Help reviewers focus their attention:
- For small PRs: note what to focus on (e.g., "error handling in
foo.rs")
- For large PRs (>400 LOC): provide a guided tour — numbered list of
files/commits to read in order. (The `large-pr` label is applied
automatically.)
     - See the review process guidelines for comment conventions -->

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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-03-20 22:33:19 +01:00
3fabed1614 Terminal permissions: Per-command pipeline UI (#49547)
## Summary

Adds a new permission UI for terminal pipeline commands (e.g. `cargo
test | tail`) that lets users selectively always-allow individual
commands in the pipeline, rather than only offering a blanket
always-allow for the first command.

## Screenshot

<img width="464" height="293" alt="Screenshot 2026-03-18 at 3 27 48 PM"
src="https://github.com/user-attachments/assets/e027eeec-c2b3-4f73-a596-95f42a9adad2"
/>

Release notes:
- The terminal permissions UI now allows you to select individual
subcommands independently.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-03-20 18:55:49 +00:00
Ben BrandtandBennet Bo Fenner 04e4309154 agent_ui: Smarter logic for when we drop background threads (#52016)
## Context

Previously we were very eagerly dropping threads from memory. However,
reloading threads has a cost:
- For our agent, we have to replay events, which is lossy
- It's slower for external agents
- Some agents don't support reloading

So we keep the most recent 5 idle threads (or all threads who can't be
reloaded) and clean up our list after every insertion.


## Self-Review Checklist

<!-- Check before requesting review: -->
- [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:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-20 17:13:28 +00:00
Ben Brandt 4ad5b2c288 acp: Set agent server cwd from project paths (#52005)
## Context

Add Project::default_path_list and reuse it for agent session work
directories and ACP server startup so agent processes start in the
project context by default

We previously removed all cwd from this hoping to have a global process
shared, but it doesn't work for remote projects. Since we're at the
project boundary anyway, we might as well start it up in a similar spot
as a new thread.


## Self-Review Checklist

<!-- Check before requesting review: -->
- [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:

- acp: Make sure the agent server is started in a project directory
2026-03-20 15:20:15 +01:00
Ben BrandtandBennet Bo Fenner cb59eec007 agent_ui: Update thread metadata on more thread events (#52010)
## Context

Two reasons:
1. We need to update updated_at in more cases
2. We weren't refreshing the sidebar often enough with status updates.

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-20 12:48:46 +00:00
Ben Brandt 2728ccb8ac acp: Support terminal auth methods (#51999)
## Context

Brings in support for the new terminal auth methods. Currently behind
AcpBeta feature flag while the RFD stabilizes

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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-03-20 10:12:00 +00:00