Cherry-pick of #54648 to stable
----
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
Closes #ISSUE
Release Notes:
- agent: Fixed an issue where clicking on "New from summary" would not
do anything
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Cherry-pick of #54612 to stable
----
This PR fixes a regression that was likely caused by:
https://github.com/zed-industries/zed/pull/54183 and wasn't caught
because I didn't add a regression test when I originally created the
feature.
The fix was only running the hooks when the worktree was just created,
and I added an integration test to prevent regressions from occurring
again in the future.
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
Closes#54598
Release Notes:
- git: Fix create worktree hook tasks running when switching worktrees
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
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:
- git: Fix remote branch picker
Cherry-pick of #54555 to stable
----
Fixes ZED-6Q0
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#54544
Release Notes:
- Fixed a crash that could occur when git worktree creating fails
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Cherry-pick of #54554 to stable
----
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#54547
Release Notes:
- bedrock: Fixed an issue where Opus 4.7 would not work because of an
invalid model ID
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
I checked the temporary fix against the 0.233.2 bump - however, some
other guy fixed (and thus changed) the commit authors from 0.233.3. Or,
to put it differently:
<img width="356" height="250" alt="image"
src="https://github.com/user-attachments/assets/d053c1cc-efc3-462e-a0a5-45b999eec9f6"
/>
Anyway, this fixes the temporary fix and also cherry-picks the singular
checking support to stable so that should something else come up, we can
look at that.
Release Notes:
- N/A
Cherry-pick of #54332 to preview
----
Follow up to #54206
`on_flags_ready` relied on the fact that the `FeatureFlagStore` was only
set once the flags had been received from the server.
However, after #54206 the global gets instantiated earlier, without the
flags being resolved.
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 <bennet@zed.dev>
Cherry-pick of #54431 to preview
----
Insert sessions before awaiting `session/load` so replayed
`session/update` notifications can find 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:
- acp: Fix for some replay events getting dropped when loading a
previous session.
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Cherry-pick of #54461 to preview
----
The report summary previously assumed that every commit that had a
review would also have an associated PR - this was no longer the case
with Zippy PRs that are allowed without PR. This pull request fixes this
wrong assumption.
Release Notes:
- N/A
---------
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Finn Evers <finn.evers@outlook.de>
Cherry picks for the next v0.233.x preview release, focused on agent
panel and sidebar fixes and improvements. Built incrementally so CI can
validate as we go.
### Cherry-picked PRs
Listed in the order they were applied (chronological merge order on
`main`). `[x]` = applied on this branch.
- [x] #54055 — sidebar: Move to new workspace non-Wayland
- [x] #54417 — agent_ui: Sort thread import agents by display name
- [x] #54427 — agent_ui: Handle pagination of session/list correctly
when importing
- [x] #54402 — agent_ui: Remove history view
- [x] #54411 — agent_ui: Preserve session resume state after load errors
- [x] #54430 — Remove `AgentV2FeatureFlag`
- [x] #54360 — sidebar: Adjust display of workspaces in header's
ellipsis menu
- [x] #54224 — workspace: Fix recent-projects cleanup wiping active
workspaces
- [x] #54438 — Tweak wording around multi-folder project actions
- [x] #54450 — Close the empty project before adding a project to a
window
### Conflict resolution notes
- **#54402** — `crates/agent_ui/src/agent_panel.rs`: four hunks. The
incoming patch is against a
post-[#47154](https://github.com/zed-industries/zed/pull/47154) (gpui
`Corner` → `Anchor` rename) tree, which is not on `v0.233.x`. Kept
`Corner` in the `gpui::{...}` import, dropped the now-unused
`DismissEvent` import, removed the `render_recent_entries_menu` function
body and both `.when(show_history_menu && !agent_v2_enabled, ...)` call
sites in the toolbar — so the end state matches what #54402 produces on
`main` modulo the `Corner`/`Anchor` spelling.
- **#54411** — Applied cleanly after #54402 (in the original failed
attempt, a test-helper hunk in `conversation_view.rs` collided with
history-view test code that #54402 removes; ordering #54402 first made
this a no-op).
- **#54430** — Applied cleanly after #54402 (same reason: depends on the
`has_history_for_selected_agent` / `agent_v2_enabled` locals being
gone).
- **#54224** — Applied cleanly, but the new
`recent_projects_picker_workspace` test helper in
`crates/workspace/src/persistence.rs` initializes a `bookmarks:
Default::default()` field on `SerializedWorkspace`. That field comes
from the Bookmarks MVP
([#51404](https://github.com/zed-industries/zed/pull/51404) /
[#54174](https://github.com/zed-industries/zed/pull/54174)) which is not
on `v0.233.x`, so we dropped that one line to match the struct shape on
this branch.
Release Notes:
- Fixed unsaved scratch buffers being lost across restarts and an
occasional error when opening a recent project.
([#54224](https://github.com/zed-industries/zed/pull/54224))
---------
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: allison <28279548+transitoryangel@users.noreply.github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Cherry-pick of #54443 to preview
----
This reverts #54329 and the part of #52499 that was an earlier attempt
at the same thing, which caused us to incorrectly miss git state updates
on Windows. cc @Veykril it seems like we need to find a different way to
fix the problem of `.git` scanning cycles.
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:
- Fixed a bug causing stale git state on Windows.
Co-authored-by: Cole Miller <cole@zed.dev>
Cherry-pick of #54382 to preview
----
Fixes a user-reported bug where a thread could be missing from the
sidebar even though it was still present in the metadata store and still
visible in Thread History. The thread reappears in the sidebar only
after the user sends a message.
### Scenario
A single multi-root workspace whose roots are `[/cloud,
/worktrees/zed/wt_a/zed]`, where:
- `/cloud` is a standalone git repo (main == folder).
- `/worktrees/zed/wt_a/zed` is a linked worktree of a separate `/zed`
repo.
The project group normalizes to `main_worktree_paths = [/cloud, /zed]`.
A thread created in this workspace is written with `main=[/cloud, /zed],
folder=[/cloud, /worktrees/zed/wt_a/zed]` and the sidebar finds it via
`entries_for_main_worktree_path`.
If the thread's stored `main_worktree_paths` ever drifts from the group
key — e.g. a stale row loaded from the store on startup, a legacy write,
or a row persisted with `main == folder` — all three existing lookups in
`Sidebar::rebuild_contents` miss:
1. `entries_for_main_worktree_path([/cloud, /zed])` — the thread's
stored main doesn't equal the group key.
2. `entries_for_path([/cloud, /zed])` — the thread's folder paths don't
equal the group key either.
3. The linked-worktree fallback iterates the group workspaces'
`linked_worktrees()` snapshots. Those yield *sibling* linked worktrees
of the repo, not the workspace's own roots, so `/worktrees/zed/wt_a/zed`
doesn't match.
The row falls out of the sidebar entirely even though the metadata is
intact and the thread's folder paths exactly equal the open workspace's
roots. The store heals the stored row on the next `RootThreadUpdated`
event, which is why sending a message makes the row reappear — but until
then the sidebar misrepresents the state.
### Fix
Add a fourth lookup to `Sidebar::rebuild_contents`: for each open
workspace in the group, query the store by the workspace's own root
paths. Any thread whose `folder_paths` matches an open workspace's roots
belongs under that group, regardless of what its `main_worktree_paths`
say.
This covers the gap between stale-row load and store self-heal, matches
the principle that the sidebar should reflect state that exists in a
reasonable way, and is symmetric with the existing lookups (same store
API, one more iterator).
### Commits
1. `sidebar: Add failing repro for thread disappearing from sidebar` —
adds `test_sidebar_keeps_multi_root_thread_with_stale_main_paths` which
reproduces the bug. Sets up the multi-root + linked-worktree layout,
persists a thread in the stale shape, and asserts the row is still
visible in the sidebar.
2. `sidebar: Show threads whose folder paths match an open workspace` —
the fourth-lookup fix. 31 lines in `crates/sidebar/src/sidebar.rs`, no
deletions.
### Verification
- `cargo test -p sidebar`: 103 passed, 0 failed (the new test was
failing before commit 2 and is passing after).
- `./script/clippy -p sidebar`: clean.
### Follow-ups
The three existing lookups in `rebuild_contents` are each covering a
different historical shape the store can be in. A real cleanup — do a
one-shot migration on reload that fills in `main_worktree_paths` for any
row missing it, then retire the two legacy-shape lookups — is worth
doing as a separate PR, but out of scope here.
Release Notes:
- Fixed an issue where agent threads could go missing from the sidebar.
Co-authored-by: Eric Holk <eric@zed.dev>
Cherry-pick of #54406 to preview
----
This PR fixes an issue where we'd show incorrect worktree labels when
opening a linked worktree directly. The linked worktree name would be
displayed in the project button but the dedicated worktree button would
be displaying "main", which is incorrect.
Now that we have a dedicated worktree button in the title bar, we can
make the project button always show the root repository name,
effectively matching the threads sidebar.
Release Notes:
- Fixed the title bar worktree button showing "main" when opening a
linked git worktree directly.
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
This will be fully replaced by
https://github.com/zed-industries/zed/pull/54342 - however, this will
not help for the next week on the stable branch, since we have plenty of
non-signed commits on that branch currently.
Thus, adding this temporary check here to fix this and which is a
cherry-pickable change. This **will** be fully replaced by the linked
PR, however, I cannot cherry pick that since we would otherwise need to
force-push the branches to remove the bad commits.
Release Notes:
- N/A
Cherry-pick of #54387 to preview
----
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
Closes #ISSUE
Release Notes:
- N/A
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Cherry-pick of #54397 to preview
----
Regression in https://github.com/zed-industries/zed/pull/54125
Release Notes:
- agent: Fixed an issue where the default Zed model would not get
selected after sign-in completed
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Cherry-pick of #54183 to `v0.233.x`.
This PR makes Zed only have one worktree picker, as opposed to a flavor
of it in the title bar and another in the agent panel. It then moves it
to the title bar, making it always present, so that its trigger is
separate from the branch picker (which now contains only two views:
branches and stashes). For the worktree picker, I'm mostly favoring the
behavior we've introduced in the agent-panel-flavored version.
It also updates the title bar settings migration to use the JSON
`migrate_settings` helper instead of a shallow Tree-sitter rewrite, so
old `show_branch_icon = true` values are promoted to
`show_branch_status_icon = true` across root, platform, release-channel,
and profile settings scopes.
### Conflicts resolved
- `crates/migrator/src/migrations.rs` and
`crates/migrator/src/migrator.rs` — kept both the existing
`m_2026_04_15` (HTTP context servers) migration already on `v0.233.x`
and the new `m_2026_04_17` (branch icon) migration from this
cherry-pick, in order.
- `crates/agent_ui/src/agent_panel.rs` — dropped the now-removed
`CreateWorktree`, `SwitchWorktree`, `NewWorktreeBranchTarget`, and
`ToggleWorktreeSelector` imports while preserving `ShowThreadMetadata` /
`ShowAllSidebarThreadMetadata` that landed via the omnibus cherry-pick
(#54368). Removed the top-level `anyhow!` import (only used inside
`#[cfg(test)]`, which has its own import); kept `chrono` since it's
still used by the metadata UI.
Release Notes:
- Improved migration of the title bar branch status icon setting.
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Cherry-pick of #54370 to preview
----
This PR improves the hover state in thread items within the history view
by making them more stable. There were other thread events calling a
refresh, which would clear the hover state even though I'd still be
hovering the item, making the buttons that only appear on hover feel
unstable and disappear.
Release Notes:
- Agent: Improve hover state stability on thread items within the
sidebar's history view.
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Cherry picks for the next v0.233.x preview release, focused on sidebar
and agent panel fixes and improvements. Built incrementally so CI can
validate as we go.
### Cherry-picked PRs
Listed in the order they were applied (chronological merge order on
`main`). `[x]` = applied on this branch; `[ ]` = todo; `[-]` = skipped.
- [x] #53956 — sidebar: Remove View More batched thread expansion
- [x] #53998 — Make flexible dock widths more closely match full-height
pane splits
- [x] #54006 — agent: Inline worktree info fetching to remove expects in
agent_panel
- [x] #53854 — Simplify parallel agents onboarding
- [x] #54025 — sidebar: Add some UI adjustments
- [-] #53982 — sidebar: Refactor thread time storage (skipped — paired
with revert #54078, net zero)
- [-] #54078 — Revert "sidebar: Refactor thread time storage (#53982)"
(skipped — paired with #53982, net zero)
- [x] #54090 — agent_ui: Do not show token limit callout for external
agents
- [x] #54126 — agent_ui: Adjust thread item component and fix thread
switcher
- [x] #54075 — Rename Archive view to Thread History
- [x] #54125 — agent: Auto-select user model when there's no default
- [x] #54128 — sidebar: Fix cmd-click in the header not taking to the
last workspace
- [x] #54178 — agent_ui: Fix UI issues with activity bar
- [x] #54187 — agent_ui: Only surface the regenerate title item for the
Zed agent
- [x] #54205 — agent: Clean up old remove worktree manage folder code
- [x] #54207 — Add list of open workspaces to the project group menu in
the sidebar
- [x] #54198 — Fix remote projects not appearing in the sidebar after
adding them to the window
- [x] #54206 — Feature flag overrides
- [-] #53100 — workspace: Skip read-only paths when choosing default
save location (skipped for this release)
- [-] #54183 — Move the worktree picker to the title bar + make it
always visible (skipped — very large refactor, deferred to a future
release)
- [x] #54314 — agent_ui: Add `show thread metadata` action
- [x] #54317 — sidebar: Open project header ellipsis menu on right-click
- [x] #54316 — agent_ui: Add setting for turning off content max-width
- [x] #54256 — Add support for Netpbm image previews
- [x] #54320 — sidebar: Consistently set `interacted_at`
- [x] #54318 — agent: Respect favorite model settings and sync UI
changes back to settings
- [x] #54348 — Always use `ArchiveSelectedThread` action for archiving
threads
- [x] #54353 — agent: When opening a remote thread check that the linked
worktree path exists
- [x] #54365 — Avoid constantly scrolling thread history to top as agent
generates
### Conflict resolution notes
- **#53956** — On `v0.233.x`, `sidebar_tests.rs` still contained
`test_search_finds_threads_hidden_behind_view_more`, which exercised
behavior #53956 removes. Deleted the test along with the rest of the
View More functionality; no changes to the substance of the
cherry-picked patch.
- **#53998** — Supersedes standalone cherry-pick PR #54366 (which can be
closed).
- **#53982 / #54078** — Skipped both. They form a refactor-and-revert
pair on `main` with net zero change. Since `v0.233.x` already has #54173
("sidebar: Fix sidebar thread times") applied on top of the pre-#53982
state, pulling both in would be churn with no end-state difference.
- **#54025** — `crates/ui/src/components/ai/thread_item.rs`: accepted
incoming side for the `worktree_tooltip_title` removal and converted the
patch's `match (wt.kind, wt.branch_name)` structure back to `v0.233.x`'s
`match wt.kind` structure (the #54067 tuple match isn't on this branch).
Dropped the `linked_worktree_count` local after it became unused.
- **#54207** — `crates/sidebar/src/sidebar.rs`: accepted incoming side
for the project group menu restructure. This removes the
`show_multi_project_entries` gate around the "Remove Project" entry that
#54025 added — matching `main`'s state at #54207's parent.
- **#54314** — `crates/agent_ui/src/agent_panel.rs`: merged both sides
of two import conflicts, adding `ShowAllSidebarThreadMetadata` and
`ShowThreadMetadata` alongside the
`CreateWorktree`/`NewWorktreeBranchTarget`/`SwitchWorktree`/`ToggleWorktreeSelector`
imports that remain on `v0.233.x` (#54183 isn't here). Also merged the
`anyhow` and `chrono` `use` lines.
- **#54183** — Skipped. It's a 3,379/4,702-line refactor that moves the
worktree picker from the agent panel to the title bar. Too risky for a
preview release; should be handled as a dedicated PR if/when we want it
on `v0.233.x`.
Release Notes:
- Fixed a bug where flexible docks resized incorrectly in certain cases.
([#53998](https://github.com/zed-industries/zed/pull/53998))
- Fixed an issue where resizing a flexible-width panel in the left dock
would also resize fixed-width panels.
([#53998](https://github.com/zed-industries/zed/pull/53998))
- Agent: Fixed worktree and branch labels not showing up in the thread
switcher. ([#54126](https://github.com/zed-industries/zed/pull/54126))
- Agent: Fixed the thread switcher not selecting on hover.
([#54126](https://github.com/zed-industries/zed/pull/54126))
- Renamed the threads Archive view to Thread History and updated its
icon to a clock.
([#54075](https://github.com/zed-industries/zed/pull/54075))
- Agent: Automatically select a model when there's no selected model or
configured default.
([#54125](https://github.com/zed-industries/zed/pull/54125))
- Agent: Fixed a bug where cmd-clicking on the project header wouldn't
actually take you to the last active workspace.
([#54128](https://github.com/zed-industries/zed/pull/54128))
- Agent: Added a new `limit_content_width` setting in the agent panel
that allows turning off the content max-width limit.
([#54316](https://github.com/zed-industries/zed/pull/54316))
- Added support for PNM image previews (`.pbm`, `.ppm`, `.pgm`).
([#54256](https://github.com/zed-industries/zed/pull/54256))
- Agent favorite models now remember and restore per-model thinking,
effort level, and fast mode preferences.
([#54318](https://github.com/zed-industries/zed/pull/54318))
---------
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
Co-authored-by: Vinícius Dutra <dutravinisousa2@usp.br>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Cherry-pick of #54062 to preview
----
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: Cole Miller <cole@zed.dev>
Cherry-pick of #54215 to preview
----
## Summary
Fixes a crash I hit running Zed Preview against a checkout with many
linked git worktrees. The panic was:
```
thread '<unnamed>' panicked at crates/worktree/src/worktree.rs:5334:25:
update_git_repositories: .git path outside worktree root is not a gitfile: "/Users/eric/repo/zed/.git"
```
The `debug_assert!` in `update_git_repositories` was added in #53443 to
catch the case where a `.git` path outside the worktree root is not a
gitfile. The comment there explained that a `.git` outside the root
should always be a gitfile (as in a linked worktree or submodule), so
the assertion was meant to flag "should never happen" paths.
But there's a second legitimate case: after a linked worktree's
repository has been unregistered from `git_repositories` (for example
because its gitfile was removed, or because the filesystem watcher for
the common git dir lost sync and rescan-driven cleanup dropped the
entry), a subsequent rescan event on the main repo's `.git` directory
arrives at the linked worktree's scanner with the common git dir as the
`dot_git_dir`. That path:
- is outside the linked worktree's root (so it doesn't strip-prefix
cleanly), and
- is a real directory (not a gitfile), because it's the main repo's
`.git`.
So the assertion fires, but `continue` is already the right thing to do
— there's simply nothing left for this scanner to do with a path that
isn't its repository anymore.
On macOS, the trigger in practice is the FSEvents API setting
`MustScanSubDirs` / `UserDropped` / `KernelDropped` on an event (which
`notify` surfaces as `need_rescan()`), which our `FsWatcher` converts
into a `PathEvent { path: <watched path>, kind: Rescan }`. Because every
linked worktree registers a watcher on the same shared common git dir,
one kernel drop fans out into many rescan callbacks, and any one of them
hitting a worktree whose repo was just unregistered triggers the panic.
## Changes
- `crates/worktree/src/worktree.rs` — drop the `debug_assert!`, broaden
the comment to cover both cases.
- `crates/worktree/tests/integration/main.rs` — add a failing regression
test that drives the exact sequence (repo unregistered, then a Rescan
event on the common git dir) and asserts it doesn't panic.
The two commits are split so the test commit reproduces the panic on its
own, and the fix commit on top makes it pass.
Release Notes:
- N/A
Co-authored-by: Eric Holk <eric@zed.dev>
Cherry-pick of https://github.com/zed-industries/zed/pull/54201 into
Preview
Bumps the `lsp-types` rev which contains patch for breaking change
introduced by upstream `typescript-go` repo
Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Fixed tsgo LSP
Cherry picks for today's preview release, bringing the v0.233.x branch
up to date with fixes for archive threads on remotes and sidebar thread
time ordering.
### Cherry-picked PRs
Requested for this release:
- #54074 — agent: Fix `find_or_create` repository to support remote
- #54173 — sidebar: Fix sidebar thread times
Pulled in as dependencies so the requested PRs apply cleanly (preferring
to carry over additional changes rather than modify the cherry-picked
patches):
- #53991 — Only archive worktrees that Zed created
- #54001 — agent: Support remote archive thread git operations
- #54014 — Avoid showing draft threads in the sidebar or storing them in
the database
- #54088 — Use Fs abstraction for worktree directory removal
### Conflict resolution notes
- **#54014** — The previous omnibus cherry-pick (#54111) pulled in later
refactors that extracted `LIST_QUERY` to a `const` without including
#54014's `WHERE session_id IS NOT NULL` filter or its draft-cleanup
migration. I applied the filter to the existing `const LIST_QUERY` and
kept the branch's `run_thread_metadata_migrations` helper in the
affected test, rather than reverting to #54014's inline forms.
- **#54173** — On v0.233.x, `sidebar_tests.rs` still contains
`test_search_finds_threads_hidden_behind_view_more` (removed from main
by #53956, which isn't on this branch). That test calls
`save_thread_metadata`, so #54173's signature change — adding an
`interacted_at: Option<DateTime<Utc>>` parameter — required a mechanical
`None,` argument added to this one additional call site beyond what the
cherry-pick touched.
No changes were made to the substance of any cherry-picked patch.
Release Notes:
- N/A
---------
Co-authored-by: Richard Feldman <richard@zed.dev>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Cherry-pick of #54188 to preview
----
Fixes#54140
When `RulesLibrary::count_tokens` calls
`CloudLanguageModel::count_tokens` for Google cloud models, it does so
inside a `cx.update` closure, which holds a mutable borrow on the global
`AppCell`. The Google provider branch then called
`token_provider.auth_context(&cx.to_async())`, which created a new
`AsyncApp` handle and tried to take a shared borrow on the same
`RefCell` — causing a "RefCell already mutably borrowed" panic.
This only affects Google models because they are the only provider that
counts tokens server-side via an HTTP request (requiring
authentication). The other providers (Anthropic, OpenAI, xAI) count
tokens locally using tiktoken, so they never call `auth_context` during
`count_tokens`.
The fix makes `CloudLlmTokenProvider::auth_context` generic over `impl
AppContext` instead of requiring `&AsyncApp`. This allows the
`count_tokens` call site to pass `&App` directly (which reads entities
without re-borrowing the `RefCell`), while all other call sites that
already pass `&AsyncApp` (e.g. `stream_completion`, `refresh_models`)
continue to work unchanged.
Release Notes:
- Fixed a crash ("RefCell already mutably borrowed") that could occur
when counting tokens with Google cloud language models.
Co-authored-by: Richard Feldman <richard@zed.dev>
Cherry-pick of #54077 to preview
----
<img width="767" height="428" alt="Screenshot 2026-04-16 at 11 29 13 AM"
src="https://github.com/user-attachments/assets/e8b450fa-aefc-4dec-a286-b211bd492011"
/>
Add Claude Opus 4.7 (`claude-opus-4-7`) to the anthropic, bedrock, and
opencode provider crates.
Key specs:
- 1M token context window
- 128k max output tokens
- Adaptive thinking support
- AWS Bedrock cross-region inference (global, US, EU, AU)
Release Notes:
- Added Claude Opus 4.7 as an available language model
Co-authored-by: Richard Feldman <richard@zed.dev>
Cherry-pick of #54135 to preview
----
Release Notes:
- Fixed a crash that would occur when an ACP server process exited
unexpectedly.
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Cherry-pick of #54130 to preview
----
Release Notes:
- Fixed an issue where thread titles remained in the generating state if
the generation failed.
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Cherry-pick of #54115 to preview
----
Release Notes:
- Fixed a bug where the agent panel would sometimes close if you
scrolled up or down while it was zoomed.
Co-authored-by: Lukas <lukas@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Lukas <lukas@zed.dev>
Cherry-pick of #54103 to preview
----
It seems their verification got stricter, at least stricter than
Anthropics. Only set the output config if we have an effort.
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#54036
Release Notes:
- copilot_chat: Fix invalid reasoning effort for some models.
Co-authored-by: John Tur <john-tur@outlook.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: John Tur <john-tur@outlook.com>
Cherry-pick of #54002 to the v0.233.x preview branch.
Conflict resolution notes:
- Removed `WHERE session_id IS NOT NULL` from `LIST_QUERY` since the
draft threads cleanup PR (#54014) is not on this branch yet.
- Updated tests to use foreign channels so they pass on all of Dev,
Nightly, Preview, and Stable. See
https://github.com/zed-industries/zed/pull/54022 for cherry picking back
to main.
Release Notes:
- N/A
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
### Docs update.
- adding 'what is Dexter' one-liner
- adding config examples
Self-Review Checklist:
- [x] 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
✅ Elixir LS update -
[PR](https://github.com/zed-extensions/elixir/pull/115) merged
Release Notes:
- N/A
---------
Co-authored-by: AltCode <altcode@vivaldi.net>
HTTP context servers don’t support the settings field, so remove it
during migration to avoid confusion. Other context server types are
unaffected.
Closes#44786.
https://github.com/user-attachments/assets/4cabf405-c9e7-4d6e-a43d-f642fc4771e0
Release Notes:
- Removed deprecated key from HTTP `context_servers`
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- N/A
---------
Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Track new telemetry:
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)
- [-] 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>
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: Max Brunsfeld <maxbrunsfeld@gmail.com>