Commit Graph

5049 Commits

Author SHA1 Message Date
Oleksandr Kholiavko 3fec483014 tabular_data_preview: Single-cell focus and arrow navigation with reveal (1/8) (#64916)
## Overview

Part **1 of 8** in a series adding full keyboard/mouse navigation, cell
selection, multi-format clipboard copying, and keyboard-driven
sorting/filtering to `tabular_data_preview`.

Split into small, isolated PRs for review safety. The feature is gated
to debug/test builds (`cfg!(any(test, debug_assertions))`) until PR 6
(copying + context menus) to avoid exposing selection without copy
support.

---

### Full Series Roadmap

**1/8 (This PR):** Single-cell focus & arrow navigation with viewport
reveal
**2/8:** Range selection (`Shift+Arrows`), edge jumps
(`Cmd/Ctrl+Arrows`, `Home/End`), and page jumps (`PageUp/Down`)
**3/8:** Mouse selection, Shift+Click extension, and drag-to-select
**4/8:** Select All (`Cmd/Ctrl+A`) across datasets
**5/8:** Multi-format copy engine (TSV, CSV, Markdown, JSON Lines) &
`CopySelected`
**6/8:** Context menu, copy format settings, toasts, and release
enablement
**7/8:** Row selection via row gutter click/drag
**8/8:** Keyboard sorting (`Alt+S`), filter popover (`Alt+F`), and
filter clear (`Cmd/Ctrl+Alt+Backspace`)


NOTE, that all work is done & running on my machine end to end. The
split is just code review organization buerocracy.

<summary>
👇 Demo of fully ready feature👇 
</summary>
<details>


https://github.com/user-attachments/assets/696554f9-ca3e-4b74-83d1-948292668334



https://github.com/user-attachments/assets/5ef5f1f1-4f15-4b01-b825-de592d8a1972



https://github.com/user-attachments/assets/40c0e57f-da7a-440a-9ee6-48af8abe116e


</details>

---

### Changes in this PR (1/8)

1. **Data-Space Coordinates (`CellSelection`):** Coordinates anchor to
`DataCellId { row: DataRow, col: AnyColumn }` so selection survives
background sorting/filtering without shifting rows.
2. **Single-Cell Navigation (`tabular_data::MoveFocusedCell`):** Arrow
navigation (`Up`/`Down`/`Left`/`Right`), initializing focus at `(0, 0)`
on first movement.
3. **Viewport Auto-Scroll & Peek Cushion:** Auto-scrolls focused cells
with a 20px horizontal peek buffer and 1-row vertical context cushion.
4. **Focus & Outline:** Renders focused cell border
(`theme.colors().border_focused`) and binds `"context": "TableView"`.
5. **Debug Gating:** Hidden in release builds via
`is_selection_enabled()` until copying lands in PR 6.

---

Release Notes:

- N/A

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-10-03 01:03:39 +00:00
Cameron Mcloughlin f37989fbdf gpui: Cross-platform headless windowing API and linux impl (#64969)
Adds a cross-platform API for GPUI apps to switch between windowed and
headless modes.

Release Notes:

- N/A
- [GPUI]: N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2026-10-02 16:04:33 +00:00
Finn Evers 9dd6993e2e gpui_shared_string: Avoid intermediate string allocation when deserializing a SharedString (#65089)
## Summary

This PR improves how we deserialize SharedStrings. Since we moved to
`SmolStr` under the hood some time ago, which takes a string by `impl
AsRef<str>` in its constructor, we can get rid here of allocating a
string where possible in favor of using a stringvisitor during
deserialization. This provides us with some decent improvements.

## Testing

The benchmark results are the following:

| Case | `from_str` before | `from_str` after | Δ | 
|---|---:|---:|---:|
| short (≤23 B, inline) | 23.1 µs | 11.6 µs | −50% 
| short, escaped | 33.2 µs | 22.4 µs | −32% | 
| long (~66 B, heap) | 46.9 µs | 31.4 µs | −33% | 
| long, escaped | 307.6 µs | 267.6 µs | −13% | 

## Self-review

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

Release Notes:

- N/A
- [GPUI] Improved memory usage and performance when deserializing
SharedStrings.
2026-10-02 13:48:20 +00:00
Bennet Bo Fenner 309f91f564 copilot: Move enterprise URI to top-level setting (#65082)
This PR is moving the `enterprise` URI to a top level `copilot` settings
because it is used for both Edit Predictions and Copilot Chat.
Previously it was listed under `languages > copilot > enterprise_uri`

Release Notes:

- N/A
2026-10-02 11:22:04 +00:00
Anthony Eid cd4fc8de4c gpui: Journal platform frame requests and skipped frames (#64958)
## Summary

Pass captured platform frame request timing to `on_request_frame` and
emit foreground journal records. This PR provides timing data; it does
not classify platform waits or change latency histogram/reporting
policy.

`RequestFrameOptions` carries an optional captured time and a
native-callback/local-schedule source. A per-window atomic preserves the
earliest coalesced request timestamp and its matching source until
main-thread delivery. Journal records include window identity, captured
time when available, foreground handling time, and source. No request
IDs or second journal stream are introduced.

## Completed frame skips (retained for review)

Keep completed GPUI decisions not to render as sealing boundaries, with
no-render-needed, inactive-throttle, and thermal-throttle reasons. They
seal at foreground completion without satisfying or clearing pending
demand. Hang serialization uses `sealed_by: "frame_skipped"`.

Platform frame requests do not seal or count as foreground work.
Reentrant deferrals remain non-sealing raw diagnostic records with their
own window/time payload; they cannot be represented as completed skip
reasons or sealing skip boundaries. Raw point diagnostics are not copied
into snapshots. Hang qualification still uses foreground execution
durations and occupancy; infinite foreground hang detection remains
follow-up work.

The skip-sealing portion is intentionally retained for review and can be
split out if requested. The signal-to-present histogram, refresh
estimation, platform-wait filtering, and Frame Duration Report changes
are deferred. The complete prior checkpoint is preserved on
`platform-frame-latency-followup`; it is not a second PR yet.

## Platform sources

- **macOS:** CoreVideo’s supplied current host timestamp is converted to
an `Instant` using paired host-clock/local-clock samples, with
receipt-time fallback for invalid timestamps. Capture happens before
registry locking/coalescing; synchronous `displayLayer` and key-window
draws use call time. `WindowFrameSource::stop()` clears stale signals
after detaching the subscription.
- **Windows:** VSyncProvider time immediately after waiting, before
redraw invalidation. Compositor-paced waits are tagged `NativeCallback`;
failed or short waits followed by the existing fallback sleep are tagged
`LocalSchedule`. Coalescing retains the earliest timestamp and its
matching source together; hidden/minimized slots are cleared. Wait and
redraw behavior are unchanged.
- **Wayland:** compositor milliseconds converted against CLOCK_MONOTONIC
with wrapping subtraction and a 60-second plausibility bound;
receipt-time fallback. Demand pings retain enqueue time; retries retain
scheduled deadlines.
- **X11:** scheduled calloop refresh deadline; expose requests have no
captured time.
- **Web:** no captured timestamp yet, but requests are still journaled
with foreground handling time.

Captured-time option fields remain available regardless of the profiler
feature so independently featured backends share one API shape. Built-in
backends collect timestamps only with `gpui/profiler`: disabled capture
does not evaluate clock/conversion closures, the accumulator has no
timestamp storage or atomic operations, and callback delivery and actual
scheduling clocks remain unchanged.

Wayland's protocol does not guarantee the clock epoch. Windows fully
covered-window behavior and X11 compositor gating beyond the timer
remain limitations of these sources. Live compositor/display-off/lock
workflows remain unverified. Skip-boundary changes touch `journal.rs`
and `hang.rs`. This PR will merge before the parallel hang-watchdog
work; that follow-up PR will resolve its conflicts against these
changes.

## Verification

Latest feature-gating checks: the profiler-disabled capture regression
passed; enabled coalescing and window integration tests passed; macOS
and GPUI/Web Wasm compiled with profiling both disabled and enabled. An
optimized probe built from the shared implementation confirmed disabled
capture/accumulator paths contain no calls or atomic instructions.
Clippy, formatting, and whitespace checks passed. Latest-head CI passed
Linux, Windows, and macOS tests and Clippy, along with Wasm and style
checks.

Latest type/guard cleanup: seven focused journal, hang, and window tests
passed, along with the profiler-disabled GPUI library check, Clippy,
formatting, and whitespace checks. The consecutive profiler guards are
grouped without shortening the foreground-turn guard lifetime.

- Previous extracted checkpoint: `cargo test -p gpui --features profiler
--lib -- --test-threads=1`: **431 passed**.
- Focused TestPlatform tests exercise request/source emission and
pending demand surviving throttling, observing callback execution and
draw counts. No wall-clock sleeps are used by the new window tests.
- `corgi check -p gpui_macos --lib`: passed.
- `./script/clippy -p gpui -p gpui_macos -p input_latency_ui`: passed,
including repository hygiene checks.
- GPUI + Web Wasm check with profiler and repository CI
build-std/atomics flags: passed.
- Formatting and `git diff --check`: passed.

Corgi's parallel suite passed 436 of 437 tests but encountered the
previously observed hang-monitor shutdown channel timing failure. That
test passed in the serial Cargo suite and was not changed or disabled.

The preceding checkpoint passed Linux, Windows, macOS, and Wasm CI. CI
also passed on the current head, `3641f14ab0`. Local cross-target checks
remain constrained by missing Linux system libraries and Windows SDK
tooling on the macOS host.

## Suggested .rules additions

When manually driving platform frame requests in GPUI tests, account for
test-mode automatic draws during effect flushing. For throttle-routing
tests, configure a comfortably long throttle interval instead of relying
on wall-clock sleeps or short scheduling deadlines.

Release Notes:

- [GPUI] Added captured platform frame request timing and foreground
journal records, including sealing boundaries for completed decisions
not to render.
2026-10-01 19:52:10 +00:00
Finn Evers 06afd454ec Remove leftover code from agent server extensions (#65031)
## Summary

This PR removes some leftover code from agent extensions that is no
longer in use.

Release Notes:

- N/A
2026-10-01 11:53:36 +00:00
Anthony Eid 40180d9c40 gpui_apple: Share dispatcher and Metal renderer with iOS (#64990)
Prepares GPUI's shared Apple code for the upcoming iOS backend. macOS
behavior is unchanged except for the test-only screenshot path noted
below.

## Changes

- **Dispatcher:** moves `MacDispatcher` from `gpui_macos` into
`gpui_apple` as `AppleDispatcher`, and `MacActivity` as `AppleActivity`.
`is_main_thread` uses the typed `NSThread::isMainThread_class()` instead
of a raw `msg_send`. `gpui_macos` drops its now-unused `async-task`,
`libc`, and `mach2` dependencies.
- **Metal renderer:**
- Adds a safe `MetalRenderer::from_layer(&CAMetalLayer)` for layers
owned by a platform view (UIKit creates a view's backing layer itself).
Layer setup is shared with `new` through `configure_layer`.
- Removes `gpui_apple`'s dependencies on `cocoa` and `objc` 0.2. Layer
setters the `metal` crate doesn't bind now use typed `objc2-quartz-core`
methods; drawable sizing uses `CGSize`.
- iOS always uses shared storage, since managed storage doesn't exist
there (including in the simulator on Intel hosts). The atlas parameter
is renamed `supports_shared_storage` to reflect that.
- `render_scene_to_image` (tests and benchmarks only) now uses shared
storage on Apple Silicon, matching the atlas, and synchronizes whenever
the texture is managed. Intel Macs keep managed textures.
- **Surfaces:** `gpui`'s CoreVideo surface API (`gpui::surface`,
`SurfaceSource::Surface`, `Window::paint_surface`) is now available on
iOS as well as macOS, so the shared renderer no longer needs platform
stubs.
- **Build script:** chooses the Metal SDK from `CARGO_CFG_TARGET_OS` and
`CARGO_CFG_TARGET_ENV` (`macosx`, `iphoneos`, or `iphonesimulator`), so
`x86_64-apple-ios` builds use the simulator SDK. Other targets, such as
Mac Catalyst, fail with a clear error.
- **Cargo:** `gpui_apple` builds for macOS and iOS; `dispatch2` and
`objc2-quartz-core` become workspace dependencies.

## Verification

- `clippy` is clean and tests pass for `gpui`, `gpui_apple`,
`gpui_macos`, and `gpui_platform` on macOS; `gpui_macos` builds with
`runtime_shaders`.
- `cargo clippy -p gpui -p gpui_apple` is clean for
`aarch64-apple-ios-sim` and `x86_64-apple-ios`, including the Metal
shader build with the simulator SDK.
- Not verified at runtime on iOS; nothing on iOS uses these APIs until
the iOS backend lands.

Release Notes:

- [GPUI] Improved the shared Apple Metal renderer and dispatcher so they
can be used by an iOS backend, and made CoreVideo surfaces available on
iOS
2026-09-30 22:13:38 +00:00
Kirill Bulatov 8bbcd83968 Speed up project search over misclassified binary files (#64549)
Based on
https://github.com/zed-industries/zed/issues/38799#issuecomment-5758593194
finding.

Project search treated any NUL-free file as text, then read it whole,
ran chardetng over every byte (~34 MiB/s) and decoded it into a String
before searching. For raw assets (.yuv/.raw/.onnx/.glb/.tif in #38799)
that cost ~8 s and ~2.6× the file size in RAM per worker.

- Bound chardetng to a 1 MiB window starting at the first non-ASCII
byte.
- Stream-decode legacy/UTF-16 files in project search (`DecodingReader`)
instead of materializing them.
- Scan the single-line text pre-filter in 64 KiB blocks instead of
`read_line`.
- Run the control-byte check even without NULs; treat all high bytes as
text so legacy encodings (windows-1251, GBK, ...) stay text.
- Add magic numbers for TIFF, glTF, ELF, Mach-O, gzip/xz/zstd, SQLite,
HDF5, NumPy, safetensors, GGUF, fonts, media containers and others.
- Move the classifier into a `file_content` crate and use it for git
commit blobs too, replacing the separate NUL-only `is_binary_content`.

Measured on a 200 MiB NUL-free raw file: 8.5 s → ~1.5 s per file, no
whole-file allocation.

Release Notes:

- Improved project search speed and memory usage over misclassified
binary files
2026-09-30 17:39:08 +00:00
zed-zippy[bot] e91af043a2 Bump Zed to v1.24.0 (#64991)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
2026-09-30 16:03:44 +00:00
Ben Brandt e8c6c67fad agent_servers: Decode v2 terminal notifications (#64985)
Add a composable SDK v2 terminal-notification ingress component that
hands decoded updates to the existing shared terminal model.

- Decode output snapshots and each output chunk independently into raw
bytes, preserving split ANSI/UTF-8 sequences and arbitrary binary data.
Do not concatenate encoded chunks or introduce another output-history
store.
- Preserve omitted/null/value patch semantics and keep
notification-envelope, terminal, snapshot, exit, and chunk metadata in
their own scopes.
- Validate output before dispatch: malformed base64 or malformed
non-null snapshot shapes cannot apply sibling fields or create an unseen
terminal. Guard the SDK's malformed-output-to-`Undefined` normalization
explicitly.
- Sanitize SDK parse errors so warning logs do not echo complete
notification params.
- Claim only terminal updates/chunks. Forward other methods and update
kinds using the original untyped JSON, preserving unknown fields.
- Apply decoded updates only to a matching session, using the terminal
identity/replacement boundary from #64976.

## Review guide

1. [SDK handler and claiming/forwarding
boundary](https://github.com/zed-industries/zed/blob/b8578a587d8003606579900a692c16fe42776516/crates/agent_servers/src/acp.rs#L636-L674):
terminal-only recognition, original-message fallthrough, and error
propagation.
2. [Decoded notification/application
types](https://github.com/zed-industries/zed/blob/b8578a587d8003606579900a692c16fe42776516/crates/agent_servers/src/acp/terminal_updates.rs#L8-L44)
and
[parser/decoder](https://github.com/zed-industries/zed/blob/b8578a587d8003606579900a692c16fe42776516/crates/agent_servers/src/acp/terminal_updates.rs#L47-L113):
session isolation, byte decoding, tri-state fields, metadata scopes, and
sanitized errors.
3. [Real SDK-channel harness and
tests](https://github.com/zed-industries/zed/blob/b8578a587d8003606579900a692c16fe42776516/crates/agent_servers/src/acp.rs#L2627-L3190):
actual v2 initialization, SDK-receive plus foreground-application
barriers, reference-first ordering, snapshot/append/replacement/clear,
atomic invalid-input rejection, and exact JSON forwarding.
4. [Decoder/parser
fixtures](https://github.com/zed-industries/zed/blob/b8578a587d8003606579900a692c16fe42776516/crates/agent_servers/src/acp/terminal_updates.rs#L115):
absent/null/value, byte fidelity, independent chunks, and
private-payload error sanitization.

Release Notes:

- N/A
2026-09-30 14:31:57 +00:00
Danilo Leal 749a1df41d Add announcement banner for Delta (#64963)
## Summary

This PR introduces an announcement banner for Delta that will be shown
in the next Zed release.

## Self-review

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

Release Notes:

- N/A
2026-09-30 12:03:51 +00:00
Ben Brandt afecd6d719 node_runtime: Expose standalone system Node discovery (#64928)
Expose `SystemNode::discover` so callers can locate and validate Node
without also requiring npm or initializing Zed's cache. It accepts a
configured executable or an explicit search PATH, preserves the Node 22
minimum, and reports typed lookup, execution, and version errors with
guidance.

Zed's existing system runtime reuses the validation before its existing
npm setup. Configured overrides and PATH order remain authoritative.
Selected paths are made absolute without resolving symlinks, and
absolute executables remain usable after the process's working directory
is removed. Managed downloads and npm policy are unchanged.

Release Notes:

- N/A
2026-09-30 04:51:51 +00:00
Anthony Eid 0f9c923e67 Add a GPUI-owned hang monitor and make hang_telemetry a consumer (#64944)
## Summary

Zed and Delta each run their own hang-detection thread, thresholds,
batching and "Hang Incidents" wire schema; Delta's copy predates the
`hang_telemetry` extraction (#64874). This PR is the first step toward
one shared system that any GPUI app can use, and the place the upcoming
watchdog and stall classification will land once.

- **gpui:** adds `App::start_hang_monitor(HangMonitorConfig, on_poll)`.
GPUI spawns and owns a thread that polls the app's `HangDetector` every
`config.interval` and calls `on_poll` with a `HangMonitorPoll`
(incidents, first-present time, and whether it was an `Interval` or
`Flush` poll). When the app shuts down, GPUI requests a final `Flush`
poll without blocking and awaits it alongside the quit handlers, within
`SHUTDOWN_TIMEOUT`. Starting the monitor twice returns
`HangMonitorError::AlreadyStarted` (and debug-asserts); a thread spawn
failure returns `HangMonitorError::Spawn`. Not available on wasm.
- **`hang_telemetry`:** now a pure consumer of that API.
`HangTelemetry::new(startup, send_event).start(cx)` batches incidents
from polls and sends a batch every 30 minutes (including empty batches)
and on the shutdown flush. `with_incident_observer` receives each poll's
serialized incidents, for Delta's feedback-report hang list. The crate
owns no threads or quit handlers. Thresholds, the reporter and the wire
schema are unchanged.
- **Zed:** hang telemetry is `HangTelemetry::new(..).start(cx)` plus an
`on_app_quit` that flushes the telemetry queue. The legacy log and
task-trace loop keeps its own thread, renamed `HangLogging`. The unused
`spin` dependency is removed.

Behavior is unchanged except that the journal is first polled 1 s after
startup rather than 1.2 s (the 200 ms delay remains on the legacy log
loop it was written for).

Follow-ups: migrate Delta onto `hang_telemetry`; add the watchdog
(freeze detection, CPU-time stall classification) to the GPUI hang
monitor; share crash-report uploading in a separate PR.

## Testing

- New tests: `hang_monitor_polls_on_its_interval_and_on_flush`,
`app_flushes_its_hang_monitor_on_shutdown`,
`starting_the_hang_monitor_twice_is_rejected` (also run in release).
- `cargo test -p gpui --features profiler --lib -- profiler::` (58
passed), `cargo test -p hang_telemetry` (4 passed), `cargo check -p
zed`, wasm32 check of gpui, and `./script/clippy -p gpui -p
hang_telemetry -p zed` are clean.

Release Notes:

- [GPUI] Added `App::start_hang_monitor`, which polls the hang detector
on a GPUI-owned thread so hang detection keeps running while the
foreground is stalled, with a final flush on shutdown

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Eric Holk <eric@zed.dev>
2026-09-29 20:19:48 +00:00
Anthony Eid 7232ba04ef gpui: Drop foreground measurements that span an unnotified system suspend (#64891)
## Summary

Hang telemetry still reports foreground task polls lasting minutes to
hours, mostly on Windows. #64269 drops measurements interrupted by
sleep, but it relies on power notifications. Those are delivered on the
foreground thread, so when the system suspends mid-poll, the poll
finishes and is recorded *before* the notification is handled. On
Windows the notification can also be dropped. The Windows clock behind
`Instant` (QPC) keeps counting through sleep, so one missed ordering
becomes an hours-long "stall".

This change makes each measurement check a suspend clock, with no
dependence on notification ordering.

## How it works

- `system_suspended_time()` returns total time suspended since boot, as
the difference between a clock that counts suspended time and one that
doesn't. Every read is served from kernel-mapped memory, with no syscall
on the normal path:
  - **Linux/Android:** `CLOCK_BOOTTIME − CLOCK_MONOTONIC`
- **macOS:** `mach_continuous_time() − mach_absolute_time()`
(`<mach/mach_time.h>` documents the former as "like mach_absolute_time,
but advances during sleep"), converted with a cached
`mach_timebase_info`. Measured at ~4 ns per read on Apple silicon.
  - **Windows:** `QueryInterruptTime − QueryUnbiasedInterruptTime`
- **Other platforms:** `None`, which keeps the notification-only
behavior.
- `detect_suspend` runs at the start of each foreground turn (before the
turn's work takes its start time, so a suspend while idle never drops
later work) and wherever a measurement ends (task poll end,
`power_interrupted_since`, `frame_sample_is_valid`). If suspended time
grew by at least 50 ms (`MIN_DETECTED_SUSPEND`, above Windows'
up-to-15.6 ms tick jitter), it runs the same `interrupt_measurements`
routine a power notification runs:
- seals the open interval with a `PowerTransition` boundary, so earlier
small work can't add up to a budget incident across the suspend;
- sets `power_changed_at`, so any measurement that started before it is
dropped;
  - clears pending `dirty_at` for each window.
- Handling a power notification refreshes the stored reading, so a
notified suspend isn't counted twice.
- Measurements that span a suspend are dropped rather than corrected: on
Linux, process freeze and thaw around the suspend add seconds that no
clock excludes.

`MEASUREMENT_VERSION` stays at 2; it will be bumped once alongside the
planned schema changes.

Dependencies: `gpui` gains a direct `libc` dependency on Linux/Android
only (it was already in the build graph through 15+ dependencies at the
same version), and the `Win32_System_WindowsProgramming` feature of the
existing `windows` dependency. The macOS mach functions are declared in
a small `extern "C"` block because libc deprecates its mach bindings.

## Not covered

- Freezes where the system stays awake (debugger, SIGSTOP, cgroup
freezer) and genuinely blocked polls. A follow-up watchdog will classify
these.
- Hangs that never complete.

## Testing

- New tests: a poll spanning an un-notified suspend is dropped, a
boundary is emitted, and the pending frame is cleared; notified suspends
and sub-threshold jitter do not interrupt. Journals installed by tests
use a fake suspend clock, so a real suspend during a test run can't
affect results.
- `cargo test -p gpui --features profiler --lib -- profiler::`: 55
passed. `./script/clippy -p gpui --features profiler` and `cargo fmt`
are clean. `cargo check` passes for `x86_64-unknown-linux-gnu` and
`x86_64-pc-windows-msvc`.
- Manual test on macOS (Apple silicon, debug build) with a temporary
action that blocks the foreground executor for 60 s:
- Control, no sleep: a `Threshold` incident of ~10,000 ms is reported
for a 10 s block.
- Lid closed during the 60 s block: `pmset -g log` shows Clamshell Sleep
at 10:32:27 and wake at 10:34:01. The block ended at 10:34:17 (144 s
wall clock), the suspend clock detected 84.2 s suspended, and **no**
hang incident was reported for the block.
- Note: macOS delays sleep for up to 30 s while an
`NSWorkspaceWillSleepNotification` observer is blocked (`pmset` logged
`zed timed out(30000 ms)`), so on macOS only polls longer than ~30 s can
span a suspend. Windows and Linux are not yet manually tested.

Release Notes:

- [GPUI] Improved hang telemetry accuracy by dropping foreground
measurements that span a system suspend, even when the platform's sleep
notification arrives late or not at all
2026-09-29 16:23:47 +00:00
Quinn Shanahan c87632ef44 Read remote shell config when creating a terminal shell (#61451)
# Objective

- Makes shell for remote configurable.
- fixes #35226 

## Solution

- Adds rpc so client can retrieve terminal settings from remote server
- Vibe coded with codex Sol, I did my best to review it and make sure
it's the minimal changes.
- Added terminal dependency to remote_server, rather than a larger
change (e.g. adding something to project to expose terminal shell
setting to remote_server)

## Testing

- Tested and works Windows client / linux remote server

## Self-Review Checklist:

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


---

Release Notes:

- Added support for terminal.shell in remote sessions

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-09-29 13:38:22 +00:00
Joep Joosten 12f79c0aeb cloud_api_client: Use the platform TLS verifier for the cloud websocket (#63686)
# Objective

Fixes #63683

Behind a corporate TLS-inspecting proxy (e.g. Zscaler) whose root CA is
installed in the OS trust store, the Zed Cloud websocket fails
permanently with `invalid peer certificate: UnknownIssuer`, while every
other connection in Zed works.

`crates/cloud_api_client/src/websocket/native.rs` calls
`yawc::WebSocket::connect` without a TLS connector. yawc's default
connector trusts only the bundled `webpki-roots`, so it never consults
the platform trust store. Everything else in Zed (the reqwest HTTP
client and the collab websocket in `crates/client`) uses
`http_client_tls::tls_config()`, which is built on
`rustls-platform-verifier`.

## Solution

Pass a `tokio_rustls::TlsConnector` built from
`http_client_tls::tls_config()` to yawc via
`WebSocketBuilder::with_connector`, so the cloud websocket verifies
certificates exactly like the collab websocket does
(`client_async_tls_with_connector_and_config(...,
Some(Arc::new(http_client_tls::tls_config()).into()), ...)`).

`cloud_api_client` gains two non-wasm dependencies: `http_client_tls`
(workspace crate) and `tokio-rustls` (same `0.26` line yawc and `client`
already use, no default features).

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

https://claude.ai/code/session_01Ub1SNsrgWjTA6iAKanKfwt

## Testing

- `cargo check -p cloud_api_client` and `cargo fmt --check` on macOS
(arm64).
- Reproduced the bug and validated the approach with a standalone rustls
probe against `cloud.zed.dev` / `collab.zed.dev` from behind Zscaler:
- `webpki_roots::TLS_SERVER_ROOTS` only (yawc's default):
`InvalidCertificate(UnknownIssuer)` – identical to the error in the Zed
log
- `ClientConfig::with_platform_verifier()` (what `tls_config()`
returns): connects fine
- Reviewers behind a TLS-inspecting proxy can confirm by watching
`~/Library/Logs/Zed/Zed.log` for `cloud websocket connect failed:
invalid peer certificate: UnknownIssuer` before and after.
- I could not test on Windows or Linux, but the change only routes the
cloud websocket through the same `tls_config()` those platforms already
use for all other HTTPS traffic.

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

Release Notes:

- Fixed the Zed Cloud connection failing with `UnknownIssuer` behind
corporate TLS-inspecting proxies whose root CA is installed in the
system trust store.

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Finn Evers <finn@zed.dev>
2026-09-29 10:23:00 +00:00
Conrad Irwin dd510f99e0 language_models_cloud: Classify LLM token failures as provider rejections (#64754)
`CloudLlmTokenProvider` returned `anyhow::Result`, and
`authenticated_llm_request` reported every failure, including failing to
mint an LLM token, as `LanguageModelCompletionError::HttpSend`. An
expired session (401) or a missing subscription (402) during token
minting therefore looked like a connectivity problem: the agent panel
showed a stream error, and retry logic treated it as transient.
Downstream consumers (Delta) had to dig typed errors back out of the
`anyhow` chain to recover the real cause.

This PR:

- Changes `CloudLlmTokenProvider::cached_token`/`refresh_token` to
return `Result<String, ClientApiError>`, and
`Client::{cached,refresh,clear_and_refresh}_llm_token` to match.
- Adds `LlmRequestError`, returned by `authenticated_llm_request`, which
separates token acquisition failures from building or sending the
request.
- Adds `LlmRequestError::into_completion_error`, which maps:
- `Unauthorized`/`NotSignedIn` to a Zed `Authentication` rejection (not
retried),
  - a token-endpoint 402 to the existing `PaymentRequired` rejection,
- other token-endpoint statuses by HTTP status (for example 403 to
`Permission`, 5xx to retryable `InternalServer`),
  - connection failures and send failures to `HttpSend`, as before.

In Zed, a token failure caused by an expired session now shows the agent
panel's authentication error instead of a stream error. Messages stay
neutral about whose credentials were rejected so callers can choose
wording from the category.

Release Notes:

- Improved the agent panel error shown when a Zed sign-in has expired.
2026-09-28 19:11:12 +00:00
Anthony Eid 3135cdf8dc gpui: Add randomized element tree benchmarks and fix Linux benchmark leaks (#64842)
Adds a seeded, randomized element tree for benchmarking GPUI rendering,
and a Criterion suite that measures what one frame costs under each
class of change. Running it on Linux exposed thread leaks in the
benchmark harness and in the Linux dispatcher that made every
`#[gpui::bench]` binary slow down as it ran; those are fixed here too.

## Randomized element tree (`gpui::randomized_element_tree`, behind
`bench-support`)

A tree of elements and entities generated from a `StdRng`, with wide,
deep, mixed and narrow topologies, entity-backed elements, and
interaction handlers. It supports the mutations a UI goes through (child
color and bounds, root bounds, insert, leaf removal, reorder, recoloring
a share of the tree either localized to one entity subtree or spread
out) and counts what re-rendered, so benchmarks can assert the renderer
did the work. `RandomizedElementTreeBounds` describes a family of trees
(topologies, element-count and density ranges) and `sample(&mut rng)`
draws one.

## Benchmarks (`gpui_platform/benches/randomized_element_tree.rs`)

Groups, each measuring frames in which exactly one thing happens: full
refresh (`Window::refresh`), unchanged (a notified root), leaf style,
leaf bounds, root layout, insert-remove, reorder, and a changing-share
grid (0/1/5/25/100% localized, 5/25% spread).

- **Families:** `any`, `wide`, `tall`, `mixed` and `dense-entities`,
each with at least 5% entities. Each family is a `#[gpui::bench]` input
seeded through the `StdRng` support from #64843, so ids read
`RandomizedTree/<group>/tree/<family>/seed-<n>` and `SEED`/`ITERATIONS`
choose trees as they choose `#[gpui::test]` seeds. The family name is
mixed into the RNG so overlapping families don't draw the same tree at
the same seed.
- **Reports:** each tree is described once with the heap its window
holds after the first frame. The bench report adds instructions,
allocations and frame timings from `bench_metrics`, and a final summary
prints each group and family's geometric mean of time and allocations
per iteration across seeds.
- **Run time:** two seeds per family (one for the changing-share grid)
and a 0.5 s warm-up with a 1 s measurement: 105 benchmarks in about 4.5
minutes on Linux. `ITERATIONS=6`, `--warm-up-time` and
`--measurement-time` give a longer run.
- **Checks:** every measured loop asserts that the tree actually
re-rendered, so a faster frame that skipped the changed element fails
rather than passing as an improvement.

```
cargo bench -p gpui_platform --features bench-support --bench randomized_element_tree [-- FILTER]
```

## Linux fixes for `#[gpui::bench]` and the dispatcher

On Linux the full suite reached thousands of threads and took about 40
minutes, each benchmark slower than the last. Measured frame times are
unchanged by these fixes.

- **A platform per routine call.** `#[gpui::bench]` builds a context for
every Criterion routine call, and each built a whole
`gpui_platform::current_platform(true)` just to take its text system.
`gpui_platform::bench_text_system()` now builds it once per thread.
- **A GPU device per window.** `WgpuHeadlessRenderer::new` created a new
wgpu device each time, about 65 ms per call. `WgpuContext::new_headless`
now shares one device per process, held in a static that is never
dropped (wgpu's queue reads its own thread-locals on drop, so a
thread-local cache aborted on thread exit), and creates a new one if it
is lost. Device errors are tracked per device, so a renderer joining a
shared device observes only errors raised from then on.
- **Dispatcher threads outlived their platform.** Dropping a Linux
platform left all 21 threads running. Workers block in
`PriorityQueueReceiver::recv`, which checked for dropped senders only
before waiting, and dropping the last sender never signalled the
condition variable. It now wakes every waiter (acquiring the queue lock
first so no receiver misses the wake-up), `recv` re-checks after each
wake, and the timer thread's event loop stops when its channel closes. A
regression test fails on the old code and passes with the fix. The
editor builds one platform per process, so it isn't affected in
practice; benchmarks, visual tests, and
`gpui_platform::background_executor()` are.

## Validation

On Linux:
- Full suite: 105 benchmarks in 262 s, none failing, with the thread
count flat (about 63 to 68) and live heap between routine calls flat (6
to 8 MB). Before the fixes: about 40 minutes, 2,315 threads 20 s into a
group.
- One frame per iteration: window draws equal iterations exactly, and
each iteration renders the root once and every element once.
- `gpui` (437, run on one thread, since 4 profiler and `bench_context`
tests share global state and also fail in parallel on `main`) and
`gpui_linux` (42) tests pass; clippy and fmt are clean.

On `main`, every class of change costs about the same as a full refresh,
and the changing-share grid is flat from 1% to 100%, because any notify
re-renders the whole tree. That's the curve retained rendering should
bend.

Release Notes:

- [GPUI] Added randomized element tree benchmarks, and fixed Linux
platform threads not exiting when the platform is dropped and
`#[gpui::bench]` creating a platform and GPU device for every iteration

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2026-09-28 16:17:17 +00:00
Ben Brandt 986828d157 acp_thread: Add shared tool-call state and diff previews (#64875)
Review Thread:
https://delta.dev/trunk/join/thread_01m2swv74pzp4c6xk46sh19fmk#s=pVggqzly

Normalize legacy ACP tool reports and SDK v2 tool patches into one
shared `ToolCall` model, preserving protocol source separately from
local decisions and rendered views.

- Retain reported kind/status, first-class name, metadata, and complete
tool-content sources, including unknown v2 values and envelope metadata.
- Keep authorization ownership and local outcomes separate from reported
status. Support omitted/null/value patches without changing legacy
permission-continuation behavior.
- Preserve the status-before-content-validation contract: invalid
presentation cannot roll back a terminal report or leave its permission
unresolved.
- Render supported v2 patches with read-only diff editors using `diffy`.
Preserve sparse hunk coordinates, multi-file structure,
additions/deletions, and original source without reading or modifying
workspace files. Accept standalone unified patches and unambiguous bare
hunks; retain explicit fallback and export text for unsupported input.
- Keep native live diffs separate from protocol snapshots, preserve
render identity on metadata-only updates, and align patch
expansion/search with visible authorization content.

This adds the shared model and presentation boundary; it does **not**
enable v2 transport negotiation or change prompt lifecycle. Existing
v1/native adapters continue to work. The existing
one-active-authorization-per-tool policy is unchanged.

Release Notes:

- N/A
2026-09-28 15:53:24 +00:00
Finn Evers 447f72e516 xtask: Add validation layer for GPUI commands (#64869)
## Summary

This PR adds a validation step to the GPUI publishing plan, ensuring
that crates there have proper licenses and that we do not face duplicate
crate names (this one is acutally currently violated but something to
fix separately).

Release Notes:

- N/A
2026-09-28 14:38:57 +00:00
Anthony Eid 1b572a2bd0 Extract hang telemetry into a reusable hang_telemetry crate (#64874)
Moves the "Hang Incidents" telemetry pipeline out of the `zed` binary
crate into a new `hang_telemetry` library crate, so other GPUI apps
(Delta) can depend on it instead of keeping a copy of the reporter.
Updating the telemetry schema in Zed then only requires bumping the Zed
dependency in those apps to get the same schema.

The crate owns everything that defines the data:

- `hang_threshold()` and `frame_budget()`, which decide what counts as
an incident
- `HangTelemetry`, which polls a `HangDetector` over the foreground
journal, serializes incidents relative to startup, and batches them
(largest 10 stalls, threshold/budget counts, stall p50/p95/max, 30
minute send interval)
- the event name and property shape, returned as a
`telemetry_events::FlexibleEvent`

Delivery stays with the app: Zed sends the event with
`telemetry::send_event`, while other apps route it through their own
telemetry pipeline. `crates/zed/src/reliability/hang_detection.rs` now
uses the crate; logging, task traces, and the dev hang actions are
unchanged, and the emitted event is identical to before.

Tests covering batching, counter/histogram resets, empty report windows,
and the exact wire shape live in the new crate.

Release Notes:

- N/A

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-09-28 14:27:46 +00:00
Xin Zhao 98f75a23bc Remove some unnecessary dependencies (#64862)
## Summary

Some dependencies were originally introduced for only a few specific
functions that can either be fulfilled by existing dependencies or
easily implemented in-tree. This PR removes or replaces them:

1. `json_dotpath`: Removed. We do not use the dot-path query feature;
standard methods in `serde_json` are sufficient for our use case.
2. `crossbeam`: Replaced with the more lightweight `crossbeam-queue`.
3. `take-until`: Removed. Calls to `take_until` are replaced with
`take_while_inclusive` from `itertools`, which is already widely used in
Zed.
4. `x11-clipboard`: Removed. It is deprecated and was only an unused
entry left in `Cargo.toml`.
5. `portable-pty`: Removed. We only used the `ExitStatus` transformation
logic from this crate, which has now been inlined into the Zed codebase.

Together, these changes reduce the total crate count from 1,727 to 1,717
during a Linux `cargo build`, slightly improving compile times.

## Testing

This is a refactoring PR with no functional changes. Existing tests were
run locally to ensure no regressions were introduced.

## Self-review

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

Release Notes:

- N/A
- [GPUI] N/A
2026-09-28 08:56:15 +00:00
Anthony Eid e683fd7b46 gpui: Add bench_metrics for multi-metric Criterion benchmarks (#64753)
GPUI benchmarks measured only wall time, which is noisy enough on shared
CI runners that a regression must be large before Criterion flags it.
This PR adds a `bench_metrics` crate that records several metrics per
Criterion sample and reports them alongside Criterion's own analysis,
and wires GPUI's benchmark harness to it. Nothing in `bench_metrics`
depends on GPUI, so any Criterion benchmark in the workspace can adopt
it.

**What a benchmark now prints** (Linux, hardware counters available):

```
closed_inspector_grid/case/100-nodes-0-cycles
                        time:   [273.99 µs 274.78 µs 276.04 µs]
GPUI bench report (all observed iterations): closed_inspector_grid/case/100-nodes-0-cycles
  instructions per iteration: median 5.791 M instructions (min 5.788, max 5.880, samples 22)
  foreground instructions per iteration: median 5.791 M instructions (...)
  cycles per iteration: median 1.453 M cycles (...)
  branch misses per iteration: median 1.856 K branch misses (...)
  cache misses per iteration: median 123.008 cache misses (...)
  foreground context switches per iteration: median 0.000 context switches (...)
  page faults per iteration: median 0.000 page faults (...)
  IPC: median 3.996 (min 3.349, max 4.063, samples 22)
  foreground share of instructions: median 1.000 (...)
```

Criterion analyzes one metric (the *primary*; wall time by default) and
the rest are *secondaries* taken over the same iterations.
`BENCH_MEASUREMENT=instructions` makes process-wide retired instructions
the primary, and `BENCH_MEASUREMENT=foreground-instructions` the
benchmark thread's alone; both are near-deterministic, so a ~0.01%
interval is typical and small regressions are detectable, with wall time
demoted to the report. `BENCH_MEASUREMENT=wall-time` disables all
counters. Counters that can't be opened (no `CAP_PERFMON`, Docker
seccomp, VMs without a PMU, Intel Macs) are skipped with one note, so
`cargo bench` never fails by default; the instruction modes fail fast so
CI can't silently measure the wrong thing.

**Sources.** `HardwareCounter` is platform-neutral over per-OS backends.
On Linux it uses `perf_event_open`: counters are opened once per process
with `inherit` so every later thread is covered, read as deltas per
sample (~150 ns per counter), with hybrid-CPU encodings parsed from
sysfs and multiplexing scaled with a one-time warning. On Apple Silicon
it reads `proc_pid_rusage` and `thread_selfcounts`, which are
unprivileged, for instructions and cycles; branch and cache events need
`kperf` and stay Linux-only. `ResourceCounter` reads `getrusage` for
voluntary context switches on the foreground thread (the waits
instructions can't see) and minor page faults, with no privileges.

Foreground-thread instructions are counted separately from the process
total, so work shifting between GPUI's foreground and background threads
is visible even when the total is flat; with a headless renderer the gap
is driver-thread submission work (about 7% of a small Metal frame).

**Design.** `BenchMeasurement` type-erases the primary so
`#[gpui::bench]` functions and `BenchAppContext` need no type parameter;
`with_secondary`/`with_ratio` add metrics; `bench_group!` still
delegates to `criterion_group!`. Plain Criterion benches opt in with a
`config =` line and `MetricReport::iter` (documented in the gpui-bench
skill; wiring `rope` etc. is a follow-up). Reports are now emitted per
input for `inputs = ...` benchmarks, since per-iteration metrics blended
across inputs are meaningless. Criterion is bumped to 0.8.2, which also
randomizes stack alignment per sample.

**Verified** on Linux (hybrid Alder Lake) and an M-series Mac: every
mode on `inspector_render` and `editor_render`; counter denial via
seccomp on Linux; `bench_metrics` and `gpui` `bench_context` tests
including thread-scope inclusion/exclusion through real counters on both
platforms.

**Follow-ups:** counting-allocator metric (peak heap, allocations),
wiring non-GPUI benches, per-secondary baseline comparison.

Release Notes:

- [GPUI] Improved benchmarks to report retired instructions, cycles,
IPC, foreground-thread share, cache and branch misses, context switches,
and page faults per iteration alongside wall time, with
`BENCH_MEASUREMENT=instructions` or `=foreground-instructions` selecting
near-deterministic instruction counts as the Criterion-analyzed metric
for CI regression detection
2026-09-27 17:37:29 +00:00
Kirill Bulatov 4c841aaf1c Remove unused features from dependencies (#64826)
Release Notes:

- N/A
2026-09-27 16:19:10 +00:00
Anthony Eid e91b82c106 gpui_wgpu: Add Linux headless rendering (#64718)
## Summary

Add Linux WGPU headless rendering for GPUI tests and benchmarks without
creating a display surface or window.

- Extract a concrete `WgpuRendererCore` shared by the windowed and
headless wrappers, retaining production pipelines, atlas handling, and
frame encoding.
- Reuse an offscreen render target between same-size frames. Normal
rendering submits GPU work without screenshot readback; image capture
performs aligned readback and returns RGBA pixels.
- Reuse adapter ranking, including the `ZED_DEVICE_ID` preference.
Reject software adapters by default, with an explicit software-allowed
constructor for functional tests.
- Wire Linux platform selection through separate `bench-support` and
`test-support` features. Propagate initialization failures rather than
silently running a benchmark without a renderer.
- Preserve upstream atlas bind-group caching and window lifecycle
behavior.

This is a fresh implementation following discussion of #62341, not a
continuation of that PR. It does not include a Criterion upgrade,
hardware counters, benchmark CI, or GPU timing queries.

## Validation

After merging `origin/main` at `baee1ca6de`:

- `cargo test -p gpui_wgpu` — 38 tests passed.
- `cargo test -p gpui_wgpu --features test-support` — passed.
- `env -u DISPLAY -u WAYLAND_DISPLAY cargo test -p gpui_wgpu
headless_renderer` — passed.
- `cargo check -p gpui_platform --features bench-support` — passed.
- `cargo check -p gpui_platform --features 'test-support,wayland,x11'` —
passed.
- `cargo check -p gpui_wgpu --target wasm32-unknown-unknown` — passed.
- Formatting and diff checks passed.
- Verified the `gpui_wgpu` benchmark feature graph does not enable
`test-support`.

Windowed rendering and device recovery have compile coverage but have
not been manually exercised after the refactor. Headless timings
represent CPU rendering/submission, not display latency or
GPU-completion time.

## Suggested .rules additions

For `gpui_wgpu`: Tests requiring GPUI test contexts must be gated on
`test-support`, rather than enabling that feature unconditionally in a
dev dependency. Cargo unifies dev-dependency features into this crate's
benchmark targets.

Release Notes:

- [GPUI] Added headless renderer support for WGPU on Linux for
benchmarks and testing.
2026-09-25 17:49:48 +00:00
Mikayla Maki 975845875b language_model: Make LanguageModel plain data served by its provider (#64750)
`LanguageModel` used to be a trait object. Each provider implemented it
on a private struct that bundled the model's metadata with the client,
credentials, rate limiter and a snapshot of its config, and consumers
held `Arc<dyn LanguageModel>` or a `ConfiguredModel { provider, model }`
pair.

This makes `LanguageModel` plain data: a `Clone + Debug + PartialEq`
struct with the same getters the trait had, held by value everywhere.
`ConfiguredModel` is gone. Providers serve requests themselves:
`LanguageModelProvider` gains `stream_completion` (plus the text/tool
helpers, `count_input_tokens`, `compact` and `api_key`), each taking
`&LanguageModel`. Senders look the provider up with
`LanguageModelRegistry::provider_for_model` when they send.

Every provider now has one lookup that decides which models it offers
and with what config. `provided_models` and the defaults are built from
it, and each request resolves the model's current config from it by id.
There are no per-model or per-request objects. A model the provider no
longer offers fails with a new, non-retried
`LanguageModelCompletionError::ModelUnavailable` instead of being served
from a stale snapshot.

This prepares for opening provider-side sessions over an append-only
message log. With models as plain data and requests on the provider, a
session can be one generic type rather than one per provider, and
deciding whether a session can be reused becomes a value comparison.

## Suggested reading order

1. `crates/language_model/src/language_model.rs` (the struct and
provider trait), `registry.rs`, and `fake_provider.rs`.
2. One representative provider:
`crates/language_models/src/provider/anthropic.rs`.
3. Providers that deviate: `bedrock.rs`, `llama_cpp.rs`,
`open_router.rs`, `crates/copilot_chat`, `crates/language_models_cloud`,
`crates/openai_subscribed`, `crates/x_ai_subscribed`.
4. Callers: `crates/agent/src/thread.rs`, then `agent_ui`, `git_ui`,
`sidebar`. Most of the remaining diff is tests.

## Behavior changes worth reviewing

- Rate limiting is one concurrency limit per model id, shared across the
app, with a limit of 16. Before, each model instance had its own limit
of 4.
- `Thread::refresh_model` re-selects a thread's model by id when its
provider reports a state change, so capability changes (for example a
llama.cpp model finishing loading) reach the thread.
- Bedrock resolves auth once per request for both Converse and Mantle,
off the foreground thread, with the SDK's default 5s credential load
timeout. Expiring credentials (SSO, STS, credential processes) are
cached until shortly before expiry and dropped on any auth change;
credentials without an expiry are re-read every request, so credential
files rewritten by external tools take effect immediately. Mantle
credential resolution now goes through Zed's HTTP client, like Converse.
- Bedrock honors `AWS_BEARER_TOKEN_BEDROCK`, then `AWS_BEARER_TOKEN`
(even if empty), over AWS credentials unless an API key is configured in
Zed, matching the SDK. This now applies to Mantle too, so users with
IAM/profile auth and one of these variables set must unset it (not empty
it) for Mantle to use IAM/profile.
- A Bedrock Mantle model with the same id as a Converse model replaces
it, so each id is offered and served once.
- OpenRouter and Vercel AI Gateway report default-model metadata from
the same lookup they serve requests from.
- A request for a model that has left a provider's list (for example
after signing out of Copilot or Zed) returns `ModelUnavailable`. Commit
message generation shows this as an error instead of doing nothing.

## Tests

`FakeLanguageModel` is gone. `FakeLanguageModelProvider` serves any
model id and owns every request sent to it; tests answer a request by
naming its model (`send_last_text(&model, ...)`, `send_text(&model,
&request, ...)`), so requests to different models can't be confused.

Tested: `agent` (753 tests), `language_model`, `language_models`,
`language_models_cloud`, `copilot_chat`, `openai_subscribed` and
`x_ai_subscribed`, plus `cargo check --workspace --tests`. The
`agent_ui`, `git_ui` and `sidebar` test binaries type-check but were not
run locally because of a linker issue in my environment; CI will cover
them. Providers have not yet been exercised against live services.

Release Notes:

- N/A
2026-09-25 17:08:34 +00:00
Max Brunsfeld 7fdb97cad5 cloud_api_client: Update yawc to 0.4.2 (#64728)
Moves `cloud_api_client` off the `zed-industries/yawc` fork pin
(`71a452f`) to the upstream crates.io release, `yawc` 0.4.2.

The fork's only commit beyond upstream was an earlier version of a wasm
connect fix. Upstream shipped a more complete fix in 0.4.0
([infinitefield/yawc@f1c6317](https://github.com/infinitefield/yawc/commit/f1c6317eff64a01433aad683280e22ddff4f9c3f)):

- `connect` settles on the browser's `open`, `error`, or `close` event.
- The wasm `WebSocket` owns its event handlers instead of leaking them
with `Closure::forget`.
- `Drop` unregisters the handlers and calls `close()`, including when
the connect future is dropped mid-handshake.

That last point matters for the web Cloud client, which drops a pending
connect after 30 seconds. With the fork, the abandoned browser socket
kept handshaking indefinitely. Delta hit the same leak in its web client
and has already moved to 0.4.2.

The other changes between the fork and 0.4.2 are native-only: opt-in
HTTP/2 WebSockets, SOCKS5 proxy support, and a deflate decompression
fix. The APIs `cloud_api_client` uses are unchanged. The lock file also
picks up `send_wrapper` and bumps `hyper` to 1.11 and `h2` to 0.4.19,
which `yawc` 0.4.2 requires.

Checked with `cargo check -p cloud_api_client` for native and
`wasm32-unknown-unknown`.

Release Notes:

- N/A
2026-09-24 23:32:55 +00:00
Ansh Dawda d528c665e1 Add JSONL and NDJSON support to tabular preview (#64471)
## Objective

Extend the existing tabular preview to support `.jsonl` and `.ndjson`
files, making it easier to compare fields across records.

Discussed in https://github.com/zed-industries/zed/discussions/62917.

## Solution

Parse each nonblank line as a JSON object and reuse the existing table
preview. Top-level keys become columns in first-seen order, with new
keys from later records appended to the right.

- Preserve JSON values, including large numbers, without numeric
conversion.
- Display nested objects and arrays as compact JSON.
- Keep missing fields, `null`, `"null"`, and empty strings distinct.
- Show invalid-record errors with source line numbers and recover after
edits.
- Preserve sorting and filters unless column names or order change.
- Add JSONL/NDJSON to the existing preview shortcuts and document the
behavior.

Also fix a crash found during CSV regression testing: deleting rows
could leave the renderer using an old row mapping against shorter data.
Clear the mapping and virtual list together before recomputing them.

The preview remains read-only, accepts object records only, and uses the
existing text-based sorting and full-file parsing behavior.

## Testing

- All 20 tests in `tabular_data_preview` passed.
- The multiline CSV deletion regression passed across 20 scheduler
seeds.
- `cargo fmt -p tabular_data_preview -- --check` passed.
- `./script/clippy -p tabular_data_preview` passed.
- `cargo build -p zed --bin zed` passed.
- `git diff --check` passed.
- Manual QA on macOS, including retesting the reported CSV crash.

Windows and Linux were not tested locally. Large-file performance has
not been benchmarked.

To try it, open a `.jsonl` or `.ndjson` file and run `tabular data: open
preview` or `tabular data: open preview to the side`.

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

## Showcase

<img width="2358" height="1576" alt="image"
src="https://github.com/user-attachments/assets/8f7e7725-5a5c-465d-aa0a-d61cbb22d04f"
/>

The example shows source-order columns, fields introduced by later
records, nested values, and the distinction between missing values,
nulls, and strings.

Release Notes:

- Added JSONL and NDJSON support to the tabular data preview.

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-09-24 15:04:16 +00:00
Sudarsh 6990d3f678 git_ui: Fix missing language injections in historical file buffer (#64683)
Buffers built for the commit view (git history -> open excerpts) were
assigned a language without attaching the language registry, so injected
grammars (Markdown-Inline, fenced code block languages) could not be
resolved and their captures went unstyled.

Attach the registry before assigning the language, matching the pattern
in text_diff_view.rs, and add a regression test asserting that a buffer
built via build_buffer parses with Markdown-Inline layers.

Fixes #64577 

# Objective

- Describe the objective or issue this PR addresses.
- If you're fixing a specific issue, use "Fixes #X" for each issue as
[described in the GitHub
docs](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).

## Solution

- Describe the solution used to achieve the objective above.

## Testing

- Did you test these changes? If so, how?
- Are there any parts that need more testing?
- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
- 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

> This section is optional. If this PR does not include a visual change
or does not add a new user-facing feature, you can delete this section.

- Help others understand the result of this PR by showcasing your
awesome work!
- If this PR includes a visual change, consider adding a screenshot,
GIF, or video
- A before/after comparison is very useful for changes to existing
features!

While a showcase should aim to be brief and digestible, you can use a
toggleable section to save space on longer showcases:

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

<img width="1170" height="831" alt="image"
src="https://github.com/user-attachments/assets/56d948b0-b9da-42ec-abb2-3b19a7b38948"
/>

</details>

---

Release Notes:

- Fixed syntax highlighting for Markdown emphasis, links, and code
blocks when viewing a file at a historical commit
2026-09-24 13:07:25 +00:00
Bennet Bo Fenner 7fc2cf9b84 opencode: Dynamic model fetching improvements (#64666)
Follow up to #64585

- Filter out deprecated models
- Cache model catalog on disk to reduce loading time
- Refresh models every hour
- Remove auth header when fetching models

All of this matches the behaviour of the OpenCode TUI

Release Notes:

- opencode: Hide deprecated models
- opencode: Improve performance when resolving models
2026-09-24 13:01:08 +00:00
Hao Lam 4c902c9db2 extensions_ui: Sync suggested extensions with the live registry (#63211)
# Objective

The suggested-extension prompt only fires for a hand-picked list of file
types. Many rows had drifted from what their extensions actually
register today (`toml` didn't know `uv.lock`, `dockerfile` ignored
Compose files, …), entries were no longer sorted by ID, and the table
had no tests locking its invariants.

## Solution

- Synced every existing row against its extension's current
`path_suffixes`.
- Added 15 popular languages: asciidoc, csv, env, gdscript, groovy, ini,
json5, julia, just, nginx, odin, perl, python-requirements, scala,
solidity.
- Re-sorted by ID.
- Excluded despite appearing in manifests: erb compounds and elixir
`html.eex` (dead keys under exact-match), haskell `x`, asciidoc `asc`
(PGP clash), env/ini generic words (`conf`, `local`, systemd units…),
gdscript `import`, ruby `Berksfile.lock` (JSON). `gradle`/`gradle.kts`
stay with the groovy/kotlin rows.
- Behavior change: git-firefly is no longer suggested for
`COMMIT_EDITMSG` etc., mirroring upstream's own manifest — only
`COMMIT_EDITMSG` has built-in core coverage.

## Testing

- New tests lock suffix uniqueness across the table, ID sortedness, and
representative lookups for every row — including dotfiles (`.envrc`,
`.gitattributes`) and name-over-extension priority (`uv.lock`,
`compose.yaml`, `nginx.conf`).
- All 69 extension IDs were verified against
[zed-industries/extensions](https://github.com/zed-industries/extensions);
every kept suffix appears in that extension's live language config.
- Best exercised by checking out this branch, uninstalling e.g. the
`csv` extension, and opening a `.csv` file.

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

<details>
  <summary>Showcase</summary>

Before: opening `hello.sol` shows nothing — Zed silently moves on.
After: *"Do you want to install the recommended 'solidity' extension for
'sol' files?"*

</details>

---

Release Notes:

- Added extension installation suggestions for many more languages when
opening unsupported files

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-09-23 20:50:24 +00:00
tidely b89471c52d gpui_apple: Remove block as a direct dependency (#64641)
# Objective

Get rid of instances of the `block` crate, as it will not compile in a
future version of Rust.

## Solution

Migrate an independent code block to the `objc2` crate family.

This is the last PR in this series, and we get to remove `block` as a
direct dependency!

## Testing

- Tested rendering on MacOS

Release Notes:

- N/A
- [GPUI] Removed `block` as a direct dependency
2026-09-23 16:14:14 +00:00
zed-zippy[bot] f57e400a17 Bump Zed to v1.23.0 (#64663)
Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-09-23 15:11:54 +00:00
Bennet Bo Fenner 6971ae21e9 opencode: Fetch models dynamically (#64585)
Release Notes:

- opencode: Fetch model list dynamically so that new models are always
available immediately
2026-09-23 13:15:09 +00:00
Dom Porada 5a137cbc9b Add support for "..." in edit_predictions.disabled_globs (#64540)
## Objective

Let users and projects add edit prediction exclusion patterns without
repeating defaults or inherited patterns.

Part of #64399.

## Solution

Extend the `"..."` convention from #62769, #64222, #64440, and #64484 to
`edit_predictions.disabled_globs` using `SplicingVec`. Inherited
patterns are inserted at `"..."`, and duplicates retain their first
occurrence. Omitting the marker replaces the list, `[]` clears it, and
omitting the setting preserves inheritance.

Opening an absent setting now initializes it with `["..."]` instead of
clearing inherited patterns, and the selection is located by parsing the
JSON instead of a regex, so a commented-out or nested `"disabled_globs"`
can no longer capture it. Cursor imports append `"..."` like the
`files.exclude` import does, so Zed's sensitive-file defaults survive an
import; empty lists and empty or literal `"..."` entries are dropped,
matching `enabled_patterns`.

## Testing

Tested on macOS with settings merge and loading tests, Cursor import
tests, the UI settings update and selection path (including
commented-out and nested decoy keys), the new `settings_json` key-path
lookup, and Copilot integration coverage.

To check manually, configure custom disabled patterns alongside `"..."`
and confirm that both custom patterns and inherited sensitive-file
patterns remain disabled. Repeat without `"..."` and with `[]` to verify
replacement and clearing. Opening the setting when it is absent should
preserve inherited patterns.

## 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 `edit_predictions.disabled_globs` so
custom patterns can extend inherited exclusions, and fixed "Configure
Excluded Files" selecting the wrong list when a commented-out
`disabled_globs` precedes it.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-09-21 13:08:53 +00:00
Ben Brandt 85b8198e86 acp: Update the ACP SDK to 2.2.0 (#64457)
Pick up the published ACP Rust SDK 2.2.0 release, including the schema
1.9.1 compatibility fix for agents returning `null` for
empty/defaultable payloads.

Upstream changes:
- https://github.com/agentclientprotocol/agent-client-protocol/pull/2178
- https://github.com/agentclientprotocol/rust-sdk/pull/367

Release Notes:

- acp: Fixed errors when ACP agents return `null` for empty response
payloads.
2026-09-21 08:25:44 +00:00
Azeem Shaik 72b060af2e git_ui: Load diff buffers incrementally (#62536)
# Objective

Opening a diff against a heavily drifted branch sits on a spinner until
every changed file has loaded. Blob reads were serialized through the
git job queue and enqueued in `open_buffer` completion order rather than
path order, so the blob for the first excerpt could be hundreds of jobs
deep.

## Solution

1. `load_blob_content` skips the job queue — blobs are
content-addressed, so the read doesn't depend on the status snapshot.
2. `DiffBuffer::load` is a lazy future instead of an eagerly-spawned
`Task`, so the consumer picks the concurrency.
3. `DiffMultibuffer` drives those loads through `buffered(16)`.

All three are needed: dropping the queue without bounding forks
thousands of `cat-file` processes, and bounding without dropping it
still serializes.

Trust handling is unaffected, since the untrusted-repo flags are applied
in `GitBinary::build_command` rather than by the queue.

Worth noting that `handle_get_blob_content` is remote-reachable, so a
guest can now put up to 16 `cat-file` processes on the host instead of
queueing them.

## Testing

Added `project_diff::tests::test_excerpts_are_ordered_by_path`, which
pins excerpt order to `PathKey` rather than to load completion order,
using more files than the concurrency limit and several executor seeds.

Green: `cargo test -p git_ui --lib` (131), `cargo test -p project --lib
git_store` (11), `./script/clippy`.

Not tested against a remote or collab project, which is where the
`handle_get_blob_content` change actually matters.

### Numbers

Zed repo against a base ~3000 commits back: 2346 changed files, 1794
with a blob at the merge base. Warm cache, one `cat-file` process per
blob, best of two runs at each concurrency.

| concurrency | total | per blob | speedup |
|---|---|---|---|
| 1 (previous behaviour) | 77.25s | 43.1ms | 1.00x |
| 2 | 17.74s | 9.9ms | 4.35x |
| 4 | 10.05s | 5.6ms | 7.69x |
| 8 | 7.34s | 4.1ms | 10.52x |
| 16 (this change) | 6.63s | 3.7ms | 11.65x |
| 32 | 6.59s | 3.7ms | 11.73x |
| 64 | 7.14s | 4.0ms | 10.82x |

16 is where the curve flattens: 32 buys another 0.7% and 64 regresses,
so there's nothing above it worth the extra in-flight buffers or the
extra concurrent processes on a host serving a remote peer.

At one blob at a time the first excerpt waits at an arbitrary position
in a 1794-deep queue, so roughly 38s on average, which lines up with the
45s full load in the recording below. It's now in the first batch.

## Self-Review Checklist:

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

## Showcase

Opening a branch diff against a base ~3000 commits back, 2346 changed
files. Both clips are cut to 15s to keep the file size down — the before
run took 45s to finish loading.

**Before**


https://github.com/user-attachments/assets/d9475de8-ddd3-48a0-99e2-042a2f655b42


**After**


https://github.com/user-attachments/assets/0bf0e73d-0fac-4c2a-9749-71fee376f260


---

Release Notes:

- Improved how quickly a branch diff shows its first changes when the
branch has drifted a long way from its base
2026-09-18 19:53:58 +00:00
Piotr Osiewicz 78648aaf7d collab: Drop old rustls dependencies (#55632)
## Summary

- Disable legacy default TLS features for the collab AWS SDK clients
- Use the current AWS HTTP client and Rustls dependency chain

## Verification

- `cargo check -p collab --locked`
- `cargo fmt --all -- --check`
- Confirmed the collab dependency tree excludes rustls 0.21,
hyper-rustls 0.24, and tokio-rustls 0.24

Release Notes:

- N/A
2026-09-18 11:38:53 +00:00
zed-zippy[bot] b6171bcc98 html: Bump to v0.3.2 (#64371)
This PR bumps the version of the HTML extension to v0.3.2.

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:59:21 +00:00
zed-zippy[bot] 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] 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 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
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
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 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
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
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
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