Commit log

301075d gpui_linux: Force scene rebuild after GPU device recovery (#52389) (cherry-pick to stable) (#52400)

Click to expand commit body
Cherry-pick of #52389 to stable

----
After GPU device recovery clears the atlas, the next frame could
re-present a stale scene via the needs_present path (which skips scene
rebuilding). The stale scene references texture IDs that no longer exist
in the cleared atlas, causing an index-out-of-bounds panic.

Fix this by setting a force_render_after_recovery flag when device
recovery completes. The platform refresh loop reads this flag and passes
force_render: true in RequestFrameOptions, ensuring GPUI rebuilds the
scene before presenting.

Fixes ZED-5QT

Release Notes:

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

29d574c elixir: Fix `HEEx` name and add `EEx` defaults (#49812)

Click to expand commit body
- zed-extensions/elixir#61 renames `HEEX` to `HEEx`; to prevent any
disruptions from that change, this adds the correct name alongside a
settings migration
- zed-extensions/elixir#101 adds support for `EEx` templates; this sets
the default language server to be the same as that of `Elixir` and
`HEEx`

This also adds a few more extensions that should be recognized as `HEEx`
files

Release Notes:

- N/A

---------

Co-authored-by: Finn Evers <finn@zed.dev>

AltCode and Finn Evers created

f849b8b gpui_macos: Fix stale atlas key causing crash on None texture lookup (#51996) (cherry-pick to stable) (#52372)

Click to expand commit body
Cherry-pick of #51996 to stable

----
MetalAtlas::remove() used tiles_by_key.get(key) to look up the texture
ID but only called tiles_by_key.remove(key) when the texture became
fully unreferenced. When a tile was removed while other tiles remained
on the same texture, the key stayed in tiles_by_key as a stale entry.

Once subsequent removals deleted the texture, get_or_insert_with could
return the stale tile referencing a now-deleted texture slot, causing an
unwrap panic in MetalAtlasState::texture().

Fix: change .get(key) to .remove(key) unconditionally, matching the WGPU
and DirectX atlas implementations which already do this correctly.

Closes ZED-5KV

Release Notes:

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

8dc3e89 gpui_macos: Guard deferred AppKit calls against closed windows (#51992) (cherry-pick to stable) (#52227)

Click to expand commit body
Cherry-pick of #51992 to stable

----
MacWindow methods like activate(), zoom(), toggle_fullscreen(),
resize(), prompt(), and titlebar_double_click() capture the raw
native_window pointer and spawn detached async tasks on the foreground
executor. If the window is closed between the spawn and execution (e.g.
the user clicks the close button), the task sends AppKit messages to a
closed NSWindow, which throws an ObjC exception in
_changeKeyAndMainLimitedOK: and aborts the process.

Add an isVisible check inside each deferred task before sending messages
to the native window. After [NSWindow close], isVisible returns NO, so
the guard prevents the crash. Both the check and the subsequent AppKit
call execute synchronously within the same main-thread task, so there is
no TOCTOU race.

For prompt(), the else branch releases the alert object to avoid leaking
it; the oneshot sender inside the completion block is dropped, which
cancels the channel and propagates as an error to the caller.

Closes ZED-5TN


Release Notes:

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

269378b deepseek: Fix empty text segments causing issues (#52199) (cherry-pick to stable) (#52207)

Click to expand commit body
Cherry-pick of #52199 to stable

----
## Context

Deepseek seems to have started to return empty text deltas, which causes
issues cause their upstream API does not like empty text blocks to be
included in their request.

In practice this caused issues like `An assistant message with
'tool_calls' must be followed by tool messages responding to each
'tool_call_id'..., because the payload looked like this:

```
User {
    content: "Call the now tool a bunch of times",
},
Assistant {
    content: Some(
        "",
    ),
},
Tool {
    content: "The current datetime is 2026-03-23T13:21:24.084848+00:00.",
    tool_call_id: "call_00_iozCfHXJAPR13XwHiAwJ9OEw",
},
```

Now we filter out that empty text, which seems to fix the issue. This
matches our implementation for OpenAI

Closes #51854

<!-- 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
- [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:

- deepseek: Fixed issue with tool calling (`An assistant message with
'tool_calls' must be followed by tool messages responding to each
'tool_call_id'...`)

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

zed-zippy[bot] and Bennet Bo Fenner created

7f9b1be gpui_tokio: Fix `child task panicked: JoinError::Cancelled` panics (#51995) (cherry-pick to stable) (#51998)

Click to expand commit body
Cherry-pick of #51995 to stable

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

7cd4b54 Fix the inability to click the highlight tree view (#51927) (cherry-pick to stable) (#51929)

Click to expand commit body
Cherry-pick of #51927 to stable

----
Before:



https://github.com/user-attachments/assets/14de9b93-d1d0-4ac8-b51d-a0fe80543ca0


After:



https://github.com/user-attachments/assets/ec27b342-5a3b-4f5d-b28a-0db4256518ef



Release Notes:

- Fixed highlight tree view usability

Co-authored-by: Kirill Bulatov <kirill@zed.dev>

zed-zippy[bot] and Kirill Bulatov created

8421009 v0.228.x stable

Joseph T. Lyons created

ac06c0d open_ai: Fix tool output for /responses endpoint (#51789) (cherry-pick to preview) (#51791)

Click to expand commit body
Cherry-pick of #51789 to preview

----
We were sending the raw tool debug output as JSON to the model rather
than whatever the tool intended as content for the model.
Which meant we were sending unneeded information to the model, which
matters in the edit tool case.

Release Notes:

- N/A

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>

zed-zippy[bot] and Ben Brandt created

c0de3d4 livekit: Bump livekit version (#51771) (#51781)

Click to expand commit body
Release Notes:

- Fixed segfault at runtime on aarch64-linux when running static
constructors.

Jakub Konka created

4e95669 agent_ui: Remove special casing for previous built in agents (#51713) (#51718)

Click to expand commit body
Now that the migration has happened, we can stop making these ever
present

Release Notes:

- N/A

Ben Brandt created

5353435 gpui: Fix hash collision panics in ProfilingCollector (#51683) (cherry-pick to preview) (#51690)

Click to expand commit body
Cherry-pick of #51683 to preview

----
Release Notes:

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

7d1ce34 editor: Fix panic in `refresh_inline_values` when spanning cross excerpts (#51685) (cherry-pick to preview) (#51686)

Click to expand commit body
Cherry-pick of #51685 to preview

----
Fixes ZED-5VQ

Release Notes:

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

000f5a4 agent_ui: Disable editing and regeneration for subagent messages (#51654) (cherry-pick to preview) (#51658)

Click to expand commit body
Cherry-pick of #51654 to preview

----
We had inconsistent handling of this read-only behavior. Now subagents
should behave the same as agents that don't support editing

Release Notes:

- agent_ui: Fix inconsistent behavior for subagent views when focusing
on previous messages.

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>

zed-zippy[bot] and Ben Brandt created

20ed6dc vim: Fix helix select next match panic when search wraps around (#51642) (cherry-pick to preview) (#51649)

Click to expand commit body
Cherry-pick of #51642 to preview

----
Fixes ZED-4YP

Sort and deduplicate anchor ranges in do_helix_select before passing
them to select_anchor_ranges. When the search wraps past the end of the
document back to the beginning, the new selection is at a lower offset
than the accumulated prior selections, producing unsorted anchors that
crash the rope cursor with 'cannot summarize backward'.


Release Notes:

- Fixed a panic in helix mode with search selecting wrapping around the
document end

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

e114a3a buffer_diff: Fix panic when staging hunks with stale buffer snapshot (#51641) (cherry-pick to preview) (#51643)

Click to expand commit body
Cherry-pick of #51641 to preview

----
When the buffer is edited after the diff is computed but before staging,
anchor positions shift while diff_base_byte_range values don't. If the
primary (HEAD) hunk extends past the unstaged (index) hunk, an edit in
the extension region causes the overshoot calculation to produce an
index_end that exceeds index_text.len(), panicking in
rope::Cursor::suffix.

Fix by clamping index_end to index_text.len(). This is safe because the
computed index text is an optimistic approximation — the real staging
happens at the filesystem level via git add/git reset.

Closes ZED-5R2


Release Notes:

- Fixed a source of panics when staging diff hunks

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

3e70ab7 markdown_preview: Prevent stackoverflows in markdown parsing (#51637) (cherry-pick to preview) (#51639)

Click to expand commit body
Cherry-pick of #51637 to preview

----
Fixes ZED-5TR

Release Notes:

- Fixed a stack overflow when parsing deeply nested html in markdown
files

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

652ceb6 http_client: Fix GitHub downloads failing if the destination path exists (#51548) (cherry-pick to preview) (#51556)

Click to expand commit body
Cherry-pick of #51548 to preview

----
cc
https://github.com/zed-industries/zed/pull/45428#issuecomment-4060334728

Release Notes:

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

6a9f9cb git: Fix commit message generation in untrusted projects and block external diff (#51323) (cherry-pick to preview) (#51492)

Click to expand commit body
Cherry-pick of #51323 to preview

----
When on a untrusted project, if one was to try and use the commit
generation functionality, the command would fail because of the `-c
diff.external` configuration provided in `GitBinary::build_command`, as
git would interpret this as `""` and try to run that command.

This `-c diff.external` is a good safeguard to have on untrusted
repositories because it prevents random commands, configured in
`.git/config` from being run. For example, if one uses `git config
diff.external "touch bananas.txt"` and then run `git diff`, a new
`bananas.txt` file would be created.

However, it was still possible to bypass this safeguard using the
following strategy:

1. Specify a custom diff for a specific file format. For example, for
markdown files, with `printf '*.md diff=pwned\n' > .gitattributes`
2. Update the command run by the `pwned` diff, for example, `git config
diff.pwned.command "touch bananas.txt"`
3. Open Zed and attempt to generate a commit message in an untrusted
repository and check that a new `bananas.txt` file was created

This is only prevented by using the `--no-ext-diff` flag on the `diff`
command, so a new `GitBinary::build_diff_command` has been introduced
which simply wraps `GitBinary::build_command` and adds the
`--no-ext-diff` flag, if necessary.

As a side-effect, this also makes it so that generating a commit message
in an untrusted repository works again, which was accidentally broken on
https://github.com/zed-industries/zed/pull/50649 .

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 commit message generation in untrusted repositories

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

zed-zippy[bot] and Dino created

4e9666e agent: Fix session close capability check (#51479) (cherry-pick to preview) (#51486)

Click to expand commit body
Cherry-pick of #51479 to preview

----
Release Notes:

- agent: Fixed an issue where external agents would return an error
because unsupported ACP method was called

---------

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

zed-zippy[bot] , Bennet Bo Fenner , and Bennet Bo Fenner created

bf29e8b ep: Avoid including collaborator edits in edit history sent to model (#51343) (cherry-pick to preview) (#51428)

Click to expand commit body
Cherry-pick of #51343 to preview

----
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 *or* Added/Fixed/Improved ...

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

zed-zippy[bot] and Ben Kunkle created

ee2cf07 project: Fix semantic tokens coloring deleted diff hunks (#51386) (cherry-pick to preview) (#51387)

Click to expand commit body
Cherry-pick of #51386 to preview

----
Release Notes:

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

Co-authored-by: Lukas Wirth <lukas@zed.dev>

zed-zippy[bot] and Lukas Wirth created

7d41a53 git_ui: Fix "resolve with agent" merge conflict notification (#51290)

Click to expand commit body
Follow up to https://github.com/zed-industries/zed/pull/49807

This PR fixes the merge conflict notification by making it appear only
once per a given set of conflicted paths, as opposed to showing every
time the `ConflictsUpdated` or `StatusesChanged` even would fire.

Release Notes:

- N/A

Danilo Leal created

5eec7a8 v0.228.x preview

Joseph T. Lyons created

db9d975 agent: Support providers streaming edits out of order (#51286)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

8d49131 acp: Update to `0.10.2` (#51280)

Click to expand commit body
Updates to `0.10.2`, most notable change is implementing
`session/close`.

Release Notes:

- N/A

Bennet Bo Fenner created

cbb7982 docs: Allow navigating search results with arrow keys (#50901)

Click to expand commit body
Closes #50604


https://github.com/user-attachments/assets/8a85b39e-e463-4fee-bc1f-2a03fe193ce3


https://github.com/user-attachments/assets/8290bb06-1eaf-4852-9568-97654e30211e

### Results: 
Now, you can scroll the search results with the arrow keys.

### Suggestion:
While this is working, I like to propose some better UX.

When you scroll with the arrow keys, the whole search results are
scrolling along with the search bar. But, I think it would be better if
we keep the search bar fixed on top and only the results scroll. Here is
an example:


https://github.com/user-attachments/assets/af9dce73-27c6-407b-8180-2f771a85303b

If you think this will be better, please let me know, and I will update
this PR.

Thank you.

Release Notes:

- Fixed docs search results scrolling with arrow keys

---------

Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>

Abinash and Gaauwe Rombouts created

a540b7c livekit_client: Always use output device's reported channels num (#51276)

Click to expand commit body
Fixes a panic in livekit's process_reverse_stream for non-matching
channel counts, e.g., upmixing 2->4, or downmixing 2->1.

Release Notes:

- Fixed a panic in livekit when joining a channel using legacy audio
using a device with less or more than 2 channels.

Jakub Konka created

0c49aaa extension_rollout: Fix workflow file path (#51273)

Click to expand commit body
Release Notes:

- N/A

Finn Evers created

e5fb57c extension_rollout: Add incremental rollout (#51264)

Click to expand commit body
This will allow us to test changes against just a subset of extensions.
Another advantage is that extension workflows will be pinned, which
allows for easier debugging and better predictability.

Release Notes:

- N/A

Finn Evers created

2c59990 Do not load runnables and diagnostics in git panel (#51270)

Click to expand commit body
Release Notes:

- N/A

---------

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

Kirill Bulatov and Jakub Konka created

deccb78 agent_ui: Fix thread summarization not working (#51259)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

c08fd43 languages: Validate pylsp binary before returning from check_if_user_installed (#51034)

Click to expand commit body
Run `pylsp --version` via `delegate.try_exec()` in both branches of
`PyLspAdapter::check_if_user_installed` before returning the binary. If
execution fails (broken shebang, missing interpreter, etc.), log a
warning and return None so the system falls through gracefully instead
of surfacing an error dialog.

This matches the existing validation pattern used by TyLspAdapter and
RuffLspAdapter in their `fetch_server_binary` implementations.

No idea if this closes an issue but it sure was annoying on a system
where I deleted the pylsp environment I had. It surprised me too since I
had pylsp disabled in settings.

Release Notes:

- Fixed detection of when `pylsp` is not installed properly on a user's
system so that it doesn't get launched as an LSP when it doesn't exist.

Kyle Kelley created

b566631 Move threads sidebar into agent panel (#51241)

Click to expand commit body
* [x] Put back persistence of sidebar open state
* [x] when agent panel is docked right, put sidebar on the right side
* [x] remove stale entries from `SidebarsByWindow`

Release Notes:

- N/A

---------

Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>

Max Brunsfeld , Eric Holk , Mikayla Maki , and Anthony Eid created

f0e301c Redact string panics (#51248)

Click to expand commit body
String panics are a non-trivial percentage of the crashes we see at Zed,
and
doubly unfortunately they may incidentally include the contents of a
user's
buffer.

Although this hasn't happened yet (to my knowledge), I don't want to be
in the position of having received sensitive information this way.

See also https://github.com/rust-lang/rust/pull/153677

Release Notes:

- N/A

Conrad Irwin created

86a7572 ui: Add close and confirm button to breakpoint edit prompt block (#51239)

Click to expand commit body
This fixes a problem with our breakpoint prompt edit component where
there was no way through the mouse to close/confirm the edit a user was
making.


### Before
<img width="2382" height="108" alt="image"
src="https://github.com/user-attachments/assets/6ee7e26e-9f90-4c54-8bde-52b5f3084755"
/>
### After
<img width="1071" height="58" alt="Screenshot 2026-03-11 at 12 16 38 AM"
src="https://github.com/user-attachments/assets/8da5b499-90f6-4044-835a-302431ea934f"
/>

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

Anthony Eid created

e7a6599 ui: Fix end_hover gradient overlay in `ListItem` (#51237)

Click to expand commit body
This PR adds a bool method to the `ListItem` that allows to turn on the
gradient overlay in the `end_hover_slot`. Places that are not the
sidebar, at least at the moment, don't need it. And with the previous
code, they were getting it, which felt wrong.

Release Notes:

- N/A

Danilo Leal created

b13a8e8 agent_ui: Enable mentioning branch diff with main (#51235)

Click to expand commit body
As a follow up to the possibility of sending the branch diff to an agent
review, this PR enables directly @-mentioning the content of your diff
with main to the agent. Here's a quick video of it:


https://github.com/user-attachments/assets/f27b7287-c9b9-4ccf-875e-4ac6ce4cd8ad

Release Notes:

- Agent: Enabled mentioning the branch diff with main.

Danilo Leal created

7bf7309 danger: Add a check for changing Collab database schemas (#51234)

Click to expand commit body
This PR adds a Danger check to remind contributors that any database
changes for Collab need to be done via a migration in the Cloud repo:

<img width="888" height="323" alt="Screenshot 2026-03-10 at 6 39 21 PM"
src="https://github.com/user-attachments/assets/5b3bbc3d-1e9d-409a-837b-565e1ca36935"
/>

Release Notes:

- N/A

Marshall Bowers created

51ba321 collab: Update test database schema (#51233)

Click to expand commit body
This PR updates the database schema for Collab tests, along with a
warning to not modify the file by hand.

Release Notes:

- N/A

Marshall Bowers created

38fa78c ci: Update workflows/scripts for deploying collab to use clang (#51224)

Click to expand commit body
Release Notes:

- N/A

Jakub Konka created

9ddaee0 sqlez: Open named in-memory databases as SQLite URIs (#50967)

Click to expand commit body
Closes #51011

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 *or* Added/Fixed/Improved ...

Danny Milosavljevic created

7132b67 Normalize `line_comments` strings to have a trailing space (#51033)

Click to expand commit body
I did a search for `/^line_comments = .*[^\s\[]"/` to identify these 3
languages:

- Git Commit
- Go Mod
- Go Work

that don't add/remove a trailing space for inline comments. I couldn't
find any indication that the absence of the trailing space is due to any
peculiarity of these languages.

---

For Git Commit, I should note that (strictly speaking) the comment
character is a single `#` without a trailing space, as Git removes any
line starting with the default comment character (`#`) (see
https://git-scm.com/docs/git-config#Documentation/git-config.txt-corecommentChar).

But I believe this change only affects whether `editor::ToggleComments`
adds/removes the space, and not how the file is syntax highlighted. So
for aesthetics and consistency, it should be better to add/remove the
trailing space.

---

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:

- Add/remove a space when toggling inline comments in Git Commit and Go
Mod/Work languages

Justin Su created

95aa4f2 git_graph: Add select first & last actions (#50956)

Click to expand commit body
This PR adds support for select first & last actions, as I was missing
them badly :).

**Example**:


https://github.com/user-attachments/assets/709037e6-544c-4891-8f48-7808d556a5a2

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

Remco Smits created

e9e7143 Add size to DiskState to detect file changes (#49436)

Click to expand commit body
## Summary

This fix addresses the cross-platform root cause identified in issue
#38109 where open buffers go stale or empty when external tools write
files.

## The Problem

The buffer's `file_updated()` method was only comparing `mtime` to
determine if a buffer needed to be reloaded. This caused a race
condition when external tools write files using `std::fs::write()`,
which uses `O_TRUNC` and creates a brief window where the file is 0
bytes:

1. Scanner re-stats → sees 0 bytes, mtime T
2. `file_updated()` sees mtime changed → emits `ReloadNeeded`
3. Buffer reloads to empty, stamps `saved_mtime = T`
4. Tool finishes writing → file has content, but mtime is still T (or
same-second granularity)
5. Scanner re-stats → mtime T matches `saved_mtime` → **no reload
triggered**
6. Buffer permanently stuck empty

## The Fix

Release Notes:

- Add the file `size` to `DiskState::Present`, so that even when mtime
stays the same, size changes (0 → N bytes) will trigger a reload. This
is the same fix that was identified in the issue by @lex00.

## Changes

- `crates/language/src/buffer.rs`: Add `size: u64` to
`DiskState::Present`, add `size()` method
- `crates/worktree/src/worktree.rs`: Pass size when constructing File
and DiskState::Present
- `crates/project/src/buffer_store.rs`: Pass size when constructing File
- `crates/project/src/image_store.rs`: Pass size when constructing File
- `crates/copilot/src/copilot.rs`: Update test mock

## Test plan

- [ ] Open a file in Zed
- [ ] Write to that file from an external tool (e.g., `echo "content" >
file`)
- [ ] Verify the buffer updates correctly without needing to reload

Fixes #38109

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>

Imamuzzaki Abu Salam , Claude Sonnet 4.5 , Ben Kunkle , and Jakub Konka created

074ca4c Enable diff stats in the git panel by default (#51215)

Click to expand commit body
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
- [X] 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:

- Enabled `diff_stats` in the git panel by default.

Joseph T. Lyons created

e4b3c0f agent: Re-use ACP connections per project (#51209)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>

Bennet Bo Fenner and Ben Brandt created

50aef1f buffer: Reload after undo when file changed while dirty (#51037)

Click to expand commit body
Closes #48697
Supersedes #48698
Related to #38109

## Problem

If you edit a file and an external tool writes to it while you have
unsaved changes, Zed tracks the new file but skips the reload to
preserve your edits. If you then undo everything, the buffer goes back
to clean but still shows the old content. The disk has moved on, but
nothing triggers a reload.

## Fix

In `did_edit()`, when the buffer transitions from dirty to clean, check
if the file's mtime changed while it was dirty. If so, emit
`ReloadNeeded`. Only fires for files that still exist on disk
(`DiskState::Present`).

7 lines in `crates/language/src/buffer.rs`.

### No double reload

`file_updated()` suppresses `ReloadNeeded` when the buffer is dirty
(that's the whole bug). So by the time `did_edit()` fires on
dirty-to-clean, no prior reload was emitted for this file change. The
two paths are mutually exclusive.

## Test plan

- New: `test_dirty_buffer_reloads_after_undo`
- No regression in `test_buffer_is_dirty` or other buffer tests
- All project integration tests pass
- clippy clean

Release Notes:

- Fixed an issue where buffer content could become stale after undoing
edits when an external tool wrote to the file while the buffer was
dirty.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>

lex00 , Claude Opus 4.6 , and Ben Kunkle created

f4b04af agent: Allow `NativeAgent` to work with multiple projects (#51202)

Click to expand commit body
This removes the assumption that one project <-> one native agent. The
native agent now maintains a project per session. We don't make use of
this right now, but it will come in handy once we start sharing ACP
connections globally.

Release Notes:

- N/A

Bennet Bo Fenner created

3d36d1f recent_projects: Fix open project buttons hidden when there are no recent projects (#51207)

Click to expand commit body
Release Notes:

- N/A

Smit Barmase created