5143 Commits

Author SHA1 Message Date
John Tur 4a4c8150f0 Bump tree-sitter to cf5d3a63 (#67174)
Release Notes:

- N/A

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 03:03:55 +00:00
Ben Brandt 988007a89a Update ACP SDK to 5.4.0 and align v2 session behavior (#67155)
Update to published ACP Rust SDK 5.4.0 (schema crate 1.19.0). Follow the
[protocol changes since schema
1.18](https://github.com/agentclientprotocol/agent-client-protocol/compare/v1.18.0...dbff792240171b199b5ad24d01406720ac9e4bd3)
for behavior Zed already implements:

- Use each parent's `replay_complete` marker to distinguish historical
child state and cancel capabilities from current updates. Keep current
child updates that arrive before the resume response, but wait for a
successful response before sending child controls. Detach descendants
when their root closes.
- Reply to agent-cancelled v2 permission requests and elicitations with
`cancelled` or `cancel`, respectively. Leave background requests and
tools alone when cancelling foreground work, and keep accepting agent
status updates.
- Ignore `pattern` in v2 elicitation forms, but keep validating it in v1
forms.

Cursor and fork-at-position UI, retaining history from a failed resume,
and automatic keyed prompt resend are out of scope. This PR uses the
published SDK and does not depend on an unreleased SDK fix.

Release Notes:

- N/A
2026-11-18 17:47:54 +00:00
Neel 264f0b67be Update piper to fix truncated file writes (#67160)
The zip extraction tests in `crates/util/src/archive.rs` fail
intermittently on Linux CI with errors such as `unable to locate the end
of central directory record`, for example in [this run on
main](https://github.com/zed-industries/zed/actions/runs/44141138965).

The cause is a bug in `piper` 0.2.4, where closing the `Writer` right
after writing can make the `Reader` lose bytes (fixed upstream in
smol-rs/piper#31, released as 0.2.5).

This only bumps `piper` in `Cargo.lock`.

## Testing

I reproduced the failure by running a test that extracts a small zip
20,000 times in a loop, with 48 copies of it running concurrently to
create CPU contention:

- `piper` 0.2.4: 47 of 48 runs failed, with `unable to locate the end of
central directory record`, `unexpected end of file`, or an empty
extracted file.
- `piper` 0.2.5: 0 of 96 runs of the full `archive::tests` module
(including the loop) failed.

The loop test is not included, since it only fails under heavy load and
exercises a dependency rather than our code.

Release Notes:

- Fixed a rare issue where files written by Zed, such as extracted
downloads, could be truncated
2026-11-18 17:23:22 +00:00
zed-zippy[bot] b840e80bf2 Bump Zed to v1.31.0 (#67157)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-11-18 16:32:17 +00:00
이대희 1043f4a86a git_ui: Add commit message model picker (#50674)
## Summary

Reworked per review to reuse the shared `LanguageModelSelector` instead
of a custom dropdown.

- The generate-commit-message button is now a split button: the primary
click generates, the chevron opens the same picker the Agent Panel uses
and saves to `agent.commit_message_model`.
- The picker lives in a new `language_model_selector` crate, moved out
of `agent_ui`, so `git_ui` can use it without a feature-crate dependency
the workspace forbids. `agent_ui` re-exports the moved items.
- The chevron stays enabled with no model configured, so a model can be
picked from there.

## Verification

- `cargo test` and `./script/clippy` pass for `language_model_selector`,
`agent_ui`, `git_ui`, `settings_content`, and `xtask`, including the
workspace dependency-direction test.
- Clicked through a debug build on Linux (NVIDIA GPU) with a real model
behind an OpenAI-compatible endpoint: the picker opens, searches, and
persists the selection; generating streams a message into the commit
editor in both the Git Panel and the commit modal; with no provider
configured, generate is disabled and the chevron still opens the picker.

### Showcase


https://github.com/user-attachments/assets/23812839-6d95-4167-b437-af7976655423

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Release Notes:

- Improved the Git Panel's commit editor with a picker that allows
selecting the model to be used for commit message generation.

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-11-18 13:23:57 +00:00
Cameron Mcloughlin 3dcdee6d2b sandbox: New linux sandbox (#67062)
Note: this PR does not change any behaviour of zed itself. The old
sandbox implementation is still in use. The code in this PR is not
considered secure. I'll need more time to torture it before I'm
confident :)

The old sandbox used `bwrap` to set up mounts to restrict FS access, and
an in-sandbox network proxy to forward HTTP requests. It has significant
limitations however:
- it cannot restrict FS access to paths that don't exist at sandbox
creation time. This means that files that become available while a
command is running are unprotected
- it cannot restrict FS access based on a glob - each individual mount
must be specified explicitly
- it cannot restrict network access that is not HTTP (i.e. SSH traffic).
- it cannot change permissions while a sandboxed command is running -
the grants given at the start of the execution are fixed. Agents can
request to re-run the app with broader permissions, which is fine, but
not great UX
- it cannot detect whether a command failed because it hit the sandbox
boundary or not. Again, agents can guess, but we'd like something more
robust
- it cannot dynamically prompt the user to escalate privileges

The new sandbox has a different different design which solves these
problems:
- all restrictions go through seccomp user notifications
- this allows us to register a supervisor process with the kernel to
validate the syscalls of another program. This supervisor can run
arbitrary userspace code to inspect syscalls before
allowing/denying/modifying them
- we create and upload a policy object to this supervisor which checks
syscalls against this policy
- if the policy says that the operation requires "ask"-ing, the
supervisor will ask zed to show a prompt to the user and report a
decision

This design is a lot more unified, and since it is much more flexible,
is also potentially suitable for sandboxing more parts of zed (user
terminals, LSP servers, etc.).

Release Notes:

- N/A
2026-11-17 12:43:21 +00:00
Felipe Arthur 430a781076 Fix duplicate language server notifications (#67021)
## Summary

Repeated language server messages could stack identical notifications
while previewing themes.

- Skip an actionless prompt when a visible prompt has the same server
name, level, and message.
- Compare those fields directly while retaining per-request numeric IDs
and keeping action-bearing prompts independent.
- Preserve the existing notification and its dismissal timer when
discarding a duplicate.
- Move LSP-specific auto-dismiss setup into the prompt instead of
generic notification handling.

Implementation:
[`show_language_server_prompt`](https://github.com/zed-industries/zed/blob/ffaa5fbe8c30bc819c3d118e688b28c1f1a64fe1/crates/workspace/src/notifications.rs#L228-L253)
and
[`LanguageServerPrompt::new`](https://github.com/zed-industries/zed/blob/ffaa5fbe8c30bc819c3d118e688b28c1f1a64fe1/crates/workspace/src/notifications.rs#L274-L303).

This changes visible-notification handling, not the upstream
settings-to-LSP configuration refresh path.

![Original reproduction
screenshot](https://github.com/user-attachments/assets/c3cce22e-e1b8-4047-ad44-8eda72bca659)

## Testing

### Automated validation

- `cargo test --offline -p workspace --lib`: 309 tests passed on the
updated PR branch.
- The notification tests also passed across 20 scheduler seeds before
the cleanup was moved onto the PR branch.
- The new deduplication tests failed on `main` with only the tests and
their dev-dependency added, confirming coverage of the original stacking
bug.
- Coverage includes server and severity differences, delimiter
collisions, empty/Unicode/64-KiB messages, mixed action/no-action
prompts, dismissal, suppression, disabled auto-dismiss, and a duplicate
arriving 999 microseconds into a 1 ms timeout.
- Scoped Rust formatting and `git diff --check` passed.

The follow-up cleanup was validated with automated tests, not a visual
app run.

### Original contributor's manual testing

The original contributor reported manual testing on Linux (X11, XFCE),
using ZLS 0.17.0 with Zig 0.18.0-dev to produce a version-mismatch
warning.
They also supplied this alternative rust-analyzer configuration for
triggering a warning:

```json
{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "checkOnSave": "invalid"
      }
    }
  }
}
```

1. Open a file handled by the affected language server and wait for its
warning notification.
2. Run `theme selector: toggle` and move through several themes.
3. Check that identical actionless notifications do not stack.

## Original contributor's self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed duplicate language server notifications appearing when switching
themes.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-11-16 10:57:46 +00:00
Ben Brandt 703b5ac3f4 Update ACP SDK to 5.3.0 and follow schema 1.18 rule changes (#66979)
Updates `agent-client-protocol` to 5.3.0 (schema 1.18.0) and brings what
Zed already implements in line with the rules that changed.

- **Plan operations: the `file` plan type is removed.** Markdown plans
carry an optional absolute `path` instead, and the client always renders
`content`. A markdown plan with a `path` keeps the collapsible plan row
and gets an "Open Plan File" button. A relative `path` is ignored, so
the plan has no file. Naming or changing the file counts as a change to
the plan, so it re-shows a dismissed plan, as a new URI did for file
plans.
- **Unknown v2 command types are no longer offered as slash commands.**
The spec used to let a client show a command type it doesn't understand
as a plain command. It now says the client must not. The composer only
offers `command` entries for completion, input hints, validation, and
the "/ for commands" placeholder. `AcpThread` still keeps the full list.
This also covers the new `skill` entries, which Zed doesn't advertise
support for.
- **The new `speed` config option category converts from v1.** The
`unstable` SDK feature now parses `speed` as a known category. The v1
conversion rejected categories it didn't list, so one `speed` option
would have failed the agent's whole option list.

Checked against the 1.18 docs, no change needed:

- `replay_complete` (v2) is ignored. Zed still treats the
`session/resume` response as the end of replay and discards the thread
when a resume fails, and the RFD keeps the subagent freshness boundary
at the response.
- The subagent clarifications already hold. An `unknown` state shows as
unconfirmed, and a session message without a sender renders as a message
from another session.
- Zed doesn't send `tool_call/cancel` or `terminal/cancel` once the tool
call is final or the terminal has exited.
- Zed doesn't call `session/options` or `session/fork`, so the new rules
for them don't apply.

Not adopted yet: prompt suggestions, Agent Skills, placing `speed`
options next to the model selector, and using `replay_complete` to show
replayed history before the resume response.

Release Notes:

- N/A
2026-11-14 22:52:04 +00:00
Ben Brandt 0cfc4a483d Switch async-task back to upstream (#66968)
Replace the Zed fork of `async-task` with upstream now that
https://github.com/smol-rs/async-task/pull/108 has merged.

Pin the upstream merge commit `41fd3359c75e221bd8b187a8ee361aa309c1714c`
to preserve the task waker identity fix. The latest crates.io release is
still 4.7.1 and does not include the fix, so retain the crates.io patch
until a release is available. Update the lockfile without changing other
dependencies.

Release Notes:

- N/A
2026-11-14 11:41:42 +00:00
tidely 4fd48c02ac Miscellaneous improvements to prepare for Rust 1.100 (#66901)
## Summary

Fixes rustc and clippy warnings for a potential upcoming Rust 1.100
version bump. All changes are backwards compatible and Rust is **not**
bumped in this PR.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A
- [GPUI] N/A

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
2026-11-13 11:45:35 +00:00
Ryan The Dev 27bbbc1cc4 languages: Highlight C/C++ preprocessor call arguments (#66875)
## Summary

Arguments of `preproc_call` nodes, like the `pack(push, 4)` in `#pragma
pack(push, 4)` or the `FOO` in `#undef FOO`, had no highlight capture,
so they always rendered as plain text. `#define` bodies are covered by
the injection, and `#if` conditions are parsed as expressions, but
nothing reached `preproc_call`'s `preproc_arg`.

I added a `(preproc_call argument: (preproc_arg) @preproc)` rule to both
the C and C++ highlight queries. I went with `@preproc` because every
built-in theme already defines it, and it makes the whole directive line
one color, like VS Code does. Happy to switch to `@constant.macro` or
`@string` if you'd prefer.

| Before | After |
| --- | --- |
| <img alt="preproc-before"
src="https://github.com/user-attachments/assets/95fa0660-c41f-4433-98c7-887d9871fe1d"
/> | <img alt="preproc-after"
src="https://github.com/user-attachments/assets/7c4fa978-a6c1-4707-a627-6d7e32dd897a"
/> |
| <img alt="preproc-before-light"
src="https://github.com/user-attachments/assets/3d2479ce-cd04-42ae-bfeb-e5c8c49fb9a6"
/> | <img alt="preproc-after-light"
src="https://github.com/user-attachments/assets/8d342f73-25e2-4dae-b984-72b88fd23287"
/> |


`#define FOO 1` and `#if defined(BAR)` look the same before and after.

Closes #66675

## Testing

- Added a query test for C and one for C++, checking that `#pragma` and
`#undef` arguments are captured as `preproc` and that a `#define` body
isn't. Both fail without the query change.
- `cargo test -p languages` passes (105 tests), and `./script/clippy -p
languages` is clean.
- Built the branch on macOS and compared it with Zed 1.28.1 on the same
file, in One Dark and One Light (screenshots above).

To try it: open a `.c` or `.cpp` file and type `#pragma pack(push, 4)` /
`#undef FOO`. The arguments should now take the directive's color.

I used Claude Code to help with this change and tested it myself.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Improved syntax highlighting of `#pragma` and `#undef` arguments in C
and C++.

---------

Co-authored-by: imryanthedev <352313849+imryanthedev@users.noreply.github.com>
2026-11-12 22:39:26 +00:00
Kirill Bulatov 78a8526196 Update merman to 0.9.3 (#66874)
Closes #66582
Closes #62410
Closes #62913
Closes https://github.com/zed-industries/zed/pull/65192

* Label measurement
merman 0.9 no longer ships font metrics, and sizes label boxes from a
font-agnostic estimate.
`SvgRenderer::measure_text_width` lays out a line with the renderer's
own `usvg` options, and merman's width callback uses it, so layout and
painting share font matching, fallback and shaping.
This also fixes labels overflowing their nodes with a wide UI font.

* Font data
`fontdb` reopens and maps a file-backed font on every glyph lookup,
which made each measurement with a system font cost 1 to 5ms.
The SVG renderer now reads each font file selected for text once, within
a 64MiB total budget, and serves later lookups from memory.
A 36-character measurement with Menlo went from 2.8ms to 0.06ms.

* Configuration
merman 0.9 follows Mermaid 12 defaults: the `neo` look, 120px wrapping
and a 120px minimum node width.
Zed keeps the classic look, 200px wrapping and no minimum width, as
before.
merman also stopped restricting `themeVariables` in diagram directives;
Zed restricts it again, together with `fontSize`.

* Styling
merman now defines label text once in `<defs>` and references it with
`<use>`, so descendant selectors and position lookups no longer reach
it.
Node accents, mindmap section colors and edge label backgrounds are
adapted to that structure.
Label typography comes from merman instead of a forced 16px, and label
viewports are not clipped.

* Limits
* Text measurement has a per-render work budget, so a label of
zero-width characters fails the render instead of measuring ever longer
prefixes.
* merman 0.9.3 has a hard-coded limit on CSS matching work in its label
fallback.
Flowcharts above about 310 nodes and class diagrams above about 375
members fail with `svg_fallback_selector_index exceeded`.
`main` renders 500 nodes and 400 members.

* Behavior changes
* ER relationship labels are 14px, merman's size; they were forced to
16px.
* A `gantt.fontSize` directive is ignored, because `fontSize` is
restricted at any depth.
* A per-node `font-size` style is now painted; before, only the node box
grew.
    * A single label line above roughly 90KB fails to render.

### Known regression


Release Notes:

- Fixed Mermaid state descriptions overlapping in the Markdown preview.
- Fixed Mermaid sequence diagram titles being cut off.
- Fixed Mermaid labels overflowing their nodes with wide fonts.
- [GPUI] Added `SvgRenderer::measure_text_width`, and made SVG text
rendering keep used font files in memory.
2026-11-12 14:52:36 +00:00
John Tur be07e43ea0 gpui: Reduce overdraw using the depth buffer (#66811)
GPUI paints a frame by recording primitives (quads, shadows, paths,
underlines, glyph sprites, surfaces) into a `Scene`. The renderer then
draws the scene's primitives back to front, so that later primitives
paint over earlier ones. This means every pixel of every primitive is
shaded, even where a later primitive completely covers it. In heavily
nested UI, this adds up to a lot of overdraw.

Inspired by WebRender, we reduce overdraw with a depth buffer and two
passes:
- The opaque pass draws quads that we know cover their whole area with
an opaque color. They're drawn front to back, with depth testing and
depth writes enabled. In practice, we can only make this guarantee for
quads with a solid, fully opaque fill and no rounded corners.
- The blended pass draws everything else back to front, with depth
testing enabled but depth writes disabled. This is essentially the
existing render loop with a depth test added. Any fragment 'behind' an
opaque quad fails the depth test and is never shaded.

To get more of each frame into the opaque pass, `paint_quad` now splits
any quad with rounded corners into a rectangular interior and the four
edge strips around it. The interior is a plain rectangle, so if its fill
is solid and opaque, it's drawn in the opaque pass, and only the strips
need the border and corner shading.

Measured on an Intel HD 4600:

Scene | Before | After | Change | Pixel shader invocations |
|---|---|---|---|---|
| Editor | 3,941µs | 1,689µs | −57% | 3.71M → 1.65M (−55%) |
| Command palette | 7,658µs | 2,275µs | −70% | 5.33M → 1.80M (−66%) |
| Git Graph | 3,589µs | 1,889µs | −47% | 3.13M → 1.65M (−47%) |

Fixes https://github.com/zed-industries/zed/issues/8043

Release Notes:
- Reduced GPU usage
- [GPUI] Improved rendering performance by skipping pixels hidden behind
opaque quads
2026-11-12 08:19:31 +00:00
John Tur ffe0fa29e4 gpui: Improve path rendering (#66809)
GPUI currently implements paths in two ways:

- A remnant of a Loop-Blinn shader (which doesn't quite work because the
winding accumulation is missing).
- Tessellating paths on the CPU with `lyon` and uploading the triangles
to the GPU.

Tessellated triangles have no curve coordinates, so Loop-Blinn's
analytic antialiasing doesn't help them. To antialias them, we used 4x
MSAA instead. This was particularly problematic:

- MSAA has an enormous bandwidth and memory cost relative to the quality
of the result (5 coverage levels).
- Many lower-end GPUs can't afford MSAA on the main render target. So,
paths rendered into a separate MSAA target, which was resolved into an
intermediate texture and then drawn onto the main target. These textures
cost extra memory.
- The MSAA draw and resolve happened per path batch. We didn't use a
single path atlas, because in principle its memory use is unbounded.
This dramatically magnifies the bandwidth cost of path rendering,
especially on tile-based GPUs, since every batch switches render passes
mid-frame.

We present a new path renderer that computes analytic coverage per pixel
from the winding number. Coverage is computed as in Eric Lengyel's Slug:
we cast rays leftward and upward from the pixel and count crossings with
the path's curves. Crossings within the pixel contribute partial
winding.

GPUI paths can be larger and more complex than glyphs. But since they're
built at a fixed scale in screen space, we can do some of the spatial
work on the CPU:

- `PathBuilder` turns each contour into closed chains of monotone
quadratic curves.
- The curves are binned into square cells, where each cell lists only
the curves near it. Cell size is picked per path to balance binning cost
against shading cost.
- For each cell, the CPU computes a *backdrop* value that encodes the
winding contribution of all the curves it doesn't list.
- Neighboring cells with the same curve list and backdrop merge into
rectangular tiles. A large rectangle becomes nine tiles: four corners,
four edges, and a solid interior with no listed curves.
- Each tile is one GPU instance, and the shader loops only over that
tile's curves.

Tiles are drawn in the main render pass alongside every other primitive.
There's no MSAA, no intermediate textures, no extra render passes or
resolves, and no tessellation.

---

Binning has a different cost profile from tessellation:

- The tessellator's work happened almost entirely in
`PathBuilder::build()`. Binning depends on the display scale, so it
happens in `paint_path`. Code that caches and reuses `Path`s pays
binning cost on every paint. However, this doesn't seem to be a common
pattern, so mitigations are deferred.
- In general, fills are about as fast as before or slightly faster,
while strokes are 2–8× slower. `lyon` has a dedicated stroke tessellator
that emits triangles directly along the stroke. We convert the stroke to
an outline with `tiny-skia`, then bin it like any other fill. Long,
sprawling strokes are the worst case (a 1,000-point scribble takes about
1.5ms now vs 0.2ms before).


GPU time is, generally, reduced dramatically. Measured on an Intel HD
4600:

| Scene | Before | After | Change | Pixel shader invocations |
|---|---|---|---|---|
| `painting` example | 9,257µs | 1,928µs | −79% | 1.81M → 1.50M (−17%) |
| Git Graph | 19,669µs | 3,828µs | −81% | 3.21M → 3.13M (−2%) |

---

Some breaking changes were made to the API:

- `Path` is no longer generic and can only be built with `PathBuilder`.
Use `PathBuilder`'s equivalents of `Path`'s builder methods.
- `PathBuilder` can still be populated from `lyon` path builders, but
the places where `lyon`'s tessellator leaked into the API were removed.
`StrokeOptions` and `FillOptions` are now GPUI types with fewer options,
and `PathBuilder::build_path` is gone.
- Since paths now render with analytic antialiasing, you may see
conflation artifacts where MSAA didn't have any.

Release Notes:
- Reduced GPU usage
- [GPUI] Improved path rendering performance. `Path` is no longer
generic and must be built with `PathBuilder`

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-11-12 08:19:30 +00:00
Anthony Eid 3d42ca7c09 cli: Add debug state command (#66852)
This PR adds a debug state command to the CLI and a `cx.debug_state` API
to GPUI's `App`, so users can better understand where things went wrong
in their GPUI apps when they run into a bug. `zed --debug-state` prints
the running instance's snapshot as JSON.

Release Notes:

- Added a `zed --debug-state` CLI flag that prints the running app's
window, display, and platform state as JSON for debugging
- [GPUI] Added `cx.debug_state` API to output the current GPUI state
2026-11-11 19:41:39 +00:00
Ben Brandt 5014e5b302 Update ACP SDK to 5.2.0 and adopt schema 1.17 additions (#66832)
Updates `agent-client-protocol` to 5.2.0 (schema 1.17.0) and adopts its
new additions.

- **Session references in tool call content.**
`ToolCallContent::Session` (unstable subagents) used to render as
"Unsupported tool call content." for v2 agents and was dropped for v1
agents. It now renders as an "Open Session" link that switches to the
referenced session, labelled the same way as session-message
participants. Because references are display-only, sessions Zed doesn't
know about show as "Unavailable Session" and aren't loaded.
- **Saved config defaults sent inline with `session/new`, behind the ACP
beta flag.** If the agent advertises `sessionCapabilities.options`, Zed
now sends the user's saved config defaults in the session-creation
request (`configOptions`) instead of only applying them one
`session/set_config_option` call at a time afterwards. This covers v1
and v2. `session/options` is still a draft, so this only happens with
`acp-beta` enabled. The existing one-at-a-time pass still runs after
creation: it sends nothing when the agent already applied everything,
and it still catches defaults the agent skipped (for example, one that
depends on another option's value).
- The `session/options` request itself is not used yet.
- `AuthAccount.description` is not adopted, because Zed doesn't use auth
status.

Release Notes:

- N/A
2026-11-11 17:29:24 +00:00
zed-zippy[bot] cd4902bfa2 Bump Zed to v1.30.0 (#66839)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-11-11 15:36:49 +00:00
Divyanshu Singh cffa8d94a8 which_key: Don't dismiss open modals when showing pending bindings (#66630)
## Summary

With which-key enabled, pausing in the middle of a multi-key binding
closes whatever modal is open. I hit this with vim mode in the expanded
commit editor: pressing `g` and waiting for the which-key popup closed
the editor. The same thing happens with `cmd-k` in pickers like Go to
Line, so their `cmd-k` chords can't be completed.

The cause is that the modal layer only holds one modal at a time, and
which-key opens as a modal. Before opening, it only checked whether a
which-key popup was already open, so any other modal got replaced.

I changed that check to skip the popup while any modal is open. The open
modal stays, and the chord still completes inside it. The trade-off is
that the popup isn't shown inside modals, but pending keys are still
shown in the status bar (by the pending keystrokes indicator, or by the
vim mode indicator in vim and Helix mode).

Closes #66068
Closes #66246

## Testing

- Added `test_which_key_does_not_replace_open_modal`, which opens a
modal, starts a chord, pauses, then completes it, and checks that the
modal is still open and the chord's action ran. It fails without the
fix.
- Added `test_which_key_shows_for_pending_chord` to make sure the popup
still shows when no modal is open.
- Tested manually on macOS with vim mode and which-key enabled.

Steps to reproduce:
1. Set `"vim_mode": true` and `"which_key": { "enabled": true,
"delay_ms": 1000 }`
2. Open the Git panel (`ctrl-shift-g`), click the commit message box,
and press `shift-escape`
3. Press `Escape`, then `g`, and wait a second
4. Before: the commit editor closes. After: it stays open.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed which-key closing the commit editor and pickers when a multi-key
binding was pending

---------

Co-authored-by: Divyanshu Singh <177622442+divyanshus2404@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-11-11 13:02:28 +00:00
Kyle Kelley b1962f7cd8 repl: Update Jupyter dependencies (#66220)
## Summary

Upgrades jupyter deps to latest versions. This also brings us forward to
a version without async-std so that we can go all in on smol or tokio as
needed.

## Testing

Beyond the test suites, ran notebooks and repl code for some nice
quality human QA.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A

---------

Co-authored-by: MrSubidubi <75036051+MrSubidubi@users.noreply.github.com>
2026-11-10 13:38:24 +00:00
Ben Brandt 1fea6cbaf6 Bump agent-client-protocol to 5.1.0 (#66748)
Updates the ACP Rust SDK from 5.0.0 to 5.1.0. This also updates
`agent-client-protocol-derive` to 5.1.0 and
`agent-client-protocol-schema` from 1.15.1 to 1.16.0. No code changes
were needed.

Release Notes:

- N/A
2026-11-09 16:19:59 +00:00
Kirill Bulatov 5e23b6e71d Open single files inside the same window (#66103)
Part of https://github.com/zed-industries/zed/issues/55726
Closes https://github.com/zed-industries/zed/issues/55893


https://github.com/user-attachments/assets/3926b9a1-019b-4c37-bcfc-0d5a0e30146b


Release Notes:

- Fixed single file opening ergonomics
2026-11-09 12:08:31 +00:00
guopenghui 94f3eb1b72 Bookmark picker (#60005)
# Objective

- Add a picker for bookmarks to view all bookmarks in the workspace,
with support for filtering, previewing, opening files and jumping to
corresponding positions.

## Solution

- Add a picker delegate and related actions to pop up a picker modal
displaying the bookmark list upon trigger
- Display the label of the bookmark, its file path and line number. If
the bookmark label is empty, use the text on the line where the bookmark
is located as the label.
- Support enabling preview to view surrounding code of bookmarks
simultaneously
- Open the preview tag and reuse the existing tab pane on primary
confirm; open a separate tab pane on secondary confirm
- Design distinct result display layouts for horizontal and vertical
modes to prevent excessive text truncation

## Testing

- Conducted manual testing
- Added two test cases
## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase




https://github.com/user-attachments/assets/4126fec0-0177-4f05-8cd8-738e6c358164




## Current Limitations
- The current picker does not provide initial layout information to its
delegate. If it is opened in horizontal mode initially, the result list
will render in vertical mode, causing severe text truncation. This issue
should be straightforward to resolve with minor adjustments to the
picker-related code. #60007
- The current preview highlights bookmark rows by matching the full line
of text, which results in an unappealing visual effect. It would be
preferable if the picker code could support full-row highlighting
natively in a future update.

---

Release Notes:

- Added a picker to show all bookmarks inside current workspace
2026-11-08 18:27:50 +00:00
scarf e231594b6b git: Add date format and per-view date style settings (#66533)
## Summary

resolves #15272, take 2 of #58950
tl;dr: add following options:

```json
{
  "git": {
    "date_format": "locale", // "locale" (default), "iso", or a strftime format like "%Y-%m-%d %H:%M"
    "blame":         { "date_style": "relative" },
    "inline_blame":  { "date_style": "relative" },
    "branch_picker": { "date_style": "relative" },
    "stash_picker":  { "date_style": "relative" }
  },
  "git_panel": { "date_style": "relative" },
  "git_graph": { "date_style": "absolute" }
}
```

design per
https://github.com/zed-industries/zed/pull/58950#issuecomment-6017682621,
also pinging @smitbarmase per request

## Testing

screenshots are taken on fedora linux 44 + kde plasma 6.7.5

<img width="2560" height="1440" alt="image"
src="https://github.com/user-attachments/assets/0784f1f7-0e00-4be5-893d-775d617b33e4"
/>
<img width="1125" height="937" alt="image"
src="https://github.com/user-attachments/assets/7ae6c876-3a93-4876-a151-85632d54d982"
/>
<img width="1407" height="340" alt="image"
src="https://github.com/user-attachments/assets/2178804a-444b-4613-9024-3700b15e0cfe"
/>

changed each config values `Date Format {locale/iso/strftime} x Date
Style {relative/absolute}` and they all seem to work without issues
also, invalid date format will default to `locale` (with an warning log
like below)
```
2026-11-05T00:14:08+09:00 WARN  [project::project_settings] Invalid git.date_format: invalid component name `Q` at byte index 1
```

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Added `git.date_format` and per-view `date_style` settings for git
dates

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-11-06 14:35:38 +00:00
Aliaksandr Zhyburtovich d71ff73440 tasks_ui: Fix tasks with file variables missing for single-file worktrees (#66195)
## Summary

When a single file is opened without a folder (e.g. via `ctrl-o`), it
gets a worktree whose root is the file itself. `task_contexts` only
built the editor context for items from worktrees rooted at a directory,
so variables like `ZED_FILE` were never set. Tasks referencing them,
including global tasks from `~/.config/zed/tasks.json`, failed to
resolve and were silently dropped from `task: spawn`. Tasks without
variables were still listed, which made the bug look inconsistent.

This PR:

- builds the editor context for any active item with a project path,
while keeping the worktree context limited to directory worktrees (as
introduced in #25605);
- makes `BasicContextProvider` set `ZED_WORKTREE_ROOT`, the relative
path variables and the default cwd only for visible directory worktrees,
so they don't point at the file itself or at an unrelated directory such
as the Zed config directory;
- moves the task picker's source-aware context selection into
`TaskContexts` and uses it when spawning tasks by name or tag, so
worktree tasks are resolved against their own worktree even when an
external file is active;
- gives items outside of visible directory worktrees (e.g. the global
`tasks.json` opened via `zed: open tasks`) the visible project's
`ZED_WORKTREE_ROOT` and cwd, preserving the behavior from #55727, and
keeps only their file and cursor variables, so nothing derived from
their own worktree (relative paths, git repository, language-provided
values such as Python test targets) leaks next to the project's root;
- uses the first visible directory worktree, skipping single-file ones,
as the active worktree when the active item is not in a visible
directory worktree, so the fallback above and the worktree context still
apply when a standalone file was opened before a folder was added to the
project.

As a side effect, language tasks (e.g. Python runners) now also show up
for single-file worktrees, since the active location is no longer
dropped.

Closes #66148

## Testing

- Added `test_single_file_worktree_provides_file_context`: the item
context of a single-file editor contains `ZED_FILE`, has no
`ZED_WORKTREE_ROOT` and no `cwd`.
- Added tests that spawn a worktree-local task by name, or rerun it with
`reevaluate_context: true`, while a file-backed external editor is
active (single-file and invisible directory worktrees): the task
resolves against its own worktree and doesn't get the external file's
`ZED_FILENAME`.
- Added
`test_spawn_by_name_resolves_global_task_with_global_tasks_file_editor_active`:
with a file-backed global `tasks.json` editor from an invisible worktree
active, a global task gets the visible project's root and cwd, keeps
`ZED_FILENAME` and has no `ZED_RELATIVE_FILE`.
- Added
`test_spawn_by_name_resolves_global_task_with_single_file_worktree_listed_first`:
the same check with a visible single-file worktree listed before the
visible directory worktree.
- Extended
`test_external_item_context_does_not_carry_its_worktree_environment`: an
external item's `ZED_MAIN_GIT_WORKTREE` and language-provided variables
don't reach global tasks.
- Added
`test_spawn_by_name_does_not_use_language_targets_derived_from_external_relative_path`:
with the built-in languages registered and a Python file from an
invisible worktree active, the real `PythonContextProvider` derives a
relative `ZED_CUSTOM_PYTHON_TEST_TARGET` for the editor, but a global
`pytest` task spawned by name gets the `.` default and the visible
project's cwd.
- `cargo test -p tasks_ui` and task-related tests in `project` pass.
- Manually reproduced on Linux before the fix: with global tasks using
`$ZED_FILE` and a task without variables, only the latter was listed for
a file opened via `ctrl-o`, while both were listed with a folder opened.
- Manually verified on Linux after the fix: global tasks using
`$ZED_FILE` are listed and run for a file opened via `ctrl-o`.
- `./script/clippy` passes.

To test: add a global task with `"command": "echo $ZED_FILE"`, open a
file via `ctrl-o` in an empty window, run `task: spawn`.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed tasks that use file variables such as `$ZED_FILE` not being
listed in `task: spawn` when a single file is opened without a folder.
2026-11-04 15:54:12 +00:00
zed-zippy[bot] b278e79c97 Bump Zed to v1.29.0 (#66532)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-11-04 15:35:50 +00:00
Finn Evers 8a41a5cc04 crates_io_client: Add GitHub Trusted Publishing configuration endpoints (#66473)
As a next step, this PR adds the trusted publishing endpoints to the
crates.io API client.

Also slightly improves our pagination handling for crates.

Release Notes:

- N/A
2026-11-04 09:13:14 +00:00
Finn Evers 4ebf3eac14 crates_io_client: Add endpoints for listing, getting, and updating crates (#66438)
As a next step, this adds endpoints to the API client for crates.io to
query a list of crates as well as patch a crate and get crate info. Also
follows the OpenAPI spec available from crates.io.

Release Notes:

- N/A
2026-11-03 11:35:14 +00:00
Finn Evers ccb25cbc63 crates_io_client: Add crates.io API client (#66437)
Adds a `crates_io_client` tooling crate for the crates.io REST API:

- `RealCratesIoClient` authenticates with an API token and follows the
crates.io data access policy (https://crates.io/data-access).
- Errors distinguish missing permissions (401/403), missing resources
(404), and other upstream failures.
- `SimulatedCratesIoClient` (behind `test-support`) serves in-memory
responses.

For testing this, this PR also adds the `GET /api/v1/site_metadata` as a
first endpoint.

Release Notes:

- N/A
2026-11-03 11:14:40 +00:00
Piotr Osiewicz f73feed9de http_client: Remove anyhow reexports (#66430)
## Summary

What problem does this solve, how, and why does this change matter?
Use "Closes #123" for each issue resolved.
Include artifacts produced when testing: before/after screenshots, GIFs,
videos, benchmarks.

## Testing

Manually test your changes; report results, mention platforms if
relevant.
How can reviewers test this easily? Include setup and steps.

## Self-review

- [ ] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.

Release Notes:

- [GPUI] http_client no longer re-exports anyhow types.

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-11-02 15:51:56 +00:00
Ben Brandt 4ec98df500 acp: Update agent-client-protocol to 5.0.0 (#66425)
Upgrades `agent-client-protocol` from 3.6.0 (schema 1.13.0) to 5.0.0
(schema 1.15.1), and brings Zed's v1 and v2 ACP clients in line with the
spec and schema changes made since then.

## SDK 5 port

- Schema types move from `schema::v1`/`schema::v2` to
`v1::schema`/`v2::schema`, builders to `Client.v1()`, and v2 handle
types to `agent_client_protocol::v2`.
- `agent_client_protocol::Error` is now the SDK's own type, not the v1
schema error. Zed uses it at the SDK boundary, and `ProtocolErrorInfo`
also recognizes it so auth-required detection keeps working.
- Foreground dispatch helpers are generic over the protocol marker, and
v2 request IDs come straight from the handles.
- SDK 5 only matches transport-closed errors that the SDK itself
produced, so peers can't forge them. A test that built one by hand now
covers only the local disconnect case. The `agent_servers` tests still
cover real transport loss.

## Spec changes

- `session/close` and `session/delete`: a `-32002` response counts as
success, on both v1 and v2.
- Permission and elicitation requests that name an unknown session get
`-32002` with `data.sessionId` instead of `-32603`. The v2 migration
guide makes this required for Clients too.
- v2 `usage_update.cost` is a patch field: omitted leaves it unchanged,
`null` clears it. A v1 update without a cost still leaves it unchanged.
- A `plan_update` whose type Zed can't render (`file`, `markdown`, or an
unknown type) still replaces the plan with that `planId`, so the old
entries stop showing.
- A diff `patch` with an unrecognized `format` renders from `changes`,
as if `patch` were omitted.
- v2 never sends an empty prompt.
- On v2, `session/cancel` no longer answers pending permission requests
locally. They stay open until the agent cancels them with
`$/cancel_request`, because requests for background work survive a
cancel. v1, including v1 subagents, keeps answering them with
`cancelled`.

## Follow-ups

These are left for separate PRs:
- Background-work UI: the `paused` status, the `background` list, and
cancel buttons for tool calls and terminals. Until then, `paused`
displays as in progress, which the spec allows.
- Subagent `cwd` and `additionalDirectories`.
- The new unstable methods: `auth/status`, `session/set_title`,
`session/status`, `session/archive`.

Release Notes:

- Improved compatibility with the latest Agent Client Protocol,
including handling of missing sessions, plan updates, diff formats, and
cancellation of permission requests.
2026-11-02 15:26:50 +00:00
max1ab 1d76f828ee Fix SVG images in remote Markdown previews (#66404)
## Summary

<img width="3024" height="1898" alt="zed-svg-ssh-after"
src="https://github.com/user-attachments/assets/d35454cc-9d27-4165-900a-00990f483e4e"
/>

Closes #64517

Fixes SVG images failing to display in remote Markdown previews by
adding content-based SVG support to ImageStore and using the existing
GPUI renderer.

## Testing

- Integration tests and Clippy passed.
- Manually verified with a macOS client connected to a Linux SSH
project.
- To verify: open a remote Markdown file containing `![](image.svg)` and
confirm the SVG displays in the preview.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed SVG images failing to render in Markdown previews for remote
projects.
2026-11-02 09:16:49 +00:00
Steve Shreeve 0373366f43 gpui_macos: Fix animations running at 30 fps on M5 Macs (#65472)
## Summary

**This fixes a major slowdown in GPUI apps on M5 Macs (and, per the
reports below, other base M-series Macs on macOS 26+).** Every frame
blocked the main thread for about 33 ms, which capped animation at 30
fps and delayed input handling; with this change a frame takes under 1
ms and animation runs at the display's full rate.

On an Apple M5 (base chip; macOS 27.0.1; Studio Display at a fixed 60
Hz), GPUI animations that aren't driven by input run at 30 fps on
`main`. Zed's own `crates/gpui/examples/animation.rs` never goes above
30 fps, even in a focused window. With `ZED_MEASUREMENTS=1`, each
frame's draw plus present takes about 33 ms while the scene itself takes
about 3 ms; the rest is spent blocked in `-[CAMetalLayer nextDrawable]`.
Input hides it: while the mouse moves, frames run at 60 Hz, presumably
because input raises the system's performance state.

This matches reports outside Zed: about 30 fps UI animation on base
M4/M5 chips since macOS 26 ([Apple forum
839102](https://developer.apple.com/forums/thread/839102)),
Psychtoolbox's finding that macOS 26 moved the compositor deadline close
to vsync so a frame submitted after the vsync callback slips a refresh
([thread](https://psychtoolbox.discourse.group/t/timing-performance-issues-on-macos-26-tahoe/5767/32)),
and another app on the same GPUI crates measuring about 32 ms in
`nextDrawable`
([karan-vk/Oxikube#601](https://github.com/karan-vk/Oxikube/issues/601)).
In #46728 a maintainer suggested moving to CADisplayLink or
CAMetalDisplayLink.

## What changed

On macOS 14 and later, each window is paced by a `CAMetalDisplayLink` on
its layer, and the renderer draws into the drawable the link hands out
instead of calling `nextDrawable`. Earlier systems keep the existing
`CVDisplayLink` path unchanged.

- **The OS picks the rate.** The link keeps Apple's default
`preferredFrameRateRange` (the display's maximum rate, adjusted by
system policy such as Low Power Mode and thermal state) and default
`preferredFrameLatency`. There is no hand-picked frame rate or fallback.
- **Shared Apple wrapper.** `gpui_apple::display_link::MetalFrameSource`
owns the link and its delegate. It is confined to the main thread
(`MainThreadMarker`, `MainThreadOnly` delegate), delivers updates
through a typed Rust closure, and `new` returns `None` where
`CAMetalDisplayLink` is unavailable. iOS can adopt it later; iOS still
uses its existing `CADisplayLink` here.
- **The renderer can't call `nextDrawable` while a link drives the
layer.** A `DisplayLinkMode` enum makes that state explicit; a frame
drawn outside a link update while attached is skipped and logged.
Activation and live resize draw synchronously, so they detach
(invalidate) the link first and recreate it afterwards.
- **Idle windows stop the link.** After an update in which GPUI neither
drew, presented, nor asked for another frame, the link pauses, so an
idle window acquires no drawables. GPUI's existing `frame_waker` and
`schedule_frame` hooks resume it; macOS didn't implement them before,
and they're no-ops on the `CVDisplayLink` path. GPUI still owns every
frame decision, including presenting for a second after high-rate input,
so there is no backend timer.
- **macOS window cleanup.** The frame source is an enum (Metal or
`CVDisplayLink`), the window state is `Rc<Mutex<…>>` instead of `Arc`
plus `unsafe impl Send`, and window teardown invalidates the link.

## Testing

**Frame rate (Apple M5 base, macOS 27.0.1, 60 Hz Studio Display;
measured on the original revision).** Zed's `animation` example,
`--profile release-fast`, frames per second in each second:

- `main`: 30 in every focused second (never above 30), 22 to 25 while
unfocused
- this branch: 60 in every focused second, 22 to 24 while unfocused
(GPUI's unfocused-window cap)

A scripted scroll benchmark in an app built on these crates (44
identical wheel flicks injected with `Window::dispatch_event`, including
a spring animation after each):

| | CVDisplayLink | CAMetalDisplayLink |
|---|---|---|
| Frames with no input, at 60 Hz | 0% (100% at 30 Hz) | 97% |
| Frames while input arrives, at 60 Hz | 22% | 91% |
| Median frame time (draw + present) | 33.1 ms | 0.5 to 0.7 ms |
| Time to run a 25.4 s script | 31.1 s | 26.6 s |

**Idle cost (Apple M4 Max, macOS 27.0.1, built-in 120 Hz ProMotion
display, AC power, Low Power Mode off).** GPUI `hello_world` and
`animation` examples (dev builds), `main` and this branch built from the
same base, display kept awake. Each idle run is 60 s after a 10 s
warmup; numbers are `top`'s %CPU and energy impact:

| | App CPU | App energy impact | App idle wakeups/s |
|---|---|---|---|
| `main`, idle `hello_world` (3 runs) | 0.96–1.02% | 2.37–2.84 | 30–40 |
| Link always running, idle `hello_world` (2 runs) | 1.93–2.19% |
1.93–4.47 | — |
| This branch (idle pause), idle `hello_world` (3 runs) | 0.00% | 0.00 |
~0.1 |
| `main`, `animation` (30 s) | 23.1% | 24.4 | — |
| This branch, `animation` (30 s) | 21.0% | 22.2 | — |

Without the idle pause, an idle window cost about twice `main`'s CPU
because the link acquires a drawable every refresh; with it, an idle
window does no work at all. The `animation` run checks that a paused
link resumes and keeps rendering. WindowServer showed no consistent
difference, though some runs overlapped with the machine being in use.

Also verified by hand on the M4 Max: idle, animation, and live resize
after the final revision.

Checks: `cargo clippy -p gpui_macos -p gpui_apple --tests` is clean;
`cargo test -p gpui_macos -p gpui_apple` passes, including tests for the
renderer's display-link drawable handling, the idle-pause decisions
(including a wake that arrives during an update), and drawing normally
once a link is invalidated. `gpui_apple` also type-checks for the iOS
simulator at the iOS 15 deployment target.

**Not yet measured:** whether the first frame after an idle pause (e.g.
the start of a scroll) arrives later than with an always-running
`CVDisplayLink`; whether the idle pause lets ProMotion drop its refresh
rate more (expected, not measured); Low Power Mode; macOS 14 and 15;
multiple displays and moving a window between them.

**Open questions for review:**

- **Live resize recreates the link on each resize step.** The
synchronous `displayLayer:` draw detaches the link, and starting the
source creates a new one. Resizing works, but a cheaper approach (e.g.
restarting the link once when live resize ends) could follow.
- **One frame may mismatch during a programmatic resize.** A frame is
sized from the link's drawable while the path-rendering intermediate
textures follow the layer's newer size, so the two could differ for that
frame. Not observed.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist). (No UI
changes.)
- [x] Tests cover the new or changed behavior. (Frame rate and idle cost
need a display and were measured by hand, as above.)

Release Notes:

- [GPUI] Improved animation frame rate on macOS: frames are paced by
`CAMetalDisplayLink` on macOS 14 and later, so animations reach the
display's refresh rate instead of 30 fps on some Macs, and idle windows
stop requesting frames

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-10-29 16:25:45 +00:00
Piotr Osiewicz 5882c67dc3 notification: Remove unreferenced bits (#66294)
Following removal of notification panel there should be opportunities to
remove some (all??) of notification crate

## Summary

What problem does this solve, how, and why does this change matter?
Use "Closes #123" for each issue resolved.
Include artifacts produced when testing: before/after screenshots, GIFs,
videos, benchmarks.

## Testing

Manually test your changes; report results, mention platforms if
relevant.
How can reviewers test this easily? Include setup and steps.

## Self-review

- [ ] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.

Release Notes:

- N/A
2026-10-29 14:33:41 +00:00
Ben Brandt 33156f0d81 language_model: Stream background events through async-channel (#66290)
`stream_in_background` forwards a model's events from a background task
through a bounded `futures::channel::mpsc`. When the 32-event buffer
fills, that channel parks the sender behind a `std` mutex that the
receiver also locks to wake it.

On the web the receiver polls on the browser's main thread, and the
producer runs on a Web Worker. Waiting on a contended `std` mutex on the
main thread traps with `Atomics.wait cannot be called in this context`,
which can happen whenever rendering falls behind a model stream.

`async_channel::bounded` keeps the same backpressure without that mutex.
`gpui_web`'s HTTP response body already uses it for the same reason.

Release Notes:

- N/A
2026-10-29 13:16:06 +00:00
Lukas Wirth 2c2f737ab2 gpui: Add sendable foreground execution for web HTTP clients (#66165)
## Summary

This cleans up the gpui_platform code a bit, and in combination the way
we set up the http client for the web. This does introduce a
`ForegroundExecutor` variant that it itself is Send-able, allowing to
dispatch foreground futures from background workers (by requiring the
future to be Send, unlike `ForegroundExecutor`), which is a requirement
for web fetch.

a31c7b54c60738b82524e4e4c12aec2f6caf101d fixes a bunch of warnings with
our binary names

Release Notes:

- [gpui] N/A
2026-10-29 09:12:10 +00:00
Tim Vermeulen f0210f1621 gpui: Use UAX #14 line breaking for text wrapping (#64624)
Replaces the `is_word_char` list with Unicode line breaking ([UAX #<!--
-->14](https://www.unicode.org/reports/tr14/)) using the `icu_segmenter`
crate.

`is_word_char` can't express line breaks that depend on both neighboring
characters, so currently wrapped lines sometimes start with `/` or `?`,
and some emojis like 👍🏽, 🇯🇵, and 👩‍💻 get incorrectly split across lines:


https://github.com/user-attachments/assets/2a8a9eee-11c9-4143-b56c-3a2b4621af9a

This generalizes the tweaks from #11296, #17590, #35724, #37019, #37024,
#45160, #51659, #51973, #54546, #59775, and #62743, and supersedes
#62345 and #63983.

Important to note:
- This allows hyphenated words to break after the hyphen which is a
behavior change. I believe UAX #<!-- -->14 does permit tweaking this in
case we want to keep the current behavior, by filtering those out of the
`break_indices` return value.
- Obviously this isn't quite as performant as `is_word_char`, but it
seems to still be plenty fast enough, as I wasn't able to come up with a
contrived case where this causes noticeable performance issues.

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Improved text wrapping to follow Unicode line breaking rules.
- [GPUI] Improved text wrapping to follow Unicode line breaking rules.

---------

Co-authored-by: Noritada Kobayashi <noritada.kobayashi@gmail.com>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
2026-10-29 09:07:14 +00:00
Cole Miller 7f9a39a9c0 Bump livekit-rust-sdks to upgrade zip to 9.1 (#66272)
Bumps the `livekit`, `libwebrtc` and `webrtc-sys` git rev from `0a1c519`
to `fbda05e` (zed-industries/livekit-rust-sdks#15). The only change in
that rev is `webrtc-sys-build` moving from `zip` 0.6 to 9.1, using only
the pure-Rust deflate decoder. This clears these zip advisories:

- GHSA-m665-v7pm-7grj: inspection and extraction can see different
filenames.
- GHSA-vv5m-jxxh-4627: extraction keeps SUID/SGID bits.
- GHSA-4684-h2q9-2vcp: extraction can change permissions through a
symlink.

`zip` is used only at build time, to extract the prebuilt WebRTC
archive.

`Cargo.lock` changes:

- zip 0.6.6 → 9.1.3.
- Adds `nix`, `typed-path` and `zlib-rs`.
- Removes `bzip2`, `zstd` 0.11, `pbkdf2` and related crates that only
zip 0.6's default features used.

## Verification

- `corgi check -p livekit_client` passed. Corgi supplies WebRTC through
`LK_CUSTOM_WEBRTC`, so this check didn't use the download path.
- The download and extraction path was tested in
zed-industries/livekit-rust-sdks#15 against the real WebRTC archives for
macOS arm64 and Linux x64.

Release Notes:

- N/A
2026-10-29 03:35:38 +00:00
Finn Evers 02d47bf64f http_client: Unify asset downloading logic (#66048)
Supersedes https://github.com/zed-industries/zed/pull/62653

## Summary

This PR unifies the download handling we have in the http_client crate,
because we were alternating between the ways we were downloading a lot,
in one case we changed the way of downloading entirely if a hex digest
was present or not.

With this in, we now handle this one way for all kinds of downloads,
removing a lot of duplicated code and unifying the behavior here across
download types.

## Testing

Tested this manually.

## Self-review

- [X] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.

Release Notes:

- Improved reliability of language server and agent downloads by
verifying checksums consistently, rejecting failed HTTP responses, and
improving cleanup of partial downloads.
2026-10-28 21:52:54 +00:00
Anton Wiehe e5bdd01cd8 agent: Truncate long lines in read_file tool (#65395)
# Objective

Fixes #64376
Relates to #59401, #34099

Prevent the agent `read_file` tool from overflowing the model's context
window when encountering very long lines (such as minified
JavaScript/CSS, source maps, SVGs, single-line JSON files, or embedded
data URIs).

This follows up on the review discussion in #64378 with @smitbarmase to
implement generic line length capping rather than special-casing base64
strings.

## Solution

1. **Generic line truncation (`MAX_LINE_LEN = 2000`)**:
In `crates/agent/src/tools/read_file_tool.rs`, lines streamed in
`write_lines_numbered` are capped to 2000 characters
(`char_indices().nth(remaining)`), appending `... (line truncated to
2000 chars)`.
- Streaming chunks are tracked across boundaries so multi-chunk long
lines are capped without materializing oversized strings.
- Counts Unicode characters rather than bytes so multi-byte UTF-8 (e.g.
CJK) text is not cut early.
   - Preserves line numbers and trailing newlines intact.
2. **Updated tool description**:
- `read_file`: Informs the model that lines longer than 2000 characters
are truncated with `... (line truncated to 2000 chars)` and suggests
using `grep` or `terminal` to inspect the full content of very long
lines.
3. **Tests**:
- Added `test_write_lines_numbered_truncation` (unit test covering
single-chunk, multi-chunk, and multi-byte UTF-8 character capping).
   - Added `test_read_file_truncates_long_lines` (GPUI tool test).

## Testing

- Ran `cargo fmt -p agent --check` (clean).
- Ran `cargo test -p agent truncat` (all passed).

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments (none used)
- [x] The content adheres to Zed's UI standards
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Improved `read_file` tool output by truncating lines longer than 2000
characters to prevent context window overflow.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-10-28 18:01:40 +00:00
zed-zippy[bot] 66b6bbb6c8 Bump Zed to v1.28.0 (#66253)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-10-28 14:31:37 +00:00
Ben Brandt 5e8998a2a7 Update agent-client-protocol to 3.6.0 (schema 1.13) (#66245)
Updates `agent-client-protocol` to 3.6.0 (schema 1.13) and adopts the
protocol clarifications made since schema 1.12. Each commit stands
alone:

1. **Update agent-client-protocol to 3.6.0 (schema 1.13)**
- Adapts to the new types: tagged `AvailableCommand`,
`CancelledPermissionOutcome`, `ClientAuthCapabilities`, 1-based
`NonZeroU32` tool call lines, signed terminal exit codes, unsigned
`ResourceLink.size`, and v2 `RequestId` (no `null`).
- Terminal exit codes keep the platform's signed value instead of `c as
u32`; v1 Agents still receive the same 32-bit pattern as before.
- Session message participants follow the new patch rules: omitted
keeps, `null` clears, a value replaces.
   - An unknown tool status shows as in progress.
   - Unknown command kinds are offered as plain commands.
   - v1 `terminal/*` calls for an unknown terminal return `-32002`.
- A `terminal_update` with an invalid `output` snapshot still applies
its other fields (agentclientprotocol/agent-client-protocol#2577).
2. **Reject elicitation forms Zed can't render**: `-32602` for a
required property of an unknown type, a dangling `required` name, or
`enum` with `oneOf`. Optional unknown properties are left out, and
defaults that don't match their schema are ignored.
3. **Show streamed tool text as continuous text**: adjacent plain text
in `tool_call_content_chunk` extends the previous text block, like
message chunks.
4. **Apply tool call permission subjects to the transcript**: a
`tool_call` subject is applied like a `tool_call_update` before the
prompt is shown, so the permission card attaches to its tool call.

Related SDK and spec PRs: agentclientprotocol/rust-sdk#450,
agentclientprotocol/rust-sdk#451,
agentclientprotocol/agent-client-protocol#2578.

Release Notes:

- N/A
2026-10-28 12:48:20 +00:00
Ben Kunkle 24a2823456 gpui_wgpu: Fix WebGL surface reconfiguration panics (#66190)
## Summary

Advance wgpu from `3b3506e` to `cddb2f5` to adopt gfx-rs/wgpu#10348
(reported in gfx-rs/wgpu#10341). Keep the shader-validation Naga
dependency at the same revision. The lockfile changes only the sources
of the 13 wgpu-family packages; package versions and other dependency
selections are unchanged.

WebGL fence waits use a zero timeout because browsers do not support an
indefinite client wait. A fence can therefore legitimately time out
while GPU work is pending. The old surface reconfiguration path treats
that timeout as unreachable and traps; the upstream fix handles it
without weakening the native teardown behavior. This revision also
retains the Vulkan teardown fix that required the existing Git
dependency.

## Verification

- `cargo test --locked -p gpui_wgpu --lib valid_wgsl`: all three shader
validation tests pass.
- `cargo tree --locked -p gpui_wgpu --target all --depth 1`: runtime
wgpu and shader-validation Naga resolve to the same revision.
- Minimal real Chromium/SwiftShader Wasm reproduction: the original
dependency traps at `wgpu-core/src/instance.rs:884` during repeated
present/reconfigure operations; the fixed dependency completes all 20
iterations.
- Downstream optimized Wasm build and Chromium WebGPU/WebGL
start-and-resize smoke tests passed using this exact Zed branch commit.
- Negative control: forcing the old wgpu dependency in the same app
makes the retained WebGL smoke test fail; the browser trace starts with
the exact `instance.rs:884:25` / `wait_indefinitely() should never
timeout` panic. Restoring the fixed dependency makes both backend cases
pass again.

## Review status

Draft only; do not land automatically. The repository-required README
review marker is intentionally left for human removal. This branch
starts at the downstream consumer's existing Zed pin, so its eventual
dependency update need not include unrelated intervening changes.

Release Notes:

- [GPUI] Fixed WebGL surface reconfiguration panics when resizing while
GPU work is pending.

---------

Co-authored-by: Tom Houlé <tom@tomhoule.com>
2026-10-27 14:07:55 +00:00
Lukas Wirth dde76a1dca gpui: Some gpui cleanups (#66156)
## Summary

Some general reshuffling cleanups, more notable are the SubscriberSet
changes:

- Add a concrete `SingleSubscriberSet` for single-emitter observers,
removing the unnecessary outer map and emitter-key arguments.
- Keep `SubscriberSet` for observers grouped by entity or type.
- Replace separate activation and cancellation flags with one shared
`Pending | Active | Dropped` state, saving one `Rc` allocation per
subscription.
- Make `insert` immediately active and add `insert_pending` for deferred
activation, simplifying callers while preserving existing activation
timing.
- Preserve registration order and cancellation behavior when callbacks
add or drop subscriptions during dispatch. Merge retained subscriptions
with `BTreeMap::appen`d, avoiding rebuilding the tree when the
destination is empty.

Best reviewed commit by commit.

The first commit
[1740a07](https://github.com/zed-industries/zed/pull/66156/commits/1740a0718faddf57feb8cb0946a286585548ad3f)
re-orders the import / mod prelude a bit and gets rid of the lint allows
by fixing their offenses.

Release Notes:

- [GPUI] N/A
2026-10-27 10:26:02 +00:00
Max Brunsfeld e30095febc Update Tree-sitter and extension grammar memory imports (#66185)
This PR changes two things:

* Bumps the Tree-sitter dependency to include the grammar-loader commit
from [Tree-sitter PR
#6046](https://github.com/tree-sitter/tree-sitter/pull/6046).
- Update the extension builder to compile Zed extension grammars with an
explicit maximum size on their memory import. This makes it possible to
change the modules to work with a *shared* memory setting (needed for
multi-threaded parsing) on the Web, more efficiently. Shared memory
imports need an explicit max size, so this way we can change the import
to shared without having to move any bytes to make room for the max size
declaration.

Release Notes:

- N/A
2026-10-27 00:53:14 +00:00
Nick Dell'Osa 2c335b81dc Use tree-sitter-go fork (#64562)
# Objective

- Fixes https://github.com/zed-industries/zed/issues/62562
- [tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go) is not
being actively maintained. There have been 2 new versions of Go released
since the most recent commit to main, the most recent (Go 1.27) of which
introduced type parameters for methods, which majorly screws up syntax
highlighting in Zed at the present moment.

## Solution

- **zed-industries** should fork their own version of tree-sitter-go
like they have for
[tree-sitter-go-work](https://github.com/zed-industries/tree-sitter-go-work)
while we all wait for [this
change](https://github.com/tree-sitter/tree-sitter-go/pull/198) to get
merged into the upstream.
- Replace @yodalee's fork with the **zed-industries** fork, I'll update
this PR (or someone else can open one, I just want my syntax
highlighting 😅).

## Testing

- Built and ran this locally and can confirm it fixes the generic method
syntax highlighting issues.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

## Showcase

#### Before
<img width="664" height="428" alt="Screenshot 2026-09-21 at 1 27 59 PM"
src="https://github.com/user-attachments/assets/16e38c94-769b-4991-9b69-87524c8467fb"
/>

#### After
<img width="634" height="440" alt="Screenshot 2026-09-21 at 1 28 59 PM"
src="https://github.com/user-attachments/assets/642a870e-4098-4552-b9d6-1fd3ee97d0e4"
/>

This is a throwaway example so you might think "What's the big deal?"
but I promise you our production code looks way worse without the fix.

---

Release Notes:

- go: add support for syntax highlighting for Go 1.27 generic methods.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-10-26 15:39:02 +00:00
Xin Zhao bd9aa0ac05 title_bar: Fix missing Git information for repository subfolders on Windows remotes (#66142)
## Summary

Fixed a bug where the title bar failed to show the Git repository,
worktree, and branch names when the opened folder was a subfolder of a
Git repository in a Windows remote project accessed from a Unix client.

The example below shows `vaspin` as the Git repository and
`vaspin/src/vaspin` as the opened folder:

|Local and Unix Remote|Windows remote before|Windows remote after|
|:--:| :--: | :--: |
|<img width="284" height="120" alt="image"
src="https://github.com/user-attachments/assets/0c499807-1399-434b-8154-a7fdcaa1087d"
/>|<img width="298" height="146" alt="image"
src="https://github.com/user-attachments/assets/0b9f716b-0ce2-4cf5-bfc0-e9d5e20f29ea"
/>|<img width="352" height="161" alt="image"
src="https://github.com/user-attachments/assets/7c7eb179-fec7-4dfd-bf6d-c288ac285e00"
/>|


## Testing

Tested locally; the comparison is shown above.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.

Release Notes:

- Fixed missing Git repository, worktree, and branch names in the title
bar for Windows remote projects opened in a repository subfolder.
2026-10-26 13:51:27 +00:00
Kirill Bulatov 087340e2d7 Fix panic on cmd-q (#66158)
Closes https://github.com/zed-industries/zed/issues/57664

Updates `crash-context` transitive dependency (ergo the `patch` section)
to include https://github.com/rust-minidump/minidump-writer/pull/249
fix: given the latest release was a few months ago, decided to use the
git SHA pointer.

Release Notes:

- Fixed "Zed quit unexpectedly" when quitting via ⌘ + Q
2026-10-26 11:26:43 +00:00
Kirill Bulatov f14592c4a5 Require macOS 12 and SDK 26 (#65994)
Closes https://github.com/zed-industries/zed/issues/9307

Use SDK 26 and require newer macOS.
The latter allows to remove a few deprecated API usages.

Release Notes:

- [GPUI] BREAKING: bumped minimum macOS version to 12 (Monterey)
2026-10-26 11:20:07 +00:00
Kirill Bulatov 1808df02c0 Remove block dependency from the tree (#65942)
Closes https://github.com/zed-industries/zed/issues/22408

See also
https://github.com/zed-industries/scap/commit/b5c86ec58dd4b6b7732bf6ac8be03d6b1f190a82
that makes all macOS dependencies optional: we do not use these in Zed
anyway, and have `default-features = false` that allow to remove all
transitive `block` dependencies from the tree.

Adjust the test to ensure no such dependencies can appear later.

Release Notes:

- [GPUI] Removed `block` dependecy from the tree
2026-10-26 11:20:06 +00:00
Bennet Bo Fenner 91d3b962ae gpui_linux: Use the patched oo7 0.6 branch (#66035)
Use the Zed-maintained `oo7` 0.6 fork pinned to commit
`731c1215edb6905876c6137ab300428c7b8d7c13` for GPUI's Linux credential
backend. The commit is based on upstream `0.6.0` and returns
`Error::IO(UnexpectedEof)` when the Secret Service `Completed` signal
stream ends before yielding a message, instead of panicking.

## Validation

- `cargo check --locked -p gpui_linux` — passed.
- On the `oo7` `0.6` branch: `cargo check -p oo7 --lib` passed; `cargo
test -p oo7 --lib` passed (27 tests).

## Suggested .rules additions

- Treat `None` from D-Bus signal streams as stream termination and
handle it as an error rather than unwrapping.

Release Notes:

- [GPUI] Fixed a Linux keyring panic when the Secret Service prompt
stream ends unexpectedly.
2026-10-23 12:24:10 +00:00