Commit log

adb3533 agent: Add Opencode Zen provider (#49589)

Click to expand commit body
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)

Per Opencode's website:
> Zen gives you access to a curated set of AI models that OpenCode has
tested and benchmarked specifically for coding agents. No need to worry
about inconsistent performance and quality, use validated models that
work.
> - [x] Testing select models and consulting their teams
> - [x] Working with providers to ensure they're delivered properly
> - [x] Benchmarking all model-provider combinations we recommend

There are so many models available, but only a few work well with coding
agents. Most providers configure them differently with varying results.

The models under the Zen umbrella typically have a more reliable
token(s) per second speed with minimal outages. The opencode ecosystem
has improved my workflow if not many others' !

Release Notes:
- Added [Opencode Zen](https://opencode.ai/zen) to list of providers

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>

grim , Ben Brandt , and Bennet Bo Fenner created

b423194 acp_thread: Mark in progress plan items as pending (#52196)

Click to expand commit body
## Context

We were seeing some off by one errors because we weren't counting in
progress as either pending or completed.

Release Notes:

- acp: Fix plan stats showing all tasks as done when items were still in
progress.

Ben Brandt created

841ca10 agent_ui: Don't reset provisional title if we already have one (#52193)

Click to expand commit body
## 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>

Ben Brandt and Bennet Bo Fenner created

302aa85 MCP remote server OAuth authentication (#51768)

Click to expand commit body
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>

Tom Houlé and Danilo Leal created

968a13d ep: Fix prompt formatting bug (#52187)

Click to expand commit body
This bug was causing malformed `expected_output` for ~5% of v0316..v0318
examples

Release Notes:

- N/A

Oleksiy Syvokon created

f5e56b5 helix: Add support for line length in reflow command (#52152)

Click to expand commit body
* Add `editor::RewrapOptions::line_length` to, optionally, override the
  line length used when rewrapping text.
* Update `editor::Editor::rewrap_impl` to prefer
  `editor::RewrapOptions::line_length`, when set.
* Add a `line_length` field to the `vim::rewrap::Rewrap` action.
* Update the `:reflow` vim command with `vim::command::VimCommand::args`
  so as to be able to parse the provided argument as `usize`, ensuring
  that no effect is taken if the argument can't be parsed as such.

Release Notes:

- N/A

Dino created

71667cf sidebar: Fix workspace and project leaking on window close (#52169)

Click to expand commit body
Release Notes:

 - n/a

Lukas Wirth created

4466d10 agent_ui: Fix pasted image context showing Image instead of actual filename (#52082)

Click to expand commit body
## 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

Suphachai Phetthamrong created

cf4848d agent_ui: Focus prompt editor when clicking start in git worktree (#52181)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

70d1940 agent_ui: Remove duplicated function from agent panel (#52179)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

6f2e4b0 ep: Store cumulative and average log-probabilities of predictions (#52177)

Click to expand commit body
For now, the only source of logprobs is `./run.py infer`, which writes
them to under the `.predictions` struct. `ep score` copies these values
to `.score`. There is some duplication (same value stored in two
places), which is unfortunate, but can't be fixed without reworking how
scores are stored.


Release Notes:

- N/A

Oleksiy Syvokon created

4b1a2f3 search: Fix focus replacement field when opening replace (Ctrl+H) (#51061)

Click to expand commit body
Previously, focus stayed on the search bar because a pre-focus check
`handle.is_focused(window)` was always false at deploy time.

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: When opening find-and-replace with `Ctrl+H`, the replacement
input is now focused instead of the search bar.

Giorgi Merebashvili created

b1e8473 git_ui: Support side-by-side diff view in clipboard selection diff (#51966)

Click to expand commit body
#### Context

Switches `TextDiffView` from using `Editor` directly to
`SplittableEditor`, enabling side-by-side diff view support for "Diff
Clipboard with Selection". The diff view now respects the user's
`diff_view_style` setting.

Split out from #51457. This PR contains only the `SplittableEditor`
wiring. The multibuffer coordinate fix for non-singleton editors will
follow in a separate PR.

Closes #50912 (partially)

#### How to Review

Small PR — all changes are in `crates/git_ui/src/text_diff_view.rs`.
Focus on:
- `new()`: `SplittableEditor::new` replaces `Editor::for_multibuffer`,
editor-specific setup goes through `rhs_editor()`
- Item trait delegation: `act_as_type`, `for_each_project_item`,
`set_nav_history` updated for `SplittableEditor`
- Tests: pinned `DiffViewStyle::Unified` and assertions go through
`rhs_editor()`

#### 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

#### Video : 
[Screencast from 2026-03-19
23-11-36.webm](https://github.com/user-attachments/assets/c5a2381d-238d-43ef-ac6f-9994996c0c69)


#### Release Notes:

- Improved "Diff Clipboard with Selection" to support side-by-side diff
view style.

Om Chillure created

b4bd3ff ep: Add new prompt format (#52167)

Click to expand commit body
This PR adds `v0318`, which is just like `v0316` but with bigger blocks.
It seems to perform best so far.

It also adds heuristics to avoid placing the marker token on closing
braces, which results in much nicer blocks.

Finally, it fixes a bug with inserting `<|marker_N|>` mid-line in
`v0316` and `v0317`.



Release Notes:

- N/A

Oleksiy Syvokon created

8b822f9 Fix regression preventing new predictions from being previewed in subtle mode (#51887)

Click to expand commit body
## 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. -->
Fixes some issues with https://github.com/zed-industries/zed/pull/51842
Namely that the tests were scattered and not well organized (this PR
also makes them more thorough), and a regression where holding the
modifiers for the accept prediction keybind would not cause an incoming
prediction to be immediately previewed.

## 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:

- (Preview v0.229.x only) Fixed a regression where holding the modifiers
for the accept edit prediction keybind would not immediately preview
predictions as they arrived

Ben Kunkle created

fb1a98c multi_workspace: Add actions to cycle workspace (#52156)

Cameron Mcloughlin created

42e7811 sidebar: Fix highlighting "new thread" element after cmd-n (#52105)

Danilo Leal created

87cf32a agent: Set message editor language to markdown (#52113)

Cameron Mcloughlin created

e8d2627 Fix incorrect rainbow bracket matching in Markdown (#52107)

Click to expand commit body
## Context

Fixes #52022.

Rainbow bracket matching could become incorrect when tree-sitter
returned ambiguous bracket pairs for the same opening delimiter. The
repair path rebuilt pairs using a shared stack across all bracket query
patterns, which let excluded delimiters like Markdown single quotes
interfere with parenthesis matching.

This change scopes that repair logic to each bracket query pattern so
ambiguous matches are rebuilt without mixing unrelated delimiter types.
It also adds a regression test for the Markdown repro from the issue.

<img width="104" height="137" alt="image"
src="https://github.com/user-attachments/assets/4318bb4d-7072-4671-8fb5-c4478a179c07"
/>

<img width="104" height="137" alt="image"
src="https://github.com/user-attachments/assets/07a8a0fc-7618-4edb-a14e-645358d8d307"
/>


## How to Review

Review `crates/language/src/buffer.rs` first, especially the fallback
repair path for bogus tree-sitter bracket matches.

Then review `crates/editor/src/bracket_colorization.rs`, which adds
regression coverage for the issue repro.

## 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:

- Fixed rainbow brackets in Markdown when quotes caused parentheses to
match incorrectly

Kai Kozlov created

e126857 sidebar: Add another round of refinements (#52101)

Click to expand commit body
- 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

Danilo Leal created

4a965d1 Feat unbind (#52047)

Click to expand commit body
## Context

This PR adds an `Unbind` action, as well as syntax sugar in the keymaps
for declaring it
```
{
  "unbind": {
    "tab: "editor::AcceptEditPrediction"
  }
}
```
Is equivalent to
```
{
  "bindings": {
    "tab: ["zed::Unbind", "editor::AcceptEditPrediction"]
  }
}
```
In the keymap, unbind is always parsed first, so that you can unbind and
rebind something in the same block.

The semantics of `Unbind` differ from `NoAction` in that `NoAction` is
treated _as an action_, `Unbind` is treated as a filter. In practice
this means that when resolving bindings, we stop searching when we hit a
`NoAction` (because we found a matching binding), but we keep looking
when we hit an `Unbind` and filter out keystroke:action pairs that match
previous unbindings. In essence `Unbind` is only an action so that it
fits cleanly in the existing logic. It is really just a storage of
deleted bindings.

The plan is to rework the edit predictions key bindings on top of this,
as well as use `Unbind` rather than `NoAction` in the keymap UI. Both
will be done in follow up PRs.

Additionally, in this initial implementation unbound actions are matched
by name only. The assumption is that actions with arguments are bound to
different keys in general. However, the current syntax allows providing
arguments to the unbound actions. Both so that copy-paste works, and so
that in the future if this functionality is added, keymaps will not
break.

## How to Review

- The dispatch logic in GPUI
- The parsing logic in `keymap_file.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:

- Added support for unbinding key bindings from the default keymaps. You
can now remove default bindings you don't want, without having to
re-declare default bindings that use the same keys. For instance, to
unbind `tab` from `editor::AcceptEditPrediction`, you can put the
following in your `keymap.json`
```
[
  {
    "context": "Editor && edit_prediction",
    "unbind": {
      "tab": "editor::AcceptEditPrediction"
    }
  }
]
```

Ben Kunkle created

0f1e8a6 agent: Fix summarization model being cleared by unrelated registry events (#52080)

Click to expand commit body
## Context

We were seeing lots of pending title generation, which should only
happen if we don't have a summarization model.

`handle_models_updated_event` unconditionally overwrote the thread's
summarization model on every registry event, even with `None`. 

We should only setting if explicitly changed by the user or we haven't
set it yet, and only if we actually have one.

It is hard to reproduce this issue.. but I don't think this code was
right in the first place anyway.


## 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

Ben Brandt created

aabc967 Swap arrayvec crate for heapless to use LenT optimization (#47101)

Click to expand commit body
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>

Gnome! and Piotr Osiewicz created

abec0ef ci: Run clippy for x86_64-apple-darwin target (#52036)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>

Cole Miller , Finn Evers , and Jakub Konka created

d663dbb gpui_macos: Fix x86_64 build error in Submenu (#52059)

Click to expand commit body
Missed in #52028.

Release Notes:

- N/A

Tree Xie created

17e4b49 livekit_client: Screensharing on Niri + NixOS (#52017)

Click to expand commit body
Release Notes:

- Fixed a weird niche interaction between niri and nixos that broke
screensharing

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>

Cameron Mcloughlin and Jakub Konka created

b99200f agent: Add update_plan tool (#52048)

Click to expand commit body
## Context

Adds a tool to utilize the UI we already expose to ACP agents. Behind a
feature flag for now.

## How to Review

Mostly a tool to hook up to all of the plan plumbing we already have in
acp 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

Ben Brandt created

268f1d2 Ensure that sidebar toggle button works, regardless of focus (#52045)

Click to expand commit body
Previously, the sidebar toggle worked via an action, which is dependent
on what is focused. I changed it to directly call a method.

Release Notes:

- N/A

Max Brunsfeld created

3ee2f5b acp: Add agent websites to the registry page (#52002)

Click to expand commit body
## 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

Ben Brandt created

5b0af8d sidebar: Only migrate some threads (#52018)

Click to expand commit body
## 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

Bennet Bo Fenner created

22a33b7 vim: Add helix alias `reflow` for vim rewrap (#51788)

Click to expand commit body
Add support for Helix's `:reflow` command when vim or helix mode is
enabled.

Release Notes:

- Add support for helix's `:reflow` command

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>

Brandon Elam Barker and dino created

f586129 Terminal permissions: Per-command pipeline UI (#49547)

Click to expand commit body
## 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>

Eric Holk , Danilo Leal , and Ben Brandt created

66f3b32 Allow the keymap and settings UI to be opened without an active window (#49527)

Click to expand commit body
Closes #49155. 

<img width="470" height="304" alt="image"
src="https://github.com/user-attachments/assets/80d696ef-fabf-4745-b6e3-83315a84c8d0"
/>

Release Notes:

- UI: Allow the keymap and settings UI to be opened without an active
window

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
Co-authored-by: Finn Evers <finn.evers@outlook.de>

claire , MrSubidubi , and Finn Evers created

53db889 agent_ui: Smarter logic for when we drop background threads (#52016)

Click to expand commit body
## 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>

Ben Brandt and Bennet Bo Fenner created

b04e7f0 gpui_macos: Fix compilation on x86_64 (#52028)

Click to expand commit body
Release Notes:

- N/A or Added/Fixed/Improved ...

Lukas Wirth created

8f6e939 git_ui: Do not show "resolve with agent" as a collab guest (#51676)

Click to expand commit body
Release Notes:

- N/A *or* Added/Fixed/Improved ...

Lukas Wirth created

8f0826f acp: Set agent server cwd from project paths (#52005)

Click to expand commit body
## 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

Ben Brandt created

073d8d7 acp_thread: Handle session info title updates (#52011)

Click to expand commit body
## Context

Clear provisional titles and emit `TitleUpdated` when an agent provides
a new 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

Ben Brandt created

702b5dd livekit: Remove obsolete separate thread for frame feeder (#51993)

Click to expand commit body
Release Notes:

- N/A

Jakub Konka created

d30ceba agent_ui: Update thread metadata on more thread events (#52010)

Click to expand commit body
## 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>

Ben Brandt and Bennet Bo Fenner created

61c2a43 gpui: Add `disabled` state to app menu items (#44191)

Click to expand commit body
Continue #39876 to add `disabled` state to `MenuItem`.

Make this change for #44047 ready to have disabled state.

1. Add `disabled` state to `MenuItem`.
2. Add some builder methods to `Menu` and `MenuItem`.
3. Improve `set_menus` method to receive a `impl IntoIterator<Item =
Menu>`.

Release Notes:

- N/A

--

<img width="294" height="204" alt="image"
src="https://github.com/user-attachments/assets/688e0db8-6c4e-4f9b-a832-8228db0e95d8"
/>

```bash
cargo run -p gpui --example set_menus
```

Jason Lee created

d1177dc acp: Support terminal auth methods (#51999)

Click to expand commit body
## 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

Ben Brandt created

b45534a helix: Unflip default split binds (#51962)

Click to expand commit body
## Context

Closes #51955 

Some super easy helix parity. I checked and helix uses these binds for
splitting the editor, given these binds are helix specific, it would be
weird to just keep them being wrong.

## How to Review

just changed the default keymap for helix mode.

## 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:

- helix: fixed binds for splitting window

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

Finn Eitreim and Bennet Bo Fenner created

283bab5 gpui_tokio: Fix `child task panicked: JoinError::Cancelled` panics (#51995)

Click to expand commit body
This panic stemmed from us dropping the tokio runtime before dropping
wasm tasks which then could attempt to spawn_blocking, immediately
failing and panicking on unwrap inside wasmtime.

Closes ZED-5DE

Release Notes:

- N/A or Added/Fixed/Improved ...

Lukas Wirth created

2839676 git_ui: Fix multibuffer coordinate conversion in clipboard diff (#51985)

Click to expand commit body
## Context

Fixes the visual selection update in `TextDiffView::open` to properly
convert between buffer-local and multibuffer coordinates using
`buffer_point_to_anchor`. Previously, raw multibuffer Points were used
directly for line expansion, which produced incorrect regions when
expanded deleted diff hunks shifted multibuffer row numbers.

This provides a single unified code path for both singleton and
non-singleton multibuffers, as suggested in [#51457 review
feedback](https://github.com/zed-industries/zed/pull/51457#issuecomment-4091134303).

Follow-up to #51457.

## How to Review

Small PR - all changes are in `crates/git_ui/src/text_diff_view.rs`.
Focus on:

- `open()`: The visual selection update block now uses
`buffer_point_to_anchor` + `to_point` instead of raw multibuffer
coordinate math
- No more assumption that multibuffer Points == buffer-local Points
- Existing tests validate both singleton and non-singleton multibuffer
paths

## Self-Review Checklist
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed incorrect diff region when using "Diff Clipboard with Selection"
with expanded diff hunks in the editor.

Om Chillure created

fdf144f language_models: Fix the partial json streaming to not blast `\` everywhere (#51976)

Click to expand commit body
## Context

This PR fixes one of the issues in #51905, where model outputs are full
of errant `\` characters.

heres the problem: As the response is streamed back to zed, we
accumulate the message chunks and and need to convert those chunks to
valid json, to do that we use `partial_json_fixer::fix_json`, when the
last character of a chunk is `\`, the `fix_json` has to escape that
backslash, because its inside of a string (if it isn't, its invalid json
and the tool call will crash) and other wise you would end up escaping
the end `"` and everything would be messed up.

why is this a problem for zed:
T_0 is the output at some step.
T_1 is the output at the next step.

the `fix_json` system is meant to be used by replacing T_0 with T_1,
however in the editor, replacing the entirety of T_0 with T_1 would be
slow/cause flickering/etc.. so we calculate the difference between T_0
and T_1 and just add it to the current buffer state. So when a chunk
ends on `\`, we end up with something like `... end of line\\"}` at the
end of T_0,
in T_1, this becomes `... end of line\n ...`. then when we add the new
chunk from T_1, it just picks up after the \n because its tracking the
length to manage the deltas.


## How to Review

utils.rs:
fix_streamed_json => remove trailing backslashes from incoming json
streams so that `partial_json_fixer::fix_json` doesn't try to escape
them.
other files: call fix_streamed_json before passing to `serde_json`

I had claude write a bunch of tests while I was working on the fix,
which I have kept in for now, but the end functionality of
fix_streamed_json is really simple now, so maybe these arent really
needed.

## Videos
Behavior Before:


https://github.com/user-attachments/assets/f23f5579-b2e1-4d71-9e24-f15ea831de52

Behavior After:


https://github.com/user-attachments/assets/40acdc23-4522-4621-be28-895965f4f262


## 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:

- language_models: fixed partial json streaming

Finn Eitreim created

0570f6f wgpu: Fix surface validation error (#51935)

Click to expand commit body
Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: John Tur <john-tur@outlook.com>

Cameron Mcloughlin and John Tur created

93a226d Add an action dedicated to closing the sidebar (#51982)

Click to expand commit body
## Context

This PR adds an action that only closes the sidebar, rather than always
toggling.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [X] I've reviewed my own diff for quality, security, and reliability
- [N/A] Unsafe blocks (if any) have justifying comments
- [N/A] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [N/A ] Tests cover the new/changed behavior
- [N/A] Performance impact has been considered and is acceptable

Release Notes:

- Added a `multi workspace: close workspace sidebar` action.

Joseph T. Lyons created

690d5af sidebar: Add several refinements (#51980)

Click to expand commit body
## Context

- Improve how we detect when the sidebar should render the empty state.
It was previously wrong using `content.entries.is_empty`, which would
also happen if there are no search matches.
- Improved archive view keyboard nav and design. Not using the ListItem
here anymore so as to avoid confusing hover and active states.
- Move archive and open folder buttons to the bottom of the sidebar.
- Add a new flavor of the recent projects for the sidebar that only
serves as a way to _add_ projects.
- Add the ability to add (and remove) folders to a given project group
in the sidebar through a dropdown menu
--- 
- [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

Danilo Leal created

2d7c720 multiworkspace: Don't destroy workspace when git worktree is detached head (#51977)

Click to expand commit body
When a git worktree is in a detached HEAD state (e.g. after `git
checkout --detach`), the workspace for that worktree would disappear
from the sidebar UI, and if the workspace was currently open your UI
would just disappear.

This happened because `parse_worktrees_from_str` silently dropped any
worktree entries without a `branch` line in the porcelain output, which
cascaded through the `linked_worktrees` list and caused
`prune_stale_worktree_workspaces` to remove the workspace.

This PR:
- Makes `Worktree::ref_name` an `Option<SharedString>` so detached
worktrees can be represented
- Renames `Worktree::branch()` to `Worktree::display_name()`, which
returns the branch name when available or the short SHA as a fallback
(mirroring how the title bar already handles detached HEAD for
repositories)
- Updates `parse_worktrees_from_str` to include detached and bare
worktree entries instead of dropping them
- Filters detached worktrees out of the worktree picker UI, preserving
the existing product decision to only show branch-based worktrees there

## 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

Eric Holk created