Commit Graph
40022 Commits
Author SHA1 Message Date
zed-zippy[bot]andFinn Evers e8041ccebb glsl: Bump to v0.2.5 (#64370)
This PR bumps the version of the GLSL extension to v0.2.5.

Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Finn Evers <finn@zed.dev>
2026-09-17 09:50:03 +00:00
zed-zippy[bot]andFinn Evers 6e368ab515 proto: Bump to v0.3.4 (#64372)
This PR bumps the version of the Proto extension to v0.3.4.

Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Finn Evers <finn@zed.dev>
2026-09-17 09:49:10 +00:00
Finn Evers 9d956a090b ci: Run license check more often (#64375)
Follow-up to the learnings of
https://github.com/zed-industries/zed/pull/64292

Release Notes:

- N/A
2026-09-17 09:35:14 +00:00
Finn Evers ecc2353d5f Fix corgi patches license softlink (#64374)
Release Notes:

- N/A
2026-09-17 09:24:59 +00:00
Smit Barmase 534319bd05 which_key: Improve pending keystrokes indicator to include untimed chords (#64362)
Closes #64338

The pending keystrokes indicator now shows chords without a timeout,
with no countdown circle. For example, pressing `cmd-k` shows that Zed
is waiting for another key.

Few cases which needed special handling for untimed chords case:

- Hovering already pauses a timed chord, and GPUI preserves that pause
when the chord advances. An untimed chord has no paused timeout to carry
forward. We pause its newly created timeout if the pointer is still over
the indicator or popover.
- For timed chords, the timeout already stays paused during the
popover's 300 ms dismissal delay. If an untimed chord gains a timeout
during that delay, it now follows the same rule. The popover still
closes at the original deadline, then the timeout resumes with a full
second remaining.

<img width="308" height="182" alt="CleanShot 2026-09-17 at 11 45 33
AM@2x"
src="https://github.com/user-attachments/assets/9baa5fde-de9b-447d-9b02-b712a3065685"
/>

Release Notes:

- Improved the pending keystrokes indicator to show chords without a
timeout, such as shortcuts starting with `cmd-k`.
2026-09-17 09:17:09 +00:00
Finn Evers aec7395e30 Fix cargo shear warnings (#64340)
Also updates CI to always run this - that way we ensure that disabling
or enabling tests does not become stale at some point and thus can
safely add this.

Release Notes:

- N/A
- [GPUI] N/A
2026-09-17 08:49:31 +00:00
tidely 613a80b9e9 gpui_macos: Fix traffic lights animation during fullscreen exit (#64339)
# Objective

Fixes #64050

Going out of fullscreen on MacOS currently gives the traffic lights a
janky animation. This seems to be a timing issue during ownership
transfer of traffic light rendering from AppKit to Zed.

## Solution

Add an additional boolean flag (yes, sad), which keeps track of whether
the animation from full screen to windows has completed.

## Testing

Tested this on a mac, animation is now buttery smooth.

## Showcase

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

Before:



https://github.com/user-attachments/assets/f629f2d8-2466-47e3-9b8b-65975bdd1c61

After:


https://github.com/user-attachments/assets/a393d3a7-647d-4784-bc2a-9d67fac9f951

</details>

---

Release Notes:

- Fixed MacOS traffic lights animation when exiting fullscreen
- [GPUI] Fixed MacOS traffic lights animation when exiting fullscreen
2026-09-17 08:29:46 +00:00
Finn Evers 0ef92145ff gpui: Improve PlatformAtlas::get_or_insert_with (#64331)
Stumbled across this during a recent review:

At all of the call sites in prod code, we would clone, then into, then
pass by ref, and then immediately clone again in `get_or_insert_with`
when the texture was not found.

Instead, changed the API to now take an owned `AtlasKey` to make better
use of the cloning.

As a second step, went ahead and added a generic `AtlasState`, as I
noticed all atlases shared some similar logic around keeping track of
the tiles. With this restructing, we reuse some code across different
backends, but more importantly, get rid of an additional hashmap lookup
by instead using the `Entry` API.

Release Notes:

- N/A
- [GPUI] N/A
2026-09-17 08:24:25 +00:00
Finn Evers 31971937b5 Move corgi-patches into tooling (#64292)
That seems like a better place for this to live as opposed to the
top-level namespace

Release Notes:

- N/A
2026-09-17 08:04:39 +00:00
tidely 4b47ceb9d3 gpui_macos: Migrate screen capture to objc2 (#64251)
# Objective

Get rid of instances of the `block` crate, as it will not compile in a
future version of Rust. This gets rid of the `block` crate inside of
`gpui_macos`, which means were on the home stretch.

## Solution

Migrate `screen_capture.rs` completely to `objc2`. While a more targeted
fix is theoretically possible, there were enough upsides where I thought
this was worth a full migration.

Completely gets rid of the `media` crate, which had manual bindings to
`core_media`, which `objc2` can provide. Gets rid of tons of unsafe
code, and a lot of code in general.

## Testing

Tested manual sharing inside of a Zed channel

Release Notes:

- N/A
- [GPUI] Migrated macOS screen capture to `objc2`
2026-09-17 01:46:02 +00:00
CainandChristopher Biscardi 7a01ac15c5 editor: Fix cursor animation across width and scroll changes (#64184)
Follow-up to #63195.

This PR fixes the cursor animation problems reported in [this
comment](https://github.com/zed-industries/zed/pull/63195#issuecomment-5662566417):

- Block cursors snapped instead of animating when moving between
characters with different display widths, such as an ASCII character and
an emoji or CJK character.
- Cursor animation disappeared near the top and bottom scroll margins
when keyboard navigation triggered vertical autoscrolling.

The first issue happened because any cursor geometry size change was
treated as a reason to snap. Cursor movement now retargets the animation
when either the rectangle position or size changes, while geometry
changes without a logical cursor move still snap immediately.

The second issue happened because every viewport change cleared the
active animation. Scroll-only viewport changes now translate the current
and target corner positions, as well as the previous target geometry, by
the scroll pixel delta before retargeting. This preserves the spring's
motion and velocity across autoscroll. Actual layout changes, including
text-area size, line height, and font advance changes, continue to snap.

Regression coverage includes:

- Both narrow-to-wide and wide-to-narrow cursor transitions, including
convergence to the new rectangle.
- Cursor movement in both directions while the viewport scrolls.
- Scrolling during an active animation without clearing its position or
velocity.
- Layout changes that must still snap.
- An editor-level keyboard autoscroll test using a vertical scroll
margin of 3.

Validation:

- `cargo test -p editor cursor_animation --lib`
- `cargo fmt --all --check`
- `cargo build -p zed --bin zed --profile release-fast`
- Manual verification with the release-fast binary

Release Notes:

- Fixed cursor animations when moving between characters of different
widths and during keyboard-triggered autoscrolling.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-09-16 23:26:23 +00:00
Cameron Mcloughlin 6c9d10cb83 gpui_web: Flatten webgl texel loading (#64337)
The webGL backend uses textures to upload quads to the GPU, since it
doesn't have storage buffers. Each quad is stored in 10 texels, and we
previously fetched each texel 4 times. Although texel fetches are
cached, the extra bookkeeping optimized badly, and lead to bad
performance.

This change replaces the `read_word` calls with `fetch_texel_instance`,
and manually unrolls this loop. This gave the following frame time
improvements scrolling through delta web:

- desktop, 9950x3d iGPU, 1440p, firefox:  ~3.3x faster
- mobile, Pixel 10 Pro, firefox: ~23x faster

---

Release Notes:

- [GPUI] Improved performance of webGL quad upload, around a ~3x frame
time reduction in typical cases
2026-09-16 23:23:23 +00:00
Max Brunsfeld 87f65de697 gpui: Fix web fallback for text-default emoji (#64319)
## Objective

Fix missing characters in GPUI's web renderer for emoji-capable symbols
that default to text presentation, such as repeated bare spider webs
(`🕸🕸🕸`). The default Canvas policy previously rejected these symbols
before checking whether bundled fonts could render them.

## Solution

Separate emoji eligibility from presentation. Emoji-capable graphemes
can now use Canvas when their glyph is missing, while existing bundled
text glyphs remain native and explicit text/emoji presentation remains
intact. CJK fallback remains opt-in.

Add regression coverage for repeated spider webs and mixed bare, VS15,
and VS16 sequences, including every glyph's source index and
presentation, missing-glyph reports, copy preservation, and raster-cache
reuse.

## Testing

- `cargo test -p gpui_web --lib`: all 19 tests passed.
- `cargo fmt -p gpui_web -- --check`, example Rust formatting, and `git
diff --check`: passed.
- `trunk build` in `crates/gpui_web/examples/hello_web`: passed.
- Headless Chrome on macOS: browser regression failed against the old
implementation and passed with the fix. Inspected the resulting
screenshot; all mixed-presentation spider webs render.
- Firefox, Safari, and other operating systems have not been exercised.

To run the browser workflow, serve the gallery with `trunk serve` from
`crates/gpui_web/examples/hello_web`, then run `node
crates/gpui_web/examples/hello_web/test_canvas_fallback.mjs
http://127.0.0.1:8080` from the repository root.

Release Notes:

- [GPUI] Fixed missing text-default emoji, including spider-web symbols,
in GPUI's web renderer.
2026-09-16 22:23:38 +00:00
Taha 395fbd11b8 auto_update: Add title bar feedback when Zed is already up to date (#64106)
# Objective

A manual "check for updates" that finds no newer version left the
updater back at `Idle`, so the "Checking for Zed Updates…" indicator in
the title bar simply vanished with no confirmation that the check had
succeeded.

## Solution

Track that transition in `UpdateVersion` and show an "Up to Date" button
in its place for a few seconds. The timer is stored as a task on the
view, so it is cancelled when the view is dropped or a new update state
arrives.

`restart_after_wake` passed through `Idle` before re-polling, which
would read as a completed check; it now stays in `Checking`.

## Testing

- Did you test these changes? If so, how? **Tested by running Zed in
preview channel.**
- 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?

**Use `ZED_RELEASE_CHANNEL=preview cargo run` to open Zed. Then manually
trigger a check within menu `Zed -> Check for Updates`.**

- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?

**Tested only on MacOS Tahoe**

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content 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

A visual demo of what happens in title_bar when a manual check for
updates is triggered.


https://github.com/user-attachments/assets/23b72bf2-6188-4eae-82b9-1c5b70782bb4

---

Release Notes:

- Added confirmation in the title bar when a manual update check finds
Zed is already up to date
2026-09-16 21:41:45 +00:00
Kirill Bulatov cd78c2db42 Fix a flacky bracket test (#64321)
Fixes a flack from
https://github.com/zed-industries/zed/actions/runs/35127308706/job/104899555087?pr=64257#step:7:5674

I believe more tests are worth fixing like that, but those pass right
now, so let's first deal with the only flaky one.

Release Notes:

- N/A
2026-09-16 19:16:31 +00:00
Gautam Manchandani 8eebe1ce1c markdown_preview: Show source path in tab tooltip (#64318)
# Objective

Fixes #64129.

## Solution

Reuse the source editor's tab tooltip for Markdown preview tabs.

## Showcase

<img width="1582" height="962" alt="Markdown preview tab showing its
source file path tooltip"
src="https://github.com/user-attachments/assets/cba7dcfc-f7e7-460c-aaff-ce588321d146"
/>

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

- Fixed Markdown preview tabs not showing their source file path on
hover.
2026-09-16 18:28:12 +00:00
Kirill Bulatov 70a74b8725 Check remote server on each commit (#64283)
Release Notes:

- N/A
2026-09-16 17:01:52 +00:00
3d91988e46 editor: Fix columnar selection coordinates (#63723)
Closes #63712

## Summary

- Use tab-expanded grapheme columns for Add Selection Above/Below when
`skip_soft_wrap` is enabled, rather than UTF-8 byte offsets or Unicode
scalar counts.
- Keep mouse rectangles pixel-based and preserve logical selection goals
across short rows, direction changes, and selection/text undo and redo.
- Reconcile columnar groups when selections change, while preserving
committed groups during cancellable mouse previews.
- Batch source and destination queries by row and skip fully replaced
input rows without a persistent row cache.
- Handle folds, inlays, and replacement blocks with small map-query
additions, and fix the tab bitmap boundary at a tab size of 128.

## Validation

- Full editor library suite: 1,109 passed, one ignored.
- Editor Clippy and scoped formatting passed.
- Regression checks failed without the corresponding lifecycle and
batching fixes, then passed with them restored.
- The three related sync/history tests were rerun and passed after the
final callback-variable renames.

Release Notes:

- Fixed columnar selections landing in the wrong column around non-ASCII
text, tabs, soft wraps, and collapsed content.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-09-16 16:40:28 +00:00
0dea8c63d9 editor: Render point diagnostics without glyphs (#63933)
Closes #63084.

Zed already normalizes most empty and line-terminator-only diagnostic
ranges onto an adjacent character. A diagnostic can still remain a true
point when its position has no glyph, such as column zero of an empty
line or an empty file. The shaped-text path has no `TextRun` at that
position, so the diagnostic appears in diagnostic UI but has no editor
squiggle.

Render only diagnostics that remain zero-width after ingress as a one-em
wavy underline at their `DisplayPoint`. This keeps the stored LSP range
unchanged, uses the existing diagnostic underline policy and font
metrics, and also paints the decoration in a pinned sticky-header copy
when an anchored point survives an edit.

## Evidence

### Empty Go file with gopls

Before:

<img width="471" height="430" alt="Empty Go file before the fix:
diagnostic message without a squiggle"
src="https://github.com/user-attachments/assets/a7f29dd3-a16c-43ea-a53f-d0264efb4ce0"
/>

After:

<img width="471" height="430" alt="Empty Go file after the fix:
diagnostic message with a point squiggle"
src="https://github.com/user-attachments/assets/0546970a-e24e-4e15-a764-d548291eb623"
/>

`gopls` reports `expected ';', found 'EOF'` at `(0,0)..(0,0)` for the
empty file. The diagnostic message is present in both builds; only the
patched build paints the point squiggle.

Sticky-header behavior was also verified with a deterministic stdio LSP.
Before/after recordings are included in the review response below.

## Validation

- `cargo test -p editor point_diagnostic`
- `cargo test -p editor test_point_diagnostic_stays_in_edited_excerpt`
- `cargo test -p editor
test_point_diagnostics_follow_expanded_deletions`
- `cargo test -p project test_empty_diagnostic_ranges`
- `cargo test -p project test_diagnostic_range_spanning_line_terminator`
- `cargo fmt --all -- --check`
- `CCACHE_TEMPDIR=/tmp/zed-ccache-tmp ./script/clippy -p editor -p gpui
-p multi_buffer -p project`
- `git diff --check`
- Manual before/after verification with gopls on an empty Go file
- Manual before/after verification of a retained point diagnostic in a
sticky header
- Manual Fedora verification of physical overlap handling with
`.ZedMono` and proportional Jomolhari text

Regression coverage also includes retained point diagnostics across
edited excerpt boundaries and expanded deleted diff hunks at the
beginning, middle, and EOF, including an empty live buffer, plus
painted-span severity arbitration for point-vs-range and point-vs-point
overlaps.

Release Notes:

- Fixed missing editor underlines for language server diagnostics at
positions without underlying text.
- [GPUI] N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-09-16 16:04:28 +00:00
Ibrahim KhanandKirill Bulatov c6124d3525 editor: Expand excerpts from deleted diff hunks (#63946)
# Objective

Fixes #62278.

Allow `editor: expand excerpts` from deleted text in unified diffs.

## Solution

- Resolve cursor and selection ranges against the current snapshot,
including deleted hunks.
- Preserve half-open selection boundaries and include trailing empty
excerpts at EOF.
- Skip removed paths during expansion.

## Testing

Regression coverage includes deleted-hunk cursors and selections, stale
paths, selections ending at excerpt boundaries, and trailing empty
excerpts. The boundary and EOF cases cover all three expansion
directions. The Bookmarks action case uses `excerpt_context_lines: 0`.

The new boundary and EOF regressions failed before the fix and passed
afterward.

- `cargo test --locked -p editor -p multi_buffer --lib`: 1026 editor
tests and 67 multibuffer tests passed; 1 ignored.
- `./script/clippy -p editor -p multi_buffer`: passed.
- `cargo fmt --all -- --check`: passed.
- `git diff --check origin/main..HEAD`: passed.

Automated testing ran on Linux. The first full run hit a SQLite table
lock in `persistence::tests::test_save_and_get_serialized_editor`. The
isolated test and full rerun passed.

## Self-Review Checklist:

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

Release Notes:

- Fixed excerpt expansion when the selection is on deleted text in
unified diffs

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-16 16:04:24 +00:00
Vitalii ShevtsovandKirill Bulatov 59adbbe8b9 editor: Honor lsp_results_location on cmd-click (#64039)
# Objective

Fixes #62916.

With `"lsp_results_location": "picker"`, `cmd-b` opens the LSP locations
picker but cmd-clicking the same symbol still opens a `Definitions for
…` multibuffer. #61187 fixed this for the go-to-definition *fallback*;
the definition path itself was left behind.

The setting is only consulted by `handle_nav_action` in `lsp_locations`,
which runs when one of the navigation *actions* is dispatched. Cmd-click
never dispatches them: `cmd_click_reveal_task` either navigates the
cached hover links itself, or calls `go_to_definition_of_kind` /
`go_to_type_definition` directly.

## Solution

Both cmd-click paths now dispatch the matching action (`GoToDefinition`,
`GoToTypeDefinition`, …) when `lsp_results_location` is `picker` and the
click is not a split one, so the picker gets its chance; everything else
is untouched:

- with the default `multi_buffer` setting `picker_action` returns `None`
and the old code runs unchanged;
- alt (split) clicks keep their current behavior, since the split
actions have no picker handler;
- URL and file links keep opening directly — the action is only
dispatched when every resolved link is a `HoverLink::Text`.

The dispatch is deferred to after the current editor update via
`cx.spawn_in`: `LspLocationsPicker::open_for_editor` reads the editor,
so dispatching inline panics with `cannot read editor::Editor while it
is already being updated` (this is also why the existing fallback
dispatch happens from a spawn).

## Testing

`cargo test -p lsp_locations` — two new tests, one per cmd-click path: a
cold cmd-click, and a cmd-click on a link already resolved by hovering
with the modifier held (the path users actually hit). Both fail on
`main` with the fix reverted and pass with it.

Also ran `cargo test -p editor --lib hover` (68 passed) and `cargo
clippy -p editor -p lsp_locations --all-targets`.

Not yet verified by hand in a running Zed build — the automated tests
above are what backs this.

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

- Fixed cmd-click on a symbol ignoring the `lsp_results_location`
setting: with `"picker"` it opened a definitions multibuffer instead of
the picker that `cmd-b` opens
([#62916](https://github.com/zed-industries/zed/issues/62916)).

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-16 16:04:13 +00:00
Jack Walters 52e0b848da 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] 06e889c439 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 67ebcd9517 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 9930d2c2a3 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 dc339e4f43 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 (01c555b435): 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 b0f53ad23b 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 f0fb48c71a 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 0968dc6070 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] b0db83272f 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 2328e18cac 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 f6838a7c4a 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 e4d73588dc 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 3c82de747d 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 5c9efb75cf 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
53fcf4be37 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 fe1dd2d375 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 95c0d74be9 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
55a43c22fd 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 0e7972f38e 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 5f1a6530e9 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 de2c85f255 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 739fdbef76 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 c2451489b7 xtask: Add method for walking the GPUI crate graph (#64247)
Release Notes:

- N/A
2026-09-15 22:26:40 +00:00
Cole Miller 46ee98a8e0 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 f092e5e9af 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 a0f8fa7bdb 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 01c555b435 Revert "Implement inspector flag (#62920)" (#64248)
This reverts commit 91bf967e27.

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 763924c285 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 db7f9ceed7 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