Commit Graph
39991 Commits
Author SHA1 Message Date
Smit Barmase 658460cc2b gpui_macos: Fix hover feedback when another application is focused (#64301)
Follow-up #64234

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

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

Release Notes:

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

Release Notes:

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


Release Notes:

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

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

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

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

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

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

## Why `std` fixes it

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

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

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

## Regression test and verification

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

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

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

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

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

## Suggested .rules additions

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

Release Notes:

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

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

## Solution

deepseek rename deepseek v4 flash to deepseek flash



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


---

Release Notes:

- agent: Added support for DeepSeek Flash 4.1

---------

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

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

## Solution

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

## Testing

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

## Self-Review Checklist:

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

## Showcase

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

## User

Describe zébrette_le_matin_22_novembre_1913.jpg

## Assistant

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

Let me locate and examine that image file first.

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

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

## Assistant

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

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

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

## Assistant

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

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

`Image`

## Assistant

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

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

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


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

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

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

### Key details:

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

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

---

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

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


</details>

---

Release Notes:

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

---------

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

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

## Solution

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

## Testing

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

---

Release Notes:

- N/A

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

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

## Solution

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

## Testing

Docs-only changes; no runtime behavior change.

---

Release Notes:

- N/A

---------

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

Release Notes:

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

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

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

## Solution

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

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

## Testing

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

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

## Self-Review Checklist:

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

## Showcase

SuperGrok LLM provider settings:

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

---

Release Notes:

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

Release Notes:

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

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

## Summary

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

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

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

## Validation

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

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

## Review follow-up

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

Release Notes:

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

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

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

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

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

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

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

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

## Verification

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

Release Notes:

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

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

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

## Implementation

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

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

## Validation

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

## Open review items

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

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

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

Release Notes:

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

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

Release Notes:

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

Release Notes:

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

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

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

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

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

Before:


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

After:


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

Release Notes:

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

---------

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

# Objective

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

## Solution

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

## Testing

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

## Self-Review Checklist:

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

---

Release Notes:

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

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

## Solution

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

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

## Testing

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

## Self-Review Checklist:

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

---

Release Notes:

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

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

## Summary

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

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

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

## Validation

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

Release Notes:

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

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

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

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

## Validation

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

Release Notes:

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

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

Release Notes:

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

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


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

Release Notes:

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

---------

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

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

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

## Solution

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

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

## Testing

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

## Self-Review Checklist:

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

Release Notes:

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

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

## Solution

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

## Testing

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


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

## Self-Review Checklist:

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

## Showcase

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

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

</details>

---

Release Notes:

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

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

## Solution

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

## Testing

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

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

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

## Self-Review Checklist:

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

---

Release Notes:

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

---------

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

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


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

Release Notes:

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

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

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

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

## Solution

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

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

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

## Testing

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

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

## Notes for review

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

## Self-Review Checklist:

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

Release Notes:

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

Fixes #56544

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

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

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

## Solution

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

Two of these needed more than a value swap:

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

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

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

## Testing

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

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

## Notes for review

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

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

## Self-Review Checklist:

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

Release Notes:

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

---

Release Notes:

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

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

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

Release Notes:

- N/A

---------

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

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

Release Notes:

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

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

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

## Summary

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

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

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

## Test consolidation

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

## Validation

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

Earlier split validation:

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

## Review notes

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

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

Release Notes:

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

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

## Verification

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

Release Notes:

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

Release Notes:

- Fixed project panel reveal not working in git diff-related multi
buffers
2026-09-14 15:54:54 +00:00
Bennet Bo Fenner 457d22be3a gpui: Add ShapedLineCursor API (#64185)
Release Notes:

- N/A
2026-09-14 14:38:54 +00:00
Ben Brandt 1e6e1a93d8 acp: Add agent license if available from the registry (#64178)
The JetBrains team started added links to the relevant license terms for
each agent. Seems worth linking out to if we have it.

Release Notes:

- N/A
2026-09-14 14:04:21 +00:00
Ben Brandt 0738b5d46d agent_ui: Show tool-name fallbacks and tooltips (#64177)
Surface tool-call names without adding a permanent subtitle or badge to
every call.

- Keep nonblank titles as the primary label. Blank or whitespace-only
titles fall back to the exact programmatic tool name, then to "Tool
call" if no usable name is available.
- Preserve real titles on name-only updates, and let later title updates
replace a fallback. Fallback names render literally and remain
searchable; exports escape them at the Markdown boundary.
- Show `Tool: <name>` on existing non-terminal tool icons. Keep the
terminal command layout unchanged, and preserve the existing Go to File,
Interrupted Edit, and Copy Command interactions.
- Apply the same behavior to native and external agents, without an
ACP-beta gate.

Release Notes:

- N/A
2026-09-14 14:04:09 +00:00
Giorgi MerebashviliandMrSubidubi d643da9c3b project_panel: Add Menu key support to project panel context menu (#46744)
Closes #45783 

`Menu` key or `Shift + F10` shortcut wasn't supported in project panel
for opening the context menu, this PR fixes it.

Release Notes:
- Added an action and default keyboard shortcuts to open the context
menu in the project panel. You can now bind
`project_panel::OpenContextMenu` to deploy the context menu at the
currently selected entry in the panel.

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-09-14 12:03:12 +00:00
Ben Brandt 3ff99ed78e acp: Add ACP context compaction support (#64081)
Add support for ACP context-compaction updates and streamed summaries.
The ACP beta flag gates only the capability advertised to external ACP
agents. Native Zed-agent compaction (manual and automatic), including
the shared rendering, search, and export behavior, remains available
regardless of that flag.

- Apply updates by compaction ID without moving their timeline entries,
preserving omitted/null/replacement semantics for summaries and errors.
- Retain rich summary content and show explicit placeholders for
unsupported content instead of silently dropping it.
- Render progress, completion, failure, cancellation, and unknown
statuses. Expanded summaries and literal error details participate in
thread search, and Markdown exports preserve status and details.
- Keep native compaction compatible: failed retry attempts become
terminal, and cancellation is delivered before the stop event even when
the bridge has not yet applied the queued start event. Preserve native
streaming and save/reload behavior.

Release Notes:

- N/A
2026-09-14 10:31:51 +00:00
Ben Brandt 2849ef4125 agent: Fix elicitation tool-call IDs (#64086)
Use the native tool call's scoped ID for elicitation requests instead of
constructing an ID from the raw provider-issued tool-use ID. This keeps
`ask_user` forms associated with the correct conversation entry,
including when providers reuse raw IDs.

Release Notes:

- N/A
2026-09-14 09:34:39 +00:00
Ben Brandt b311a148c7 acp: Use first-class ACP tool-call names (#64080)
Follow up on #64077 by using first-class ACP tool-call names while
continuing to accept legacy `_meta.tool_name` from older agents.

- Prefer the first-class name when creating a tool call. Explicit name
updates replace the stored name; legacy metadata only fills an absent
name and cannot overwrite a canonical name.
- Emit first-class names from the native agent, including replay when a
tool implementation is unavailable.

Release Notes:

- N/A
2026-09-14 09:30:52 +00:00
hooch e51ac96d65 git_ui: Add clipboard context menu to commit message editor (#64142)
# Objective

- Enable users to cut, copy, and paste commit-message text through a
right-click menu in the Git sidebar and expanded commit modal.

## Solution

- Add a context menu to the shared commit-message editor using Zed’s
existing clipboard actions
- Disable Cut and Copy when no text is selected, and route actions to
the editor’s focus handle.

## Testing

- Added a regression test covering clipboard behaviour in both editor
modes.
- Reviewer can test by using right-click context menu in the git commit
message panel to cut/copy/paste
- Tested on Mac OS with `cargo run`

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

<img width="800" height="451" alt="commit-menu"
src="https://github.com/user-attachments/assets/1ba281d7-7651-4408-8c10-ee456cde2e1d"
/>

---

Release Notes:

- Added Cut, Copy, and Paste context menu actions to the commit message
editor.
2026-09-14 08:57:38 +00:00
Alex LachanceandFinn Evers 70385163e8 python: Fix at sign decorator highlighting conflict with matrix multiplication at sign operator (#58077)
In the current Python Tree-sitter `highlight.scm`, the `@` used for
decorators (`@punctuation.special` rule) is incorrectly overridden by
the `@` used for matrix multiplication (`@operator` rule).

This PR updates the matrix multiplication highlight query so it only
applies in binary operator contexts, and it also removes a duplicate
`@punctuation.special` for the `@` decorator.

| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
| <img width="338" height="1056" alt="image"
src="https://github.com/user-attachments/assets/cdce1556-6f7d-4542-abca-bcb3e11b6629"
/>| <img width="380" height="1057" alt="image"
src="https://github.com/user-attachments/assets/f948413c-ad8a-4ccc-89c1-bbffbe2affda"
/>|


Self-Review Checklist:

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

Release Notes:

- Fix Python at sign decorator highlighting conflict with matrix
multiplication at sign operator

---------

Co-authored-by: Finn Evers <finn@zed.dev>
2026-09-14 07:33:49 +00:00
Max Brunsfeld abc6b3b357 gpui: Add Canvas font fallback for web text (#64110)
## Summary

Add browser-font fallback to GPUI on the web, so applications can render
emoji using the user’s local fonts without bundling an emoji font.

GPUI continues to shape text with Cosmic Text using application-provided
fonts. When those fonts cannot supply an eligible grapheme or its
requested emoji presentation, the web backend measures and rasterizes
the complete grapheme using Canvas 2D, then caches and paints the result
through GPUI’s existing glyph atlas.

### Configurable fallback

- **Emoji-only by default**, including supported variation-selector,
skin-tone, flag, keycap, and ZWJ sequences.
- Applications can opt into **CJK fallback** for a conservative subset
of horizontal Han, kana, and modern Hangul text.
- Applications can disable Canvas fallback entirely.

CJK fallback renders graphemes independently. It prioritizes readable
text over full fidelity to contextual spacing and font features. Browser
font coverage and appearance depend on the user’s environment.

### Web input and application lifecycle

- Fix text insertion that arrives without a corresponding keyboard
event, allowing emoji input through the browser’s text-input path.
- Keep the GPUI application alive after `Application::run` returns on
WebAssembly. Browser startup is asynchronous; releasing the application
after the startup callback previously caused the window to disappear.

### Browser example gallery

Make the existing GPUI examples available from a single development
server, with separate routes for hello world, styled text, text layout,
wrapping, input, and the prime sieve demo.

The gallery supports direct links and reloads, loads only the selected
example, and provides a simple way to exercise font fallback and text
input.

## Validation

- Native unit tests cover fallback eligibility and presentation, policy
defaults, glyph-cache reuse, and in-place glyph-run replacement.
- All six gallery binaries pass WASM compilation checks.
- Browser smoke coverage exercises emoji insertion, whole-grapheme
Canvas rendering, cache reuse, and deletion.
- Manually exercised the gallery and fallback rendering in Chrome.

Release Notes:

- N/A
2026-09-12 20:38:07 +00:00