Commit Graph
40001 Commits
Author SHA1 Message Date
Jack Walters d9abcde22a Add a setting for Threads Sidebar auto-open (#64259)
Closes https://github.com/zed-industries/zed/discussions/64266

Opening a folder in an existing window force-opens the Threads Sidebar,
and there is no way to prevent it. `open_paths` called
`MultiWorkspace::open_sidebar` unconditionally on the reused window, so
the sidebar reopened on every such open regardless of whether the user
had closed it.

This adds `agent.threads_sidebar_auto_open`, defaulting to `true` so
current behavior is unchanged. With `false`, the folder still opens in
the existing window, but the sidebar stays closed.

This path is reached when `default_open_behavior` or
`cli_default_open_behavior` is set to `existing_window`.

`open_sidebar` was doing double duty: besides showing the sidebar, it
pinned the workspace being navigated away from so it survives the
switch. When the setting is disabled, `retain_active_workspace` is
called instead, so only sidebar visibility changes.


https://github.com/user-attachments/assets/fc299df0-27e2-4ac6-98cb-d817d5f71d0e

## Tests

Two tests in `multi_workspace_tests.rs` cover both branches: the sidebar
opens by default, and stays closed when the setting is disabled while
the folder still opens in the same window.

Release Notes:

- Added `agent.threads_sidebar_auto_open` to control whether opening a
folder in an existing window also opens the Threads Sidebar
2026-09-16 16:03:50 +00:00
Kirill Bulatovandzed-zippy[bot] 2433f1d15d Enable compaction for subagents (#64135)
Release Notes:

- Enabled compaction for subagents

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-09-16 16:03:30 +00:00
Kirill Bulatov b84803f56f Fix insertion modes for completions without edit ranges (#64139)
Closes https://github.com/zed-industries/zed/issues/64118


https://github.com/user-attachments/assets/f2152411-6011-4d87-8c8e-d83bed0afbbc

`ty` returns completion text without a `textEdit` or a completion-list
default edit range:

```json
{"label":"value2=","insertText":"value2="}
```

The [LSP
specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem)
explicitly states:

> The `insertText` is subject to interpretation by the client side.

For the reported example, `ˇ` marks the cursor:

```py
test(value1, ˇvalue2)
```

Previously, Zed inferred only a range covering the existing `value2`.
Without an insert range, completion acceptance bypassed
`completions.lsp_insert_mode` and replaced that argument with `value2=`,
producing:

```py
test(value1, value2=)
```

The patch also infers an insert range, ending at the cursor rather than
the end of the word.
This lets the existing setting choose between inserting before `value2`
and replacing it.
When a prefix has already been typed, insertion replaces that prefix
while preserving the text after the cursor.

With the unchanged default, `"replace_suffix"`, Zed replaces text after
the cursor only when it is a suffix of the completion’s label.
Here, `value2` is not a suffix of `value2=`, so Zed inserts and
produces:

```py
test(value1, value2=value2)
```

The suffix and subsequence checks now use the raw LSP `label`, not
decorated menu text or `filterText`.
These checks select the edit range; `insertText` still supplies the
inserted text in this example.

Release Notes:

- Fixed insertion modes for completions without edit ranges
2026-09-16 16:03:26 +00:00
Kirill Bulatov e0590874fd Share generics better and strip rodio audio features (#64260)
* Preserve bundle compiler flags commit commit is a follow-up to
https://github.com/zed-industries/zed/pull/63432

Linux bundling script had custom `RUSTFLAGS` set which eradicated prior
config.
Moved all flags into `.cargo/bundle-config.toml` instead.

* Trim audio features and compress resources commit removes unused
`rodio` features and enables resource compression

The win from the latter seems not that large, so can revert if needed,
but seemed very easy to enable.

With compiler wrappers disabled, `cargo clean --target-dir
target/binary-size-split-build` and `cargo build --locked -p zed`:
Before: 135.6s wall, 1569.8s CPU, zed binary 1175563800 bytes
After: 130.5s wall (-3.8%), 1488.7s CPU (-5.2%), zed binary 1171527064
bytes (-0.3%, -4.0MB)

With `ZED_BUNDLE=true CXXFLAGS=-stdlib=libc++` and `cargo --config
.cargo/bundle-config.toml build --locked --release -p zed -p cli
--target aarch64-apple-darwin`:
Before: 369.4s wall, 3861.6s CPU, zed binary 381662328 bytes
After: 369.4s wall (+0.01%), 3866.1s CPU (+0.1%), zed binary 377836968
bytes (-1.0%, -3.8MB)

Release Notes:

- N/A
2026-09-16 16:03:18 +00:00
Kirill Bulatov 8b9a2df705 Share application adapter implementations (reduce LLVM IR bloat again) (#64262)
Move settings-update routing, fallible deserialization recovery,
selection effects, context-menu initialization, picker resize handles,
and ACP client setup into shared implementations. Inline the small
button callback adapters.

`cargo llvm-lines --locked -p settings_ui`:
Before (bec63dee23): 1571017 lines, 53634 copies
After: 1177376 lines (-25.1%), 43380 copies (-19.1%)

With compiler wrappers disabled, `cargo clean --target-dir
target/binary-size-split-build` and `cargo build --locked -p zed`:
Before: 135.6s wall, 1569.8s CPU, zed binary 1175563800 bytes 
After: 140.9s wall (+3.9%), 1588.8s CPU (+1.2%), zed binary 1157304600
bytes (-1.6%, -18.3MB)

Release Notes:

- N/A
2026-09-16 16:03:09 +00:00
Kirill Bulatov 5e04c64b52 Optimize GPUI inspector's runtime cost by an order of magnitude (#64309)
Prerequisite to https://github.com/zed-industries/zed/pull/64257

* gpui: build inspector IDs only when the window's inspector exists,
drop the inspector maps on close, skip inspector state lookups for
absent or non-selected IDs
* gpui: create inspector element renderers per inspector instance
instead of at registration
* inspector_ui: create the project and editors lazily per inspector
session, keep the init task and subscriptions cancellable, hold the
inspector weakly from the completion provider
* lsp: bound the shutdown output drain by the same timeout as the
shutdown request
* gpui_platform: add an `inspector_render` benchmark that builds with
the inspector in or out

Mean time per rendered frame with the inspector closed; overhead is
relative to the inspector compiled out.

| Benchmark | Frame, compiled out | Frame, `main` | Frame, this PR |
Overhead on `main` | Overhead on this PR |
| --- | ---: | ---: | ---: | ---: | ---: |
| 1,000 bare divs, never opened | 3.352 ms | 3.505 ms | 3.362 ms | +153
µs (+4.57%) | +10 µs (+0.29%) |
| 1,000 bare divs, opened and closed twice | 3.349 ms | 3.508 ms | 3.364
ms | +159 µs (+4.76%) | +15 µs (+0.46%) |
| 100 bare divs, opened and closed twice | 317.0 µs | 336.3 µs | 317.6
µs | +19 µs (+6.10%) | +1 µs (+0.18%) |
| 10,000 bare divs, never opened | 56.617 ms | 58.925 ms | 56.472 ms |
+2.31 ms (+4.08%) | -145 µs (-0.26%) |
| 500 panel rows with text, hover, click, never opened | 4.173 ms |
4.451 ms | 4.179 ms | +278 µs (+6.67%) | +7 µs (+0.16%) |
| 500 panel rows with text, hover, click, opened and closed twice |
4.197 ms | 4.448 ms | 4.159 ms | +252 µs (+6.00%) | -37 µs (-0.89%) |
| 50 panel rows with text, hover, click, never opened | 523.4 µs | 543.3
µs | 522.3 µs | +20 µs (+3.80%) | -1 µs (-0.21%) |
| 500 panel rows with text, hover, click, opened and closed twice,
another window inspected | 4.191 ms | 4.469 ms | 4.176 ms | +278 µs
(+6.64%) | -15 µs (-0.35%) |
| editor, cursor moves (`crates/benchmarks`, `release-fast`) | 940.9 µs
| 943.0 µs | 942.5 µs | +2 µs (+0.23%) | +2 µs (+0.17%) |




Release Notes:

- N/A
- [GPUI] Optimize GPUI inspector's runtime cost by an order of magnitude
2026-09-16 16:02:58 +00:00
Anthony Eid 04d586b80e gpui: Make ForegroundJournal aware of sleep and window visibility (#64269)
## Summary

Keep foreground-work measurements and per-window presentation
expectations valid across observed sleep/wake and visibility changes.
Simplified after review to about 530 changed lines including tests and
configuration.

## Scope

- Keep all measurement state in the foreground-local journal writer. Use
`PowerState` and `PowerTransition`; no new locks, counters, or changes
to the ring protocol.
- Work that started at or before the last power transition (or while
suspended) is dropped when it completes: task polls before small-poll
folding, and actions, inputs, draws, and presents through the same
`power_interrupted_since(start)` check. No per-activity state is added;
every measurement already carries its start time.
- Track visibility and pending frames together per window. Hiding or
sleeping clears the presentation expectation; on recovery
`Window::refresh_visibility` re-records it from the window's actual
dirty state, so the journal never guesses. Old latency associations
remain invalid.
- Repeated notifications for the same power state are ignored, so a
duplicate wake does not invalidate in-flight work.
- The journal subscribes to GPUI's existing power notifications and
rechecks native window visibility after wake. App only registers these
subscriptions (two initialization lines).
- Keep the existing one-second pending-frame deadline and
foreground-turn sealing behavior. No watchdog, recurring timer, test-app
exceptions, unfinished-hang detection, start/end ring notices, or
reader-side deduplication.
- Remove lifecycle counters. Keep measurement version 2 on reports and a
valid dirty-to-present sample count for weighting averages.

## Telemetry

- `Hang Incidents` gains `report_window_seconds` and stall percentiles
over every incident in the window (`stall_p50_ms`, `stall_p95_ms`,
`stall_max_ms`, from an `hdrhistogram`), so stall distributions no
longer depend on the censored `incidents[]` list. Reports are now sent
even when no incident occurred, so summing `report_window_seconds` gives
observed running time for incident rates.
- `Frame Duration Report` gains dirty-to-present percentiles
(`dirty_to_present_p50_ms`, `dirty_to_present_p95_ms`,
`dirty_to_present_max_ms`) alongside the existing average, and
`average_present_interval_ms` (mean frame-to-frame interval while
animating, a proxy for the display's refresh interval when normalizing
dirty-to-present).

Detection remains completion-based. This does not solve hangs that never
return or force an interval to seal when no further foreground events
arrive. Existing legacy hang logs/trace triggers are unchanged. Late or
coalesced platform notifications remain a coverage limitation.

## Validation

- `corgi test -p gpui --features profiler --lib`: **392 tests passed**.
- Focused lifecycle/wake tests also passed a 20-seed run.
- The extension-suggestion regression that failed on all three CI
platforms now passes locally after removal of the
watchdog/test-construction changes.
- `corgi check -p gpui` and `corgi check -p zed -p input_latency_ui`
passed.
- Formatting and `git diff --check` passed.
- Corgi configuration includes only the three existing GPUI image/font
fixtures needed to run its tests.

Native platform sleep/wake testing and review remain outstanding. The
README review marker remains for the human author to remove manually
after review.

Release Notes:

- Improved the accuracy of hang and frame-latency telemetry around
sleep, wake, and hidden windows.
- [GPUI] Added a `PowerTransition` interval boundary and
`measurement_version` to profiler hang reports.
2026-09-16 16:00:19 +00:00
MathisandMrSubidubi 2b4169b5db snippet_provider: Fix multiple snippets for same language (#58659)
This PR fixes the snippets issue when a user loads multiple snippets for
the same language.
It also adds tests for the snippets register function.

**Note**
I've made the choice to differentiate snippets based on their body.
Thus, two extensions can provide the same snippet with the same prefix
but with different bodies.
WDYT ?

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 #51014
Closes #52182 

Release Notes:

- Fixed different snippet extensions for the same language cancel each
other

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-09-16 15:58:12 +00:00
zed-zippy[bot] 4bbbf59d96 Bump Zed to v1.22.0 (#64312)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-09-16 15:34:18 +00:00
Finn Evers bcdd06ccc4 Move some configuration files out of the repository root (#64303)
This PR cleans up the repository root a bit, moving some of the less
relevant config files into the `.config` folder and removing unused
ones.

Release Notes:

- N/A
2026-09-16 14:08:49 +00:00
Smit Barmase 658460cc2b gpui_macos: Fix hover feedback when another application is focused (#64301)
Follow-up #64234

If Zed is inactive, hovering over it produces no hover effects. While
this matches other apps like Slack, I think it’s better to preserve
existing behavior. This change keeps the bug fix of the original PR.

This PR uses `ActiveAlways` for normal windows, matching popup windows.

Release Notes:

- N/A
- [GPUI] N/A
2026-09-16 13:41:43 +00:00
Finn Evers 7a99617ffc Remove REVIEWERS.conl (#64300)
In the same spirit of https://github.com/zed-industries/zed/pull/64299,
removing the file here - it contains former employees and ended up never
being used.

Release Notes:

- N/A
2026-09-16 13:22:01 +00:00
Finn Evers 2e5cf1fdbd Remove unused CODEOWNERS.hold file (#64299)
Super stale at this point, so let's remove it for now until we revisit a
codeowners file here


Release Notes:

- N/A
2026-09-16 13:18:20 +00:00
Antonio Scandurra 2e31de1c44 gpui: Avoid main-thread waits when unlocking web task queues (#64298)
## Problem

GPUI's web dispatcher already uses `spin_send` and `spin_try_pop` on the
browser main thread. Those operations spin on `try_lock()` instead of
blocking while acquiring the queue mutex. However, that does **not**
make releasing a `parking_lot` mutex safe on that thread.

When a worker is waiting for the queue mutex, dropping the main thread's
guard follows this path:

```text
RawMutex::unlock_slow
  → parking_lot_core::unpark_one
    → lock_bucket
      → WordLock::lock_slow
        → ThreadParker::park
          → memory.atomic.wait32
```

`unpark_one` first locks the internal table used to locate sleeping
threads. If another thread holds that bucket lock, the caller can itself
park before reaching the actual wake instruction. See
[`unpark_one`](https://github.com/Amanieu/parking_lot/blob/d7828fff7b5d6327ae608e82db45f888b344449a/core/src/parking_lot.rs#L732-L737),
[`lock_bucket`](https://github.com/Amanieu/parking_lot/blob/d7828fff7b5d6327ae608e82db45f888b344449a/core/src/parking_lot.rs#L358-L366),
and [`WordLock`'s park
call](https://github.com/Amanieu/parking_lot/blob/d7828fff7b5d6327ae608e82db45f888b344449a/core/src/word_lock.rs#L163-L168).

Browsers forbid synchronous atomic waits on the main thread. Chromium
reports `Atomics.wait cannot be called in this context`; Safari can
misleadingly report an out-of-bounds memory access. Ordinary UI activity
can encounter this contention while scheduling background work; no
explicit blocking operation by the application is required.

## Why `std` fixes it

For **atomics-enabled Wasm**, Rust's standard-library mutex uses a futex
directly. Unlocking changes the mutex state with an atomic swap and, if
needed, calls `memory.atomic.notify`. Its condition-variable
notification similarly increments an atomic notification counter and
calls `memory.atomic.notify`. Neither operation acquires a secondary
waiter-table lock or performs an atomic wait.

A contended `std::Mutex::lock()` would still be unsafe on the browser
main thread, so this change **retains the existing `try_lock()` spin
loops**. Workers retain ordinary blocking acquisition and
condition-variable waiting. This relies on the Wasm backend's
implementation, not a portable guarantee that standard mutex operations
never block on every platform.

The production change only replaces the queue synchronization primitives
and adapts their APIs. The high/medium/low queues, weighted selection,
queue methods, and disconnect behavior are unchanged. Poisoned guards
are recovered to preserve the previous non-poisoning behavior. The
main-thread-only mailbox receiver also uses a standard mutex with
`try_lock()` so an unexpected acquisition cannot park it.

## Regression test and verification

One browser/Wasm stress test exchanges work and replies between the
actual browser main thread and configurable `N` Web Workers. It checks
exact-once delivery, cycles between idle and busy queues, and waits for
all workers to stop. An explicit Wasm wait is a negative control
confirming that the main thread rejects waits; a deadline outside the
page detects hangs.

- **Fix stashed:** rebuilt and ran the test against the original queue.
It failed with `Atomics.wait cannot be called in this context`, with
`WordLock::lock_slow → RawMutex::unlock_slow → spin_send` in the stack.
- **Fix restored:** rebuilt and ran the unchanged test with **8 and 16
workers**. Both passed, each exchanging **524,288 items over 128
rounds**.
- Both existing native queue tests passed. Shared-memory Wasm
compilation, Rust formatting, JavaScript syntax, and diff checks passed.
- Browser execution was verified in Chromium, not directly on an iOS
Safari device. This does not update any downstream application's pinned
GPUI dependency.

The test is available through the existing `hello_web` gallery:

```sh
node crates/gpui_web/examples/hello_web/test_queue.mjs http://127.0.0.1:8080 8
```

For the recorded runs, the fixture was built directly with the gallery's
shared-memory flags, `nightly-2026-07-01`, and matching wasm-bindgen
0.2.120, then served with COOP/COEP headers.

## Suggested .rules additions

For code running on the browser main thread, audit mutex unlock and
notification paths as well as acquisition: using `try_lock()` does not
guarantee that releasing the guard cannot park.

Release Notes:

- [GPUI] N/A
2026-09-16 13:17:03 +00:00
1469507d1b deepseek: Update DeepSeek Flash to V4.1 (#64014)
# Objective

deepseek API: https://api-docs.deepseek.com/updates/

## Solution

deepseek rename deepseek v4 flash to deepseek flash



https://github.com/user-attachments/assets/72c473c9-a4bf-49e0-a7d6-0217a6dcc65b


---

Release Notes:

- agent: Added support for DeepSeek Flash 4.1

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2026-09-16 09:49:13 +00:00
marius851000andBennet Bo Fenner 78de9335df ollama: Make tool call image output accessible to the model (#64121)
# Objective

- Tool call can output image. Ollama did not support that, and dropped
them when generating the Ollama request. The images are now properly
added.
- Fixes #64054 

## Solution

- Convert the data from Zed’s internal structure to Ollama’s structure
- Should avoid allocation if there is no images (the most common path)
(untested).

## Testing

- Tested with qwen3.6:35b via Ollama. It can read and describe image,
with query such as "Describe zébrette_le_matin_22_novembre_1913.jpg"
(the file not being directly embedded). The agent use the read_file
tool.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments (there are none)
- [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) (no UI changes)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<details>
  <summary>Transcription of a test query</summary>

## User

Describe zébrette_le_matin_22_novembre_1913.jpg

## Assistant

<thinking>
The user is asking me to describe an image file:
"zébrètte_le_matin_22_novembre_1913.jpg". This appears to be a
newspaper/magazine cover or page from "Le Matin" dated November 22,
1913. I need to read this image file to see what's in it. Let me find it
first.
</thinking>

Let me locate and examine that image file first.

**Tool Call: No matches**
Status: Completed

```json
{
  "offset": 0,
  "current_matches_page": [],
  "all_matches_len": 0
}
```

## Assistant

<thinking>
Let me try different variations of the filename.
</thinking>

**Tool Call: 1 match**
Status: Completed

file:///home/marius/sec/a/z%C3%A9brette_le_matin_22_novembre_1913.jpg

## Assistant

<thinking>
Found it. Let me read the image file.
</thinking>

**Tool Call: Read file `zébrette_le_matin_22_novembre_1913.jpg`**
Status: Completed

`Image`

## Assistant

<thinking>
Now I can describe the image. It's a black-and-white illustration from
what appears to be a French newspaper ("Le Matin" dated November 22,
1913).

The image depicts an elegantly dressed woman descending a staircase. She
is wearing:
- An elaborate headdress with what looks like ostrich feathers or plumes
- A decorative crown or tiara
- Long earrings
- Multiple strands of pearls around her neck
- A flowing, ornate dress with fur trim (a stole/cape)
- A long necklace

The style is Art Nouveau/Art Déco. She appears to be a society figure
attending some gala or fancy dress event. The illustration has a
halftone dot pattern typical of newspaper printing from that era.


I'm wondering what "zébrètte" refers to—it might be the name of the
person depicted, the caption associated with this illustration, or
perhaps a specific fashion item.
</thinking>

## Description: *Zébrètte* (Le Matin, 22 novembre 1913)

This is a black-and-white newspaper halftone illustration from the
French daily **Le Matin**, dated November 22, 1913. It depicts an
elegantly dressed woman descending a staircase — likely covering a
high-society or gala event.

### Key details:

- **Headdress**: The most striking feature is an elaborate plumed hat
with large ostrich-style feathers rising above her head, paired with a
decorative crown/tiara.
- **Attire**: She wears a flowing gown adorned with ornate patterns,
draped under a luxurious fur-trimmed stole (or capelet). Her dress has
intricate embellishments on the bodice and legs of the skirt.
- **Accessories**: Multiple strands of pearls around her neck, long
dangling earrings, and an additional long necklace chain add to the
opulent look.
- **Pose & setting**: She steps down a staircase with a swirling Art
Nouveau–style railing behind her, suggesting she has just arrived at or
is leaving a grand event (a ball, premiere, or society gathering).
- **Artistic style**: Rendered in a sketchy, expressive line-drawing
style typical of early 20th-century French illustration. The halftone
dot pattern reveals it was printed in a newspaper.

The caption title *"Zébrètte"* likely refers to either the nickname of
the woman depicted or a costume/carnival reference (suggesting "striped"
or zebra-print), though without the surrounding text from the original
page, that detail remains ambiguous.

---

The image in question, I had used as an illustration for one my blog
post, as said by the AI from the Le Matin of the 22 november 1913, via
Gallica
(https://mariusdavid.fr/blog/z%C3%A9bressez%C3%A9brellez%C3%A9brette/)

<img width="944" height="2488" alt="image"
src="https://github.com/user-attachments/assets/3075a56e-b1ec-4906-ab8e-97d32400dc75"
/>


</details>

---

Release Notes:

- Fixed Ollama not being able to access images from tool call

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-09-16 09:00:29 +00:00
Ashraf HossainandCursor 130bd49edf Fix accidental /// comments and a docs typo (#64287)
## Objective

Fix small comment/docs typos left out of #64282.

## Solution

- Replace accidental Rust-style `///` comments with `//` in
`assets/settings/default.json` (`git_panel.tree_view` and
`git.gutter_debounce`)
- Fix typo in `docs/src/visual-customization.md`:
`"enable_language_server" if false` ? `is false`

## Testing

Comment/docs-only changes; no runtime behavior change.

---

Release Notes:

- N/A

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 08:53:40 +00:00
7f6d81014b Document new git_panel settings in all-settings reference (#64282)
## Objective

Document newly added `git_panel` settings in the all-settings reference,
and fix related docs mismatches.

## Solution

- Document `tree_view`, `show_count_badge`, `diff_stats`,
`commit_title_max_length`, and `entry_primary_click_action`
- Document missing `file_icons` / `folder_indicator` for `git_panel`
- Correct `dock` defaults for git/collaboration/outline panels to match
`assets/settings/default.json` (`right`)

## Testing

Docs-only changes; no runtime behavior change.

---

Release Notes:

- N/A

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-16 08:15:49 +00:00
Kirill Bulatov c20a43eb7b Check dependencies in merge queue (#64286)
Fall out of https://github.com/zed-industries/zed/pull/63248 's changes
getting missing the merge queue lockfile check.

Release Notes:

- N/A
2026-09-16 08:07:56 +00:00
Thibaud Guillaume-Gentil fc13b40a69 language_models: Add SuperGrok OAuth provider (#63248)
# Objective

Grok in the agent is BYOK only today (`x_ai` plus an API key from
console.x.ai). SuperGrok is a separate subscription, so you either pay
twice or you skip Grok in Zed. This makes SuperGrok a first-class LLM
provider, same idea as ChatGPT Subscription or GitHub Copilot Chat.

Discussion:
https://github.com/zed-industries/zed/discussions/63114#discussioncomment-18158663

## Solution

Adds a SuperGrok provider next to the API-key one. Sign in / Sign out is
in Settings → AI → LLM Providers, same shape as ChatGPT Subscription.
Tokens go in the OS keychain, not settings.json.

Shipped models: Grok 4.6 (default), Grok 4.5, Grok Build 0.1. Reasoning
effort on 4.5/4.6 matches the BYOK xAI provider (no `none`, default
high, 4.6 has xhigh). Some Grok plans still get HTTP 403 after a
successful login. The error says the account cannot use this API and
points at the API-key provider.

## Testing

I have been running this locally for a few days on macOS 27 (public
beta) with a SuperGrok Heavy subscription. No issues so far.

`cargo test -p x_ai_subscribed --lib` and `cargo test -p language_models
--lib provider::x_ai_subscribed` pass.

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

SuperGrok LLM provider settings:

<img width="956" height="816" alt="Screenshot 2026-08-26 at 13 41 17"
src="https://github.com/user-attachments/assets/ef2d464a-66ad-416a-a924-725a18d41164"
/>

---

Release Notes:

- Added SuperGrok sign-in so a SuperGrok subscription can use Grok
models in the agent
2026-09-16 07:01:45 +00:00
Kirill Bulatov a5be476362 Fix Windows build of remote-server (#64270)
Fixes a warning from
https://github.com/zed-industries/zed/actions/runs/35018526372/job/104551077687

Release Notes:

- N/A
- [GPUI] N/A
2026-09-16 06:30:27 +00:00
MartinYe1234 97b7f74f2a Correct Copilot token-limit metadata (#64195)
## Stack

Part 3 of the split. #64047 and #64194 are merged. This PR targets
`main`, which has been merged into the branch without rewriting history;
the already-merged output-limit and counting changes are preserved.

## Summary

Expose Copilot's actual prompt, combined-context, and output limits
through the shared model interface. Preserve `max_token_count()` as the
existing context capacity; add `max_input_tokens()` for independent
prompt limits, defaulting to context capacity for other providers.
Existing total-display and telemetry callers keep using
`max_token_count()` without fallback expressions. The values come from
the provider's model feed, not hard-coded model tables. Missing prompt
metadata falls back to context capacity; missing output metadata remains
unknown.

Use the independent prompt limit when deciding when to auto-compact,
while retaining the combined window for total usage display and
telemetry. For example, a 90k prompt limit within a 200k context window
is not treated as 200k input and does not lose a second output
reservation.

The existing split-display ring and tooltip use the same usable input
capacity. This PR does not enable split display for Copilot, so it does
not introduce a visible Copilot input-limit display. No counting
endpoints, consent changes, or Delta changes are included.

## Validation

- After the review follow-up, all 47 selected Copilot and agent
compaction tests passed. Local testing used the existing
`gpui_platform/runtime_shaders` feature because the Apple Metal compiler
is unavailable.
- Scoped script/clippy passed for copilot_chat, agent, and agent_ui.
- Formatting and whitespace checks passed.
- Fixtures cover unequal prompt/context/output limits, absent/zero
metadata, and existing compaction workflows.
- Reviewed the complete diff against current main: only the input-limit
API, Copilot metadata, its compaction/display consumers, and tests
remain. The live tooltip workflow was not exercised.
- No live provider calls were made.

Downstream Delta integration must use `max_input_tokens()` for input
admission when updating its Zed dependency; that pin update remains
separate.

## Review follow-up

- Added a real Thread regression with 200k context, 90k input, and
16,384 output: compaction changes from inactive at 80,999 tokens to
active at 81,000; total displayed capacity remains 200k.
- Changed the split input ring to use the same capacity as its tooltip.
This does not enable split display for Copilot.
- All 47 selected tests passed locally, along with scoped Clippy,
formatting, and whitespace checks. Temporarily restoring the incorrect
context-limit call made the new regression fail; that mutation was
removed.

Release Notes:

- Fixed auto-compaction thresholds for GitHub Copilot models with a
prompt limit below their context window.
2026-09-15 23:25:47 +00:00
Finn Evers 60d1758335 xtask: Add method for walking the GPUI crate graph (#64247)
Release Notes:

- N/A
2026-09-15 22:26:40 +00:00
Cole Miller bbd9347a22 Emit ordinary stop events for Zed-hosted Gemini models (#64263)
Previously, the Gemini per-event mapper shared by Zed-hosted models and
BYOK recorded `finishReason`, but did not emit
`LanguageModelCompletionEvent::Stop` for ordinary text completions such
as:

```json
{
  "candidates": [
    {
      "index": 0,
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "What can I help you with today?"
          }
        ]
      },
      "finishReason": "STOP"
    }
  ]
}
```

The BYOK stream wrapper compensated by emitting the recorded stop reason
at EOF. The hosted path called the per-event mapper without that
wrapper, so completed text responses could reach consumers without a
`Stop` event.

This PR emits the stop event from the shared per-event mapper, after
processing the chunk’s content, while preserving tool-use and refusal
handling. It also removes the BYOK EOF-to-success fallback: a direct
stream ending without a completion signal now reports an unexpected-end
error instead of synthesizing successful completion.

Release Notes:
- N/A
2026-09-15 21:04:22 +00:00
Conrad Irwin 8f843d073d fs: Improve filesystem rescan diagnostics (#64253)
## Summary

Replace the broken rescan-warning rate limiter, which repeatedly emitted
“not logging more” without advancing its counter.

- Keep the last 10 queued path occurrences per watcher backend,
preserving full paths.
- Build and write rescan reports in the existing background dispatch
task, keeping blocking log I/O off the native watcher reader.
- Emit one error line per dispatched rescan after coalescing duplicate
pathless rescans and before registration fan-out, containing the
backend-provided reason, affected paths, and preceding paths.
- Remove the redundant rescan warnings and rate-limit bookkeeping
without changing rescan scheduling.
- Add one focused test for the path history and report contents.

## Verification

- `corgi test -p fs --lib` — 23 tests passed.
- `corgi test -p fs --features test-support --test integration` — 24
tests passed.
- `corgi fmt -p fs -- --check`
- `git diff --check`

Release Notes:

- Improved filesystem watcher rescan diagnostics and removed repetitive
“not logging more” warnings.
2026-09-15 20:04:06 +00:00
Anthony Eid eb655653f2 Move Windows dialogs and credential I/O off the foreground thread (#64250)
## Summary

Move Windows file-open, file-save, and native message dialogs off the
foreground executor so time spent waiting for a user does not appear as
a long foreground task poll. Move Windows Credential Manager reads,
writes, and deletes to the background executor as well.

The caller-facing receiver/task APIs remain unchanged. No hang-journal
suppression or new public GPUI task-spawn API is introduced.

## Implementation

- Run synchronous native dialogs on dedicated threads with COM STA
initialization and cleanup on the same thread.
- Keep the native owner relationship when a window exists; support
ownerless file/save dialogs by passing a null owner HWND.
- Serialize dialogs per owner using one mutex, also used to wait for
active native work before destroying the owner HWND. Closing the GPUI
window sets a shared cancellation flag and hides the native window;
queued requests see that flag and cannot launch. No pending counter,
lifetime lease, cancellation registry, or idle-notification channels are
needed.
- Use a worker-thread timer to request native cancellation when the
caller drops its receiver or the owner closes.
- Preserve message prompts without a Cancel option by vetoing user
cancellation unless an internal cancellation was requested.
- Distinguish actual file-dialog failures from user cancellation.

Sleep/wake and frame-visibility telemetry are intentionally deferred.

## Validation

- `corgi fmt -p gpui_windows -- --check` and scoped `git diff --check`
passed.
- Minimal scratch Windows-target harnesses type-checked the dialog
module and native API wiring against real Windows 0.62 bindings. These
are not full integration builds.
- Six extracted native-independent state/policy tests passed, covering
owner shutdown, queued-request cancellation state, per-request
cancellation isolation, per-owner serialization, ownerless cancellation,
and 12 message-prompt cancellation-policy combinations. These do not
execute native dialogs or the complete coordinator/worker handoff.
- Before the shutdown simplification, Cameron built and launched Zed
successfully on Windows using a shorter `CARGO_TARGET_DIR`, and reported
running the manual prompt checks. The captured output contains no
foreground/action hang or saved task-trace messages, but exact
prompt-by-prompt coverage and timing have not been established.
- The committed Windows test suite has not yet been run natively.

## Open review items

This PR remains a draft. The dialog helper has been simplified to
approximately 245 production lines, retaining native ownership and using
the existing per-owner mutex for shutdown instead of separate lifetime
bookkeeping. Independent static review found no concrete lifetime
regression. Native cancellation still uses the existing worker-thread
timer/window-enumeration mechanism; Windows runtime validation of the
revised shutdown path is outstanding.

Before merging, verify ownerless prompts, focus/Alt+Tab behavior,
overlapping requests for the same owner, cancellation while
queued/shown, owner closure, and nested overwrite confirmations on
Windows. Absence of hang logs alone does not establish those behaviors.

The required review-confirmation marker in README.md must be removed
manually by the human author after review.

Release Notes:

- N/A
- [GPUI] Move window dialogs and credential I/O off foreground thread
2026-09-15 18:59:14 +00:00
Kirill Bulatov bec63dee23 Revert "Implement inspector flag (#62920)" (#64248)
This reverts commit bf2d51bcfd.

As discussed with @\ChristopherBiscardi , this has to be implemented
differently, making a first step towards that.

Release Notes:

- N/A
2026-09-15 16:58:03 +00:00
Kirill Bulatov 7b2ccdffc6 Fix project panel not scrolling to collapsed parent folders (#64207)
Closes https://github.com/zed-industries/zed/issues/57771

Release Notes:

- Fixed project panel not scrolling to collapsed parent folders
2026-09-15 16:33:57 +00:00
Smit BarmaseandAnthony Eid 7a3199f7f2 gpui_macos: Improve mouse tracking for normal windows (#64234)
To reproduce:

1. Place Safari over part of Zed, then focus Zed.
2. Right-click Safari to open its context menu, then left-click Safari
anywhere in it.
3. Move the pointer over Safari where it covers the Zed. Zed shows hover
effects underneath.

Use a view tracking area and disable `acceptsMouseMovedEvents` for
normal macOS windows. This addresses hover effects on covered content
when the pointer moves over another window.

[Chromium also requests mouse movement through tracking
areas](https://github.com/chromium/chromium/blob/5a43095e95ffe566d1512b9d67d534e3ae05b975/components/remote_cocoa/app_shim/bridged_content_view.mm#L436-L465).
A search of its macOS window/view code found no explicit use of
`acceptsMouseMovedEvents`, which [defaults to
`false`](https://developer.apple.com/documentation/appkit/nswindow/acceptsmousemovedevents).

Tracking stays enabled in unfocused windows while the app is active.

Before:


https://github.com/user-attachments/assets/f21cd3e5-04d5-4d34-b495-02f8d0f68ecf

After:


https://github.com/user-attachments/assets/89a8b9c9-5aa3-4075-aa91-13e200ea3613

Release Notes:

- [GPUI] Fixed mouse tracking on macOS so moving the pointer over
another app’s window no longer triggers hover effects in covered GPUI
windows.
- Fixed an issue on macOS where moving the pointer over another app
could trigger hover effects in a Zed window underneath it.

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-09-15 16:28:53 +00:00
Agus Zubiaga 488309b187 helix: Fix paste in deleted diff hunks (#64245)
Closes ZED-73F

# Objective

Pasting in Helix mode while the cursor was inside an expanded deleted
diff hunk could create a selection past the buffer and crash.

## Solution

Track the inserted range with before/after anchors instead of deriving
it from the clipboard text length. If the edit is rejected for
non-editable diff text, both anchors resolve to an empty valid range.

## Testing

Added a regression test for pasting inside an expanded deleted hunk and
ran the Helix paste tests.

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

---

Release Notes:

- Fixed a crash when pasting in an expanded deleted diff hunk in Helix
mode
2026-09-15 15:27:26 +00:00
Dom Porada 3c779a6df0 Add a setting for the Threads Sidebar width (#62883)
## Objective

The Threads Sidebar opens at a hard-coded 300px and can be resized only
by dragging. `agent.default_width` controls the Agent Panel rather than
the sidebar, leaving no way to configure the sidebar’s preferred width.

## Solution

Add `agent.threads_sidebar_default_width` for the width used when no
user-chosen sidebar width is stored. The value is clamped to the
existing 200–800px drag range. Existing, unresized sidebars follow
settings changes immediately. Double-clicking the divider resets the
sidebar to the configured width and resumes following subsequent
settings changes.

The sidebar previously saved its width whenever any sidebar state
changed, not only when the divider was dragged. `SerializedSidebar` now
records `width_set_by_user`, so settings-driven widths are no longer
persisted. Manually resized widths take precedence until the divider is
reset.

## Testing

- `test_threads_sidebar_default_width` in
`crates/agent_settings/src/agent_settings.rs` covers the default, a user
override, fallback for `null` and an unset field, and preservation of
the Agent Panel width and sidebar position.
- Five width-focused tests in `crates/sidebar/src/sidebar_tests.rs`
cover reset behavior, live settings updates, clamping, legacy-width
restoration, and persistence. They also check that manually resized
widths resist settings changes and that resetting resumes following the
setting.
- To check by hand: set `"agent": { "threads_sidebar_default_width": 360
}`, reset the divider, and confirm the sidebar is 360px wide. Change the
setting and confirm the width updates immediately. Drag it wider,
restart, and confirm the dragged width is kept. Double-click the divider
and confirm it returns to the configured width. Set the value to `5000`
and confirm the untouched sidebar clamps to 800px.

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

- Added `agent.threads_sidebar_default_width` for setting the width of
the Threads Sidebar.
2026-09-15 14:53:12 +00:00
MartinYe1234 616ac232d4 Add provider-backed input token counting (#64194)
## Stack

Part 2 of the split. #64047 is merged, and this PR now targets `main`.
Current main was merged into this branch without rewriting history. The
diff contains only counting/consent work and the required README review
acknowledgment (8 files, +837/-80). The Copilot metadata sibling #64195
does not depend on this PR.

## Summary

Add optional provider-backed input counting for direct Anthropic, direct
OpenAI Responses, and hosted Anthropic/OpenAI models. Preserve
structured input and reuse provider conversion, authentication refresh,
and client request limiting. Unsupported providers return `None`;
provider and malformed-response errors remain visible.

Keep the existing hosted data-retention consent rule common to counting,
native compaction, and generation. Counting never sends input before
consent. The matched Cloud endpoint support is merged; its deployment
remains a prerequisite for downstream callers.

This PR does not change Copilot prompt/context metadata, compaction
thresholds, or tooltips. No chunking or paid tests are introduced.

## Validation

- After resolving the main merge: 226 tests passed across anthropic,
open_ai, language_models, and language_models_cloud. Main’s consolidated
output-limit tests and renamed serialization test are preserved.
- Scoped script/clippy passed for anthropic, open_ai, language_models,
and language_models_cloud.
- Formatting and whitespace checks passed.
- Coverage includes images, structured request fields, authenticated
hosted requests, unsupported providers, error propagation, and consent
rejection before HTTP.
- No live provider calls were made.

Release Notes:

- Fixed data-retention consent checks for hosted counting and compaction
requests.
2026-09-15 14:52:14 +00:00
Piotr Osiewicz ceeaeae5b3 ci: Use a smaller Linux runner for migration checks (#64240)
## Summary

Move `check_postgres_and_protobuf_migrations` from the existing 16-vCPU
/ 32-GiB Linux runner to the existing 8-vCPU / 16-GiB runner. The job
handles Git history and Buf compatibility, lint, and formatting checks;
its commands, triggers, and coverage remain unchanged.

This reduces its concurrent CPU and memory allocation by half. Namespace
observations from September 11–14 covered 224 runs, with a typical job
duration of 37 seconds and maximum observed RAM around 1.5 GiB. The p95
of per-run peak CPU usage was about 7.7 cores, so CI runtime on the
smaller profile should be checked rather than assuming identical
performance.

Updated the Rust workflow generator and regenerated the YAML. No other
jobs are changed.

## Validation

- `cargo xtask workflows`
- `cargo fmt -p xtask -- --check`
- `git diff --check`
- Full diff reviewed: two files, only the runner selection changed.
- Actual migration check on the smaller runner awaits CI.

Release Notes:

- N/A
2026-09-15 14:38:10 +00:00
Finn Evers 0a26ad72e9 Require release notes to be present (#64238)
Release notes are the sole information users have about what could
either have improved or have been broken for them. Omitting release
notes is one thing, but not writing any or having empty ones helps
nobody - users get no context on what could cause issues they were
seeing nor do they know about potential improvements, triagers cannot
easily find the PR that could have introduced the bug either.

Thus, this PR now makes it so that danger actually requires one to write
release notes. Empty release notes or the placeholder will no longer be
accepted.

Release Notes:

- N/A
2026-09-15 13:38:45 +00:00
Chris Drackettanddino 6fbe527f1f Use terminal.background behind terminal tool call output (#64163)
Right now there is some margin that uses `editor background` above the
output of the terminal that carries `terminal_background`. If the editor
uses a light background and the terminal is dark you'll end up with a
light area of margin above the dark terminal. The terminal background
also clips the rounded border of the box. This patch switches this to
match the terminal background and makes sure the background never clips
the rounded border.

Before:
<img width="720" height="212" alt="Screenshot 000044 in Zed@2x"
src="https://github.com/user-attachments/assets/333a0e17-2869-4cc9-b696-f24eec8630aa"
/>


After: 
<img width="646" height="228" alt="Screenshot 000050 in zed@2x"
src="https://github.com/user-attachments/assets/54293de1-bc64-450f-b354-e64ba0e3d5e9"
/>

Release Notes:

- Fixed terminal tool output in the Agent Panel to consistently use the
theme’s `terminal.background` color.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-09-15 13:26:56 +00:00
Finn Evers 8e20f12347 Remove ztracing dependency from GPUI (#64237)
Release Notes:

- N/A
2026-09-15 12:52:48 +00:00
Dom Porada 94d29d40f1 Clarify how agent.flexible affects agent.default_width (#63020)
## Objective

`agent.default_width` is described as the Agent Panel’s default width,
but panels docked to the left or right use proportional sizing while
`agent.flexible` is enabled. Because flexible sizing is enabled by
default, double-clicking the outer resize handle restores the default
proportion rather than the configured pixel width. This can make
`agent.default_width` appear to be ignored.

## Solution

Clarify that `agent.default_width` controls the fixed width used when
`agent.flexible` is disabled, while resetting a flexibly sized Agent
Panel restores its default proportion.

Update the default settings comments, settings documentation, Settings
UI description, and visual customization guide. Add `agent.flexible` to
the Agent Panel configuration example and explain how it affects reset
behavior. No sizing behavior changes.

## Testing

- `cargo fmt --all -- --check`
- No runtime testing—the change only updates settings descriptions and
documentation.

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

- N/A
2026-09-15 12:45:15 +00:00
Finn Evers 3b54ef7ab4 Add initial support for having GPUI release notes (#64203)
Release Notes:

- N/A
2026-09-15 12:43:19 +00:00
kvechkanov 280beb8920 ui: Use VersionControl colors for added and removed diff stats (#64083)
# Objective
Fixes #63806 
Diff stats use general `success` and `error` colors for added and
deleted line counts.

## Solution

Using `version_control.added` and `version_control.deleted` instead to
match the version control icons color palette.

## Testing

- Did you test these changes? If so, how?
built and ran locally.


- Are there any parts that need more testing?
no
- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
no
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?

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

<details>
  <summary>Click to view showcase</summary>

<img width="2394" height="776" alt="zed_diff_stat_colors"
src="https://github.com/user-attachments/assets/5c3f89fd-4a07-4fc8-83f9-5f6e133dfe86"
/>
Left Zed - unchanged
Right Zed - fixed

</details>

---

Release Notes:

- Fixed diff statistics to use the theme’s version-control colors for
added and deleted line counts.
2026-09-15 12:11:12 +00:00
Dom PoradaandKirill Bulatov 593d6a4d66 Add support for the "..." entry in read_only_files (#64222)
## Objective

Let projects add read-only file patterns without repeating the patterns
inherited from user settings.

## Solution

Extend the `"..."` behavior introduced in #62769 to `read_only_files`. A
`"..."` entry includes the inherited patterns. Omitting it replaces the
list, and `[]` clears it.

## Testing

Tested on macOS with settings merge, VS Code import, and project
integration tests. The project test verifies that user and project
patterns both apply while unrelated files remain editable.

To check manually, configure different user and project patterns,
include `"..."` in the project list, and open matching files. Repeat
without `"..."` after restarting Zed to verify replacement.

Linux, Windows, and manual app testing were not performed.

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

- Added support for `"..."` in `read_only_files` so project settings can
extend inherited read-only patterns.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-15 11:49:56 +00:00
Bennet Bo Fenner cb2190f461 gpui: Fix panic related to context menus in WASM (#64223)
Release Notes:

- N/A
2026-09-15 10:09:30 +00:00
Kirill Bulatov 0446ad2294 Refine recent commands' UX (#64181)
Follow-up to https://github.com/zed-industries/zed/pull/63388 


https://github.com/user-attachments/assets/2a855451-141b-4030-8475-92f23c661d51

Release Notes:

- Improved recent commands' UX
2026-09-15 09:58:45 +00:00
Rusty Raven c7a50ea221 Drop settings that no longer exist from the reference (#64210)
# Objective

Follow-up to #64196, which corrected documented default *values*. This
one covers documented *settings* — four entries in the reference name
settings that have been renamed, moved, or removed outright, so a reader
who copies them gets a key Zed either ignores or silently rewrites on
load.

Each claim below links to the code that makes it true:

| Documented as | Reality | Evidence |
| --- | --- | --- |
| `features` | Gone |
[`m_2026_02_02/settings.rs#L19-L27`](https://github.com/zed-industries/zed/blob/977458038b62d8a989903aeb0f0c67cd12e8eb00/crates/migrator/src/migrations/m_2026_02_02/settings.rs#L19-L27)
moves the provider out and deletes `features` once empty; no `pub
features` exists in
[`crates/settings_content/`](https://github.com/zed-industries/zed/tree/977458038b62d8a989903aeb0f0c67cd12e8eb00/crates/settings_content/src)
|
| `edit_prediction_provider` | `edit_predictions.provider` | same
migration, plus
[`default.json`](https://github.com/zed-industries/zed/blob/977458038b62d8a989903aeb0f0c67cd12e8eb00/assets/settings/default.json)
ships `"edit_predictions": { "provider": "zed" }` |
| `agent_font_size` | `agent_ui_font_size` |
[`m_2025_10_03/settings.rs#L10-L11`](https://github.com/zed-industries/zed/blob/977458038b62d8a989903aeb0f0c67cd12e8eb00/crates/migrator/src/migrations/m_2025_10_03/settings.rs#L10-L11)
— "Renames the setting `agent_font_size` to `agent_ui_font_size`" |
| `projects_online_by_default` | Gone | no match in `crates/` or
`assets/` |

## Solution

`## Features` is deleted. Its only child, [Edit Prediction
Provider](https://zed.dev/docs/reference/all-settings#edit-prediction-provider),
moves under [Edit
Predictions](https://zed.dev/docs/reference/all-settings#edit-predictions)
to sit with the other `edit_predictions` settings, and its `Setting:`
line becomes `provider`. Nothing else had to change in that subsection —
its JSON examples already used the `edit_predictions.provider` shape,
which is what made the stale wrapper easy to miss.

`agent_font_size` is renamed in place, heading included.
`projects_online_by_default` is removed.

The Edit Predictions example also listed seven `disabled_globs` where
`default.json` ships ten. #64196 corrected that number on the [Disabled
Globs](https://zed.dev/docs/reference/all-settings#disabled-globs) entry
immediately below it, so the two were contradicting each other on the
same page; the example is now synced.

## Testing

`cd docs && npx prettier --check src/` passes, per
[`docs/AGENTS.md`](https://github.com/zed-industries/zed/blob/main/docs/AGENTS.md).
Code fences stay balanced, the moved heading is unique on the page, and
no page links to `#features`, `#agent-font-size`,
`#projects-online-by-default`, or `#edit-prediction-provider`, so the
restructure breaks no anchors. No `{#action}` or `{#kb}` references are
added, so this does not depend on the action metadata `check_docs`
generates.

Found by extracting every ``Setting:`` name on the page and checking it
against the keys `assets/settings/default.json` actually contains, then
confirming each miss against `crates/settings_content/` and
`crates/migrator/`.

## Notes for review

- The same sweep says 24 scalar settings that `default.json` ships have
no entry on this page at all, including `hide_mouse`,
`word_diff_enabled`, `minimum_contrast_for_highlights`,
`modeline_lines`, `lsp_results_location` and `zoomed_padding`. That is
#53323 territory and a much larger piece of writing, so it is not here —
happy to take it on if you want it.
- `auto_update_extensions` and `terminal.font_features` are documented
but absent from `default.json`. Both are real settings
([`extension.rs`](https://github.com/zed-industries/zed/blob/977458038b62d8a989903aeb0f0c67cd12e8eb00/crates/settings_content/src/extension.rs),
[`terminal.rs`](https://github.com/zed-industries/zed/blob/977458038b62d8a989903aeb0f0c67cd12e8eb00/crates/settings_content/src/terminal.rs))
that simply have no shipped default, so I left them alone.
- Still outstanding from #64196's review notes:
`crates/settings_content/src/language.rs` and `editor.rs` carry `///
Default:` comments that feed the settings.json schema tooltips and still
disagree with the site, and `docs/src/diagnostics.md` and
`docs/src/visual-customization.md` still show the old
`diagnostics_max_severity` and `cursor_shape` defaults.

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

- N/A
2026-09-15 05:22:45 +00:00
Rusty Raven 977458038b Correct wrong default values in the settings reference (#64196)
# Objective

Fixes #56544

The settings reference documents `format_on_save` as defaulting to `on`,
but `assets/settings/default.json` ships `"format_on_save": "off"`. The
reporter in #56544 hit exactly that: a fresh config, a C file, save, and
nothing happens.

The reason the documented default looks right to many people is that Zed
enables it per language for twelve languages (Astro, Dart, EEx, Elixir,
Elm, Go, GraphQL, HEEx, Kotlin, Rust, Starlark, Zig). Save formats a
Rust buffer and not a C one, and neither the reference nor the
reporter's mental model had anywhere to hang that difference.

Checking that one entry made me wonder how many others were stale, so I
compared every `Setting:`/`Default:` pair on the page against the
corresponding path in `default.json`. Six more were wrong.

## Solution

| Setting | Documented | Ships as |
| --- | --- | --- |
| `format_on_save` | `on` | `off` |
| `auto_indent` | `true`, "`boolean` values" | `syntax_aware`, a
three-way enum |
| `diagnostics_max_severity` | `null` | `all` |
| `terminal.cursor_shape` | `null` (defaults to block) | `block` |
| `terminal.alternate_scroll` | `off` | `on` |
| `edit_predictions.disabled_globs` | 7 globs | 10 globs |
| `git.gutter_debounce` | `null` | `0` |

Two of these needed more than a value swap:

`auto_indent` stopped being a boolean when it became `AutoIndentMode`
(`crates/settings_content/src/language.rs:411`), so the options list now
covers `syntax_aware`, `preserve_indent` and `none`, and the description
no longer reads as a yes/no toggle.

`format_on_save` gets a sentence naming the twelve languages, so the
difference between saving a Rust buffer and a C one has somewhere to
hang.

`diagnostics_max_severity` and `terminal.cursor_shape` were
self-contradicting rather than merely stale: each section's own prose
already described the real default while the `Default:` line said
`null`.

## Testing

`cd docs && npx prettier --check src/` passes, as required by
`docs/AGENTS.md`. The change is prose and adds no `{#action}` or `{#kb}`
references, so it does not depend on the action metadata that
`check_docs` generates. The `[\`languages\`](#languages)` link resolves
to the single `## Languages` heading on the same page.

Every value in the table above was read out of
`assets/settings/default.json` on `main`, and I confirmed `default.json`
is authoritative for each by following the resolved-settings path (the
`user_content.<x>.unwrap()` style accessors) rather than trusting the
file alone.

## Notes for review

Found while auditing, deliberately left out of this PR — happy to take
any of them in a follow-up, or here if you would rather:

- Two Rust doc comments carry the same wrong defaults and feed the
settings.json schema tooltips, so the in-editor hover still disagrees
with the site: `crates/settings_content/src/language.rs` says `///
Default: on` for `format_on_save`, and
`crates/settings_content/src/editor.rs` says `/// Default: warning` for
`diagnostics_max_severity` while also saying "Shows all diagnostics if
not specified". Fixing those is a source change rather than a docs one.
- `docs/src/diagnostics.md` and `docs/src/visual-customization.md` still
present `diagnostics_max_severity: null`, and the latter also shows
`cursor_shape: null` for the editor where `default.json` ships `bar`.
Same defect class, different pages and a different presentation
(defaults listings rather than a reference), so I kept this PR to the
reference page.
- The reference's `diagnostics_max_severity` options omit `off`, which
is a live variant (`DiagnosticSeverityContent` in
`crates/settings_content/src/project.rs`). That is a missing option
rather than a wrong default, so it is not in scope here.
- Neither the Format On Save nor the Autosave section mentions that
`"autosave": {"after_delay": {...}}` disables format on save outright
(`crates/workspace/src/pane.rs`), even though `default.json` carries
that warning as a comment.
- The twelve-language list is a maintenance cost: it has to be edited
whenever a language gains or loses a default. `default.json` sets
per-language defaults for `tab_size`, `soft_wrap`, `allow_rewrap`,
`hard_tabs` and others too, and none of them are called out anywhere. A
single general statement about per-language defaults overriding
top-level ones would cover all of them and never go stale. I kept the
explicit list because it is what actually answers #56544, but I will
happily swap it for the general version if you prefer.

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

- N/A
2026-09-15 03:06:39 +00:00
Cameron Mcloughlin 4d0d1f1835 gpui: Remove mutex from dynamic font loading (#64204)
Dynamic font loading is useful on web, but locked a mutex on the main
thread. This PR removes that

---

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-09-14 23:49:34 +00:00
Lukas WirthandMax Brunsfeld 00e0676e5e gpui: Support dynamic font installation (#63498)
Browser applications cannot rely on operating-system font discovery, but
embedding comprehensive emoji and CJK fonts makes the initial
WebAssembly payload prohibitively large. GPUI previously offered no
structured way to learn that fallback was exhausted, and adding a font
at runtime left descriptor and line-layout caches shaped against the old
font database.

This change lets WGPU text systems report unresolved grapheme clusters
through `App::on_missing_glyphs`. GPUI invokes one replaceable
application callback after shaping, carrying each complete grapheme and
whether its source run is proportional or monospace. Reports are
deduplicated and delivered through a bounded, nonblocking channel;
reporting remains disabled until the callback is installed, and queued
reports from an earlier font generation are discarded.

Successful font installation now advances a font generation. GPUI clears
descriptor and platform family resolution, reuses stable font IDs for
unchanged faces while refreshing their fallback chains, and invalidates
each window's current and previous line-layout caches when it observes
the new generation. This supplies the GPUI half of an on-demand web font
loader; fetching and selecting font assets remains application-owned.

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-09-14 21:18:17 +00:00
Cole Miller d705c7f1ae Fix unhighlighted deleted regions in diffs (#64202)
#63145 exposed a bug in the the `snapshot_with_edits` and `fast_forward`
methods that we use to evolve the base text buffer for diffs: we
preserved the value of the `tree_sitter_data` field from the old
snapshot. That causes any diff whose base text has changed to have stale
bracket ranges and now stale syntax highlighting as well, which can
manifest as unhighlighted text in the deleted portion of an expanded
diff hunk.

This PR fixes the issue by clearing the `tree_sitter_data` field in
`snapshot_with_edits`.

Release Notes:

- N/A (problem exists in nightly only)
2026-09-14 20:29:36 +00:00
MartinYe1234 411b31e9a5 Add per-request model output limits (#64047)
## Stack

- This PR: output-limit plumbing, based on `main`.
- #64194: provider input counting and consent, based on this branch.
- #64195: Copilot metadata and consumers, independently based on this
branch.

After this PR lands, rebase/retarget both children onto `main` as
needed, especially after a squash merge. At split time, a synthetic
merge of the two child heads exactly matched the saved pre-split source
tree. PR1 has since consolidated overlapping tests without changing
production code.

## Summary

Part 1 of a three-PR split: add optional per-request
`max_output_tokens`, forward it through provider payloads, and clamp it
against known output limits. Unset requests preserve existing defaults.
Unknown Copilot output metadata is not treated as a zero-token maximum
when forwarding a cap.

This PR also supplies the combined-window and native-capability
interfaces used by downstream budget calculations. It does not add
input-token counting, data-retention consent integration, or change
Copilot prompt/context metadata, compaction thresholds, or tooltips.
Those changes are split into two child PRs based on this branch.

The net diff is 24 files, +438/-55. Forward narrowing commits preserve
the original review history; there was no force-push.

## Test consolidation

Eight overlapping standalone tests have been folded into existing
conversion tests, preserving coverage of unset limits, explicit limits,
clamping, and serialized payloads. Four distinct tests remain separate:
request serialization compatibility, Copilot wire formats, DeepSeek
conversion (no existing conversion suite), and hosted OpenAI
normal-completion HTTP behavior. This cleanup changes no production Rust
code.

## Validation

- Latest run: 269 tests passed across anthropic, google_ai, open_ai,
language_models, copilot_chat, and language_models_cloud.
- Five extended existing tests failed when cap selection was temporarily
broken and passed after restoration. No mutations remain.
- Latest scoped script/clippy, formatting, and whitespace checks passed.

Earlier split validation:

- 229 tests passed across language_model_core, anthropic, open_ai,
copilot_chat, and language_models_cloud.
- Scoped script/clippy passed for copilot_chat, language_models_cloud,
language_models, agent, and agent_ui.
- Formatting and whitespace checks passed.
- Permanent tests cover payload propagation, absent/explicit limits,
unknown output metadata, direct and hosted native-compaction caps, and
hosted OpenAI clamping.
- No live provider requests were made for the split.

## Review notes

The separately identified fixed/non-interleaved thinking-budget versus
smaller output-cap concern remains open in this PR; it must not be
hidden in the counting or metadata PRs. The README acknowledgment is
retained for human review.

Downstream applications using input counting must consume the counting
child PR as well, not repin to this branch alone.

Release Notes:

- N/A
2026-09-14 20:15:15 +00:00
Max Brunsfeld 3e14bae23e Fix Trunk link in GPUI examples documentation (#64192)
## Summary

- Replace the outdated Trunk URL in the GPUI examples README with
https://trunk-rs.github.io/trunk/.

## Verification

- Confirmed the replacement URL returns HTTP 200.
- Ran `git diff --check` successfully.
- No code tests needed for this documentation-only link change.

Release Notes:

- N/A
2026-09-14 16:38:51 +00:00
Kirill Bulatov 3c9e435c30 Reveal in all multi buffers (#64154)
Closes https://github.com/zed-industries/zed/issues/62909
Closes https://github.com/zed-industries/zed/issues/57396

Release Notes:

- Fixed project panel reveal not working in git diff-related multi
buffers
2026-09-14 15:54:54 +00:00