Commit log

1ded60a Implement Vim's tag stack (#46002)

Click to expand commit body
Happy New Years! This PR is a second take at
https://github.com/zed-industries/zed/pull/38127 (cc @ConradIrwin)

This PR is significantly less complicated than the last attempt: while
we still keep our data on the `NavigationHistory` object, we no longer
tightly integrate it with the existing back/forward "browser history."
Instead, we keep our own stack of `(origin, target)` pairs (in a struct
to make it easy to extend with e.g., tag names in the future).

The PR is split into two separable commits. Most of the implementation
is in the second commit, which:
- Defines the stack data structure
- Implements `pane::GoToOlderTag` and `pane::GoToNewerTag` in terms of
the stack
- Hooks into `navigate_to_hover_links` to push tag stack entries

This last bit is the most fiddly. The core challenge is that we need to
keep track of the `origin` location and calculate the `target` location
across three codepaths that might involve creating a new editor and/or
splitting the pane. One thing in particular I found difficult was that
an editor's `nav_history` (an `ItemNavHistory`) seems to be populated
asynchronously. Instead of relying on it, I decided in this code to make
my own `ItemNavHistory`. I briefly tried to refactor the code in
question, but it seemed like it would significantly increase the scope
of the change.

I prefer this all-in-one tracking centered around
`navigate_to_hover_links ` to the `start/finish` approach taken in
https://github.com/zed-industries/zed/commit/b69a2ea200561de9de0edf4d0c4428ee887fb918
because I find it easier to convince myself that the right data is being
populated at the right times. Of course, let me know if you think
there's a better solution.

Closes #14206

Release Notes:
- ??? I don't know what to write here! Suggestions welcome

Carl Jackson created

a10fdfd ep: Combine PredictionProvider and ZetaVersion (#46896)

Click to expand commit body
We can specify prompt version in the provider name itself, like this
`--provider zeta2:0113`.

This kind of tag will also be stored in the `provider` field of
jsonlines files.

This drops the `--version` parameter.


Release Notes:

- N/A

Oleksiy Syvokon created

3ed6c68 gpui: Fix utf8 slicing panic in `truncate_line` (#46914)

Click to expand commit body
Fixes https://github.com/zed-industries/zed/issues/46904

Release Notes:

- Fixed a panic in the git panel when utf8 multibyte character filenames
got truncated

Lukas Wirth created

6e0dc03 Cache dynamic JSON schemas with invalidation (#46824)

Click to expand commit body
Dynamic schemas (settings, settings/lsp/*, debug_tasks) are now cached
after first generation and returned immediately via Task::ready() on
subsequent requests.

Cache is invalidated when `notify_schema_changed()` is called, which
happens when:
- Extensions are installed/uninstalled (affects settings schema)
- DAP registry changes (affects debug_tasks schema)

This eliminates repeated foreground thread blocking for the same dynamic
schema.

**Note:** This PR is based on #46823 and should be merged after it.

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>

Richard Feldman and Ben Kunkle created

3d0222a remote: Support opening builtin host files in remote workspaces on wsl (#46910)

Click to expand commit body
Release Notes:

- Opening bundled files, keymap, and local release notes now opens in
remote windows instead of opening a new local zed window
- Opening the settings files, keymap files, task files, debug files and
logs will now open within wsl windows instead of opening a new local zed
window

Lukas Wirth created

adf2fec Revert "gpui: Add dynamic padding to prevent glyph clipping in text rendering on macOS (#45957)" (#46906)

Click to expand commit body
This reverts commit 83ca31055cf3e56aa8a704ac49e1686434f4e640.

This change produces bad clipping on macOS:

<img width="59" height="80" alt="Screenshot 2026-01-15 at 8 51 28 AM"
src="https://github.com/user-attachments/assets/e1e295a4-f25c-4144-aa85-ec2fbbba03a8"
/>

<img width="218" height="67" alt="Screenshot 2026-01-15 at 8 51 35 AM"
src="https://github.com/user-attachments/assets/e662f8df-b009-445e-afee-3440b7fc52f0"
/>

<img width="303" height="43" alt="Screenshot 2026-01-15 at 8 51 41 AM"
src="https://github.com/user-attachments/assets/c972a1be-a07b-4b5f-970b-f75a51dac6b8"
/>

https://zed-industries.slack.com/archives/C04S5TU0RSN/p1768473926260279

Release Notes:

- Reverted #45957

Marshall Bowers created

e1f73a6 languages: Support terminal auto-activation for `poetry` managed Python environment (#46900)

Click to expand commit body
Although `poetry` may store virtual environments in a global cache
directory (unlike the standard project-local `.venv`), the internal
directory structure of these environments remains consistent with
standard `venv` or `uv` environments.

Since our existing activation logic for `venv` environments relies on
relative paths within the environment root, it is naturally compatible
with `poetry` environments. Once the toolchain locates the environment's
root directory, the activation scripts can be applied without further
modification.

Testing:
- Verified on Windows: Confirmed working across `PowerShell`, `Pwsh`,
and `Cmd` for global poetry environments.
- Observation: When using an in-project `.venv` directory, the toolchain
may categorize the environment as `venv`-managed instead of
`poetry`-managed. While this behavior relates to the toolchain's
discovery logic, the activation itself remains fully functional as the
underlying structure is compatible.

Release Notes:

- N/A *or* Added/Fixed/Improved ...

Xin Zhao created

d139c5e ui: Dismiss context menus when window loses focus (#46866)

Click to expand commit body
Context menus close when the window becomes inactive (e.g., clicking to
another window or app). Previously, menus would remain visible until the
window regained focus.

This aligns Zed's context menu behavior with native macOS apps, where
NSMenu automatically dismisses when the window loses focus. Users expect
menus to close when switching windows or apps.

Uses `observe_window_activation` to detect when the window becomes
inactive and calls `cancel` to dismiss the menu.

Release Notes:

- Fixed context menus dismiss/cancel when the window loses focus

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Jake Go and Danilo Leal created

39569ef agent_ui: Improve icon for discarding interrupted edit (#46903)

Click to expand commit body
Just swapping it from the `Trash` icon for the `Undo` one given it's
clearer.

Release Notes:

- N/A

Danilo Leal created

78d9877 agent_ui: Clean UI code a bit for the tool permission controls (#46902)

Click to expand commit body
Just some housekeeping here, no changes in functionality and UI.

Release Notes:

- N/A

Danilo Leal created

cc62b53 git_panel: Disable AI commit message button instead of hiding it (#46525)

Click to expand commit body
Closes #46142

Release Notes:

- Fixed AI commit message button in Git panel being hidden instead of
disabled when no AI provider is configured. The button now remains
visible with a tooltip explaining how to enable the feature.

Screenshot:

<img width="90%" alt="Screenshot 2026-01-10 at 18 16 12"
src="https://github.com/user-attachments/assets/6af9c845-7857-40e1-bfb5-3118f1af8360"
/>

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Ivan Magda and Danilo Leal created

b06f408 Revert "collab: Bump minimum required version to collaborate from 0.204.1 to 0.220.0 to accomodate for project search RPC changes" (#46892)

Click to expand commit body
Reverts zed-industries/zed#46715
Closes #46889

Piotr Osiewicz created

9b9f25f multi_buffer: Use stable storage for buffer IDs (#46884)

Click to expand commit body
Long story short:
1. Whenever we pick a buffer for mutation in

https://github.com/zed-industries/zed/blob/b8c5f672cdf8ed3c1f4c8016f2b8d6d84b7a7a9c/crates/multi_buffer/src/multi_buffer.rs#L3831,
we seed from a hashmap<BufferId, _>.
2. That HashMap is not RNG-seeded by
itself (good), but the BufferIds are: they are derived from entity ID in

https://github.com/zed-industries/zed/blob/b8c5f672cdf8ed3c1f4c8016f2b8d6d84b7a7a9c/crates/project/src/buffer_store.rs#L641

3.^ was introduced in https://github.com/zed-industries/zed/pull/10347
4.The HashMap is not randomized, but the order of it's values could
shift
when the keys (buffer ids) change.
5. Thus, we'll end up mutating a
different buffer in the multi-buffer when BufferIds shift around.

Our "fix" is that we're using a btreemap for buffer storage, which
should ensure that the order of iteration (and seeding) the candidates
matches up with the order of buffer creation.

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

Closes #ISSUE

Release Notes:

- N/A

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

Piotr Osiewicz and Smit Barmase created

4a2d1e3 Fix delay in Copilot completion (#46885)

Click to expand commit body
This PR fixes an issue when copilot takes 3s to complete. Right now, in
copilot edit prediction, we issue requests to both the Next Edit
Suggestion (NES) and the regular copilot inline completion endpoints.
Whichever come back first will be shown. However, there is a bug where
even if inline completion (which is usually much faster) comes back, we
still wait for NES (which takes about 3s).

This should address https://github.com/zed-industries/zed/issues/46389
and https://github.com/zed-industries/zed/issues/46880

Release notes:
- Improved responsiveness of Copilot inline completions.

Hieu Pham created

1321aa9 workspace: Do not attempt to unnecessarily update jump list on worktree updates (#46882)

Click to expand commit body
It should be a no-op but causes massive main thread hangs on windows due
to the winapi calls this emits, restores the behavior pre
github.com/zed-industries/zed/pull/46256 without reverting the main
changes of that.

Release Notes:

- N/A *or* Added/Fixed/Improved ...

Lukas Wirth created

b4d1ba7 terminal: Fix vi mode cursor not updating on k/j navigation (#46762)

Click to expand commit body
The cursor in terminal vi mode was not visually updating when using
vi motion navigation keys, despite internal position tracking working correctly.
This was caused by missing `cx.notify()` calls to trigger re-rendering.

Refactored keystroke handling by extracting common logic from `key_down`
and `send_keystroke` into a shared `process_keystroke` helper method.

Closes #46736

Release Notes:

- terminal: Fixed vi mode cursor not visually updating when navigating
with vi motion keys

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>

xcb3d and dino created

b8c5f67 workspace: Fix tab reordering regression (#46872)

Click to expand commit body
Closes [#46864](https://github.com/zed-industries/zed/issues/46864)
Initial PR: https://github.com/zed-industries/zed/pull/46573

## Summary

Fix a regression where dragging a tab onto another tab would place it at
the end of the tab bar instead of at the target position.

The issue was in the `on_drop` handler: it used `this.items.len()`
(evaluated at drop time) instead of the captured `ix` index (the
position of the tab being dropped onto).

Release Notes:

- Fixed tab reordering not working correctly when dragging tabs

## Video after fix:

- when 'show_pinned_tabs_in_separate_row' is false:


https://github.com/user-attachments/assets/1ede0ce5-1161-4209-83f4-33a07572782a

- when 'show_pinned_tabs_in_separate_row' is true:


https://github.com/user-attachments/assets/d56c0e59-8372-41d4-973b-32a4895ca729

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

Yaroslav Yenkala and Smit Barmase created

83ca310 gpui: Add dynamic padding to prevent glyph clipping in text rendering on macOS (#45957)

Click to expand commit body
Here may caused by [font-kit](https://github.com/servo/font-kit), I was
tried to use
[render-glyph](https://github.com/servo/font-kit/blob/main/examples/render-glyph.rs)
example and also use the same option with `Transform2F::from_scale(2.0)`
for `raster_bounds`.

Then the `raster_bounds` will result same issue like the GPUI's font
rendering issue.

| Transform2F::default() | Transform2F::from_scale(2.) |
| --- | -- |
| <img width="943" height="638" alt="image"
src="https://github.com/user-attachments/assets/9b827c63-2cbb-45d3-bd62-b0e058a46614"
/> | <img width="943" height="638" alt="image"
src="https://github.com/user-attachments/assets/ee977a9b-2a7b-4b78-873b-146b2953c0db"
/> |

## Before

<img width="1032" height="1398" alt="SCR-20260105-pgcp-2"
src="https://github.com/user-attachments/assets/ebeb04cc-3a92-4333-99fc-8733a63b2553"
/>

## After

<img width="1032" height="1414" alt="SCR-20260105-pfny-1"
src="https://github.com/user-attachments/assets/063d0452-56d7-447c-810b-fee7c891235b"
/>

Release Notes:

- Fixed incorrect rendering of characters at large font sizes on macOS

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Jason Lee <huacnlee@gmail.com>

Jony Lab , Claude Sonnet 4.5 , and Jason Lee created

95c698d Fix emoji on Linux when using High DPI (#46857)

Click to expand commit body
Fixes https://github.com/zed-industries/zed/issues/46849

Release Notes:

- Fixed emoji being too small on Linux when using High DPI

John Tur created

ceecf82 Allow EP synthesize command to take multiple repos (#46853)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>

Max Brunsfeld and Agus Zubiaga created

fd877a9 Use LazyLock for static JSON schemas (#46823)

Click to expand commit body
Static schemas (tasks, snippets, jsonc, keymap, action/*, tsconfig,
package_json, inspector_style) are now computed once on first access
using LazyLock and returned immediately via Task::ready().

These schemas never change at runtime because:
- tasks, snippets, jsonc, inspector_style are derived from static Rust
types
- tsconfig, package_json are bundled JSON files (include_str!)
- keymap and action/* depend only on registered actions, which are
collected at compile/link time via the inventory crate (extensions
cannot add actions)

This eliminates foreground thread blocking for these schema requests.

**New functions added to KeymapFile:**
- `generate_json_schema_from_inventory()`: generates keymap schema
without App context
- `get_action_schema_by_name()`: looks up single action schema without
App context

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>

Richard Feldman and Ben Kunkle created

445c95a Fix issues processing captured edit prediction examples (#46773)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>

Max Brunsfeld and Agus Zubiaga created

9c5fc6e Split token display for OpenAI (#46829)

Click to expand commit body
This feature cost $15.

Up -> Tokens we're sending to the model
Down -> Tokens we've received from the model.

<img width="377" height="69" alt="Screenshot 2026-01-14 at 12 31 01 PM"
src="https://github.com/user-attachments/assets/fc15824f-de5d-466b-8cc1-329f3c1940bb"
/>



Release Notes:

- Changed the display of tokens for OpenAI models to reflect the
input/output limits.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

Mikayla Maki and Claude Opus 4.5 created

b5b13d1 agent_ui: Refine the subagent UI design (#46838)

Click to expand commit body
This PR refines the design for the subagent card UI. Here's a quick
preview:

<img width="500" height="544" alt="Screenshot 2026-01-14 at 6  43@2x"
src="https://github.com/user-attachments/assets/a293b9ec-37cd-4098-b8ea-b321a239dea3"
/>

Release Notes:

- N/A

Danilo Leal created

138c335 markdown_preview: Fix wide tables not being fully visible (#46834)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/44630

Content in markdown preview tables now wraps so you can see it all when
it's a table with very long content:

<img width="600" height="692" alt="Screenshot 2026-01-14 at 6  23@2x"
src="https://github.com/user-attachments/assets/ece39852-2e39-406e-a3f0-8ca399ee0be6"
/>

Release Notes:

- Fixed a bug with very wide tables not being fully visible in markdown
previews.

Danilo Leal created

99829c7 workspace: Add recent projects in the multi-project dropdown (#46828)

Click to expand commit body
This PR adds a list of recent projects to the multi-project dropdown,
avoiding the need to open up the picker and the mouse travel when using
a pointer to interact with it. When the recent projects list is bigger
than 5, we display more in a "View More" submenu.

<img width="500" height="800" alt="Screenshot 2026-01-14 at 5  15@2x"
src="https://github.com/user-attachments/assets/31f11e3e-d010-4b66-a539-f74cbc572e40"
/>

Release Notes:

- Workspace: Added the list of recent projects to the multi-project
title bar menu.

Danilo Leal created

14e05cc Allow passing custom access token to zeta2 models via env var (#46830)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>

Max Brunsfeld and Agus Zubiaga created

cd41a21 Allow running MCP servers on the remote server when using remote development (#46756)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/34402

Release Notes:

- MCP servers can now be run on the remote server when using remote
development. This can be enabled by setting the `"remote": true`
property in the settings entry for the MCP server.

---------

Co-authored-by: localcc <kate@zed.dev>
Co-authored-by: Lukas Wirth <me@lukaswirth.dev>

John Tur , localcc , and Lukas Wirth created

4791e1d Granular Tool Permission Buttons (#46284)

Click to expand commit body
Adds buttons for confirming (and optionally persisting) granular
permissions on tool calls:

<img width="688" height="302" alt="Screenshot 2026-01-14 at 1 58 40 PM"
src="https://github.com/user-attachments/assets/3228cc39-efd5-4a73-989f-ddb28969847f"
/>
<img width="690" height="282" alt="Screenshot 2026-01-14 at 1 58 31 PM"
src="https://github.com/user-attachments/assets/8367a888-5728-4877-a502-1ff20ac929ec"
/>

## Features

### Tool Permission Settings
- **Per-tool rules** in `agent.tool_permissions.tools.<tool_name>`:
  - `default_mode`: `"allow"`, `"deny"`, or `"confirm"` (default)
  - `always_allow`: Array of regex patterns to auto-approve
  - `always_deny`: Array of regex patterns to block
  - `always_confirm`: Array of regex patterns requiring confirmation
- **Supported tools**: `terminal`, `edit_file`, `delete_path`,
`move_path`, `create_directory`, `save_file`, `copy_path`, `fetch`,
`web_search`
- **MCP tool support**: Third-party tools from context servers with
`mcp:<server>:<tool>` naming

### Smart Permission Buttons
When a tool requires confirmation, the dialog shows contextual buttons:
- **"Always allow \`<tool>\`"** - Sets `default_mode = "allow"` for the
tool
- **"Always allow \`<pattern>\`"** - Adds a pattern to `always_allow`:
  - Terminal: Command name (e.g., `cargo`, `npm`, `git`)
  - File tools: Parent directory path
  - URL tools: Domain name
- **"Allow"** / **"Deny"** - One-time decision

### Pattern Extraction
Automatically extracts meaningful patterns from tool inputs:
- Terminal commands → `^cargo\s`, `^npm\s`, etc.
- File paths → `^/Users/alice/project/src/`
- URLs → `^https?://github\.com`

### Invalid Pattern Handling
- Malformed regex patterns are detected at settings load time
- Tools with invalid patterns show an error and block execution
- Clear error messages identify which pattern failed

## Changes

### New Files
- `crates/agent/src/tool_permissions.rs` - Permission evaluation logic
- `crates/agent/src/pattern_extraction.rs` - Pattern extraction
functions

### Modified Files
- `crates/agent_settings/src/agent_settings.rs` - `ToolPermissions`,
`ToolRules` structs
- `crates/settings/src/settings_content/agent.rs` - Settings schema and
serialization
- `crates/settings/src/settings_file.rs` - Helper methods for modifying
settings
- `crates/agent/src/thread.rs` - `authorize_with_context()`,
`authorize_third_party_tool()` methods
- `crates/agent/src/tools/*.rs` - Updated all granular tools to use
permission system
- `crates/agent/src/tools/context_server_registry.rs` - MCP tool
authorization
- `crates/agent_ui/src/acp/thread_view.rs` - Permission button UI,
removed Keep/Reject buttons

## Example Configuration

```json
{
  "agent": {
    "tool_permissions": {
      "tools": {
        "terminal": {
          "default_mode": "confirm",
          "always_allow": ["^cargo\\s", "^npm\\s", "^git\\s"],
          "always_deny": ["^rm\\s+-rf", "^sudo\\s"]
        },
        "edit_file": {
          "default_mode": "allow",
          "always_deny": ["^\\.env", "^/etc/"]
        },
        "mcp:filesystem:write_file": {
          "default_mode": "confirm"
        }
      }
    }
  }
}
```

Release Notes:

- You can now set per-tool permissions when confirming/denying tool use

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Michael Benfield <mbenfield@zed.dev>

Richard Feldman , Amp , Zed Zippy , and Michael Benfield created

581e559 Render subagents in thread (#46188)

Click to expand commit body
## Summary

This PR adds the UI for displaying subagent tool calls:

### Thread view changes
- Add `expanded_subagents` state HashMap for tracking expanded cards  
- Implement `render_subagent_tool_call()` for collapsed card with label
and chevron
- Add subagent detection via `is_subagent()` and `tool_name` field
- Handle `SubagentThread` content type in tool call rendering
- Add expand/collapse toggle button for subagent cards
- Style collapsed cards similar to terminal tool calls
- Support inline image rendering in content blocks

### Agent panel changes
- Add `open_external_thread_with_server()` for testing with stubbed
servers

### Test support
- Add `acp_thread/test-support` feature to agent_ui
- Add base64 dev dependency for image tests

Release Notes:

- N/A

---------

Co-authored-by: Amp <amp@ampcode.com>

Richard Feldman and Amp created

5e5951a workspace: Move panel telemetry to workspace level (#46809)

Click to expand commit body
This refactors the "Panel Button Clicked" telemetry event to fire from
`workspace.rs` instead of `dock.rs`.

Previously, the event was emitted in the `PanelButtons` render method's
click handler. Now it fires at the workspace level in two places:
- `toggle_dock()` - captures panel toggles via dock buttons
- `focus_panel<T>()` - captures panel focus via keyboard shortcuts

This ensures the telemetry fires once per user action regardless of
input method, and retrieves the panel name dynamically via
`persistent_name()` rather than relying on a pre-computed local
variable.

Release Notes:

- N/A

Katie Geer created

415f384 Diff review comments: store locally and batch submit to agent (#46669)

Click to expand commit body
Doesn't support editing or deleting comments yet, but inputs work:

<img width="797" height="881" alt="Screenshot 2026-01-14 at 11 51 36 AM"
src="https://github.com/user-attachments/assets/746e085b-a919-475a-b804-ee0377e40a0b"
/>


<img width="698" height="178" alt="Screenshot 2026-01-14 at 11 47 51 AM"
src="https://github.com/user-attachments/assets/3edac0e8-62e5-4af5-a324-df2bd293f3ca"
/>

<img width="695" height="695" alt="Screenshot 2026-01-14 at 11 47 58 AM"
src="https://github.com/user-attachments/assets/64795ffd-62b4-48ea-a46c-7724221095d7"
/>


### Features implemented:
- **Local comment storage**: Comments are stored per-hunk in the Editor,
with chronological ordering
- **Expandable comments section**: Shows "N Comments" header that can
expand/collapse
- **Inline editing**: Click edit to transform a comment row into an
editable text field with confirm/cancel buttons
- **Delete functionality**: Remove individual comments
- **Send Review to Agent**: Toolbar button with badge showing comment
count, batch-submits all comments across all files/hunks to the Agent
panel
- **User avatars**: Shows the current user's avatar (from their Zed
account) next to comments, falls back to Person icon when not logged in
- **Visual tests**: Added tests for one comment, multiple comments
expanded, and comments collapsed

Note that this is behind a feature flag, so no release notes yet.

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: David Baldwin <baldwindavid@gmail.com>

Richard Feldman , Zed Zippy , and David Baldwin created

0350e0c agent_ui: Add right-click menu item for copying a given agent response's content (#46529)

Click to expand commit body
Release Notes:

- Agent: Added a menu item in the agent panel right-click menu for
copying a given agent's response.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Serhii Melnychuk and Danilo Leal created

5e9634c Batch completion events to reduce notify() calls during streaming (#46802)

Click to expand commit body
## Problem

Profiling showed that during agent streaming, `thread.rs:1393:23` was
appearing constantly as a hotspot. The issue was that every single token
from the model triggered:
1. `this.update(cx, ...)` 
2. `handle_text_event()` (or thinking/redacted_thinking)
3. `cx.notify()`
4. UI re-render

This created significant foreground thread pressure, contributing to
~500ms delays visible in the profiler.

## Solution

Batch all immediately-available events using `now_or_never()` and
process them in a single `update()` call with one `notify()` at the end.

This approach is deterministic - it processes exactly what's available
right now, adapting naturally to network speed:
- When tokens arrive slowly, you get one at a time
- When they arrive in bursts, they batch automatically

## Changes

- Remove `cx.notify()` from `handle_text_event`,
`handle_thinking_event`, and `handle_redacted_thinking_event`
- Batch events in the streaming loop using `now_or_never()`
- Call `cx.notify()` once per batch instead of per-event
- Keep `cx.notify()` in `handle_tool_use_event` for immediate tool
feedback

Release Notes:
- Improve streaming tool call performance by batching UI updates.

Richard Feldman created

993bbf5 html: Exclude all brackets from bracket colorization (#46808)

Click to expand commit body
Closes #45755

Rainbow brackets in HTML files do not really make sense - a tag is
always enclosed in angled brackets. With our current approach, that
means that we will highlight all brackets in HTML files with the same
color, because well, these angled brackets do not quite behave like in
other languages.

Hence, let themes color this again and just exluce HTML angled brackets
from rainbow bracket colorization, as it is no real rainbow bracket
colorization anyway.

Release Notes:

- N/A

Finn Evers created

c67328a languages: Separate control flow keywords for Shell Scripts (#46722)

Click to expand commit body
Part of https://github.com/zed-industries/zed/issues/9461. Similar PRs:

- https://github.com/zed-industries/zed/pull/39683
- https://github.com/zed-industries/zed/pull/39801


## Release Notes:

- Added the ability to separately highlight control flow keywords for
Shell Scripts for users and theme authors via the `keyword.control`
syntax property.

## Screenshots

| **Before** | **After** |
|:--:|:--:|
| <img width="719" height="860" alt="image"
src="https://github.com/user-attachments/assets/1e509e7b-a197-4fb0-a5da-bd3669b6bcd6"
/> | <img width="718" height="855" alt="image"
src="https://github.com/user-attachments/assets/9c5e253d-bfd6-4fe7-9e30-95af1b260fdf"
/> |

Cole McAnelly created

8150d59 agent: Fix terminal command truncation in confirmation dialogs (#40570)

Click to expand commit body
Closes #40322

When users run multi-line terminal commands, the confirmation dialog was
only showing the first line with '- N more lines' truncated. This meant
dangerous commands like 'rm -rf' or 'sudo' operations could be hidden
from view, creating a security risk.

Now terminal commands always display in full, with scroll support for
very long commands (20+ lines) to keep the confirmation buttons visible.

Other tools continue using truncation for better UI efficiency since
they don't pose the same security concerns.

Release Notes:

- Agent: Fixed terminal command truncation in the agent panel to better
expose long commands (e.g., potentially dangerous multi-line commands
are now fully visible before execution)

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>

Miguel Cárdenas , Danilo Leal , and dino created

8e8e88c Add sponsor button to main Zed repo (#46807)

Click to expand commit body
Adds a Github Sponsor button to the main Zed repo

Release Notes:

- N/A

morgankrey created

9621fac agent_ui: Queue prompts by default when sending them while generating (#46797)

Click to expand commit body
This PR makes queueing a prompt the default behavior when sending a new
one while there's an on-going generation. You can still send a prompt
that will immediately interrupt the agent with the `cmd-shift-enter`
keybinding, though, which preserves the current behavior.

The main motivation for this change is to make the queueing not only
more discoverable, but more useful as well, as we're parting from the
assumption that most of the time, what you want is to queue it as
opposed to interrupting it (even though it's still possible to do either
through the keybinding I mentioned above or simply by stopping the
generation and sending a new one).

Here's a quick video:


https://github.com/user-attachments/assets/37f92433-70ef-459f-98ff-41ed80e3e43f

In the video, I show sending one prompt and then sending two others that
fall straight into the queue. Then, in the middle of the generation of
my first prompt, I use the `cmd-shift-enter` keybinding to send a prompt
immediately, interrupting the agent, effectively being sent in front of
the queue.

Release Notes:

- Agent: Made queueing prompts the default behavior when sending them
while there's an on-going generation.

Danilo Leal created

9e44d92 Bump Zed to v0.221 (#46804)

Click to expand commit body
Release Notes:

- N/A

Joseph T. Lyons created

ca23fa7 copilot: Un-globalify copilot + handle it more directly with EditPredictionStore (#46618)

Click to expand commit body
- **copilot: Fix double lease panic when signing out**
- **Extract copilot_chat into a separate crate**
- **Do not use re-exports from copilot**
- **Use new SignIn API**
- **Extract copilot_ui out of copilot**

Closes #7501

Release Notes:

- Fixed Copilot providing suggestions from different Zed windows.
- Copilot edit predictions now support jumping to unresolved
diagnostics.

Piotr Osiewicz created

cd12d45 agent: Initial support for ACP session listing (#46796)

Click to expand commit body
Feature flagged for now as we test this out with actual agents to see if
we need to provide any more feedback to the RFD before committing to the
current setup.

Release Notes:

- N/A

Ben Brandt created

f1fd0ab remote: Fix not being able to cancel in connecting state (#46789)

Click to expand commit body
Release Notes:

- Fixed being unable to cancel remote connections while still connecting
to the remote server

Lukas Wirth created

55a7a93 collab: Bump minimum required version to collaborate from 0.204.1 to 0.220.0 to accomodate for project search RPC changes (#46715)

Click to expand commit body
cc @maxdeviant

Release Notes:

- N/A

Piotr Osiewicz created

6c5da3d outline: Enable scrollbar in outline view picker (#46774)

Click to expand commit body
Release Notes:

- Added scrollbar in outline view picker

Xiaobo Liu created

db2f2ad agent: One Thread History (#46785)

Click to expand commit body
This makes sure that all of the work we do for caching/refreshing
session history is reused everywhere we need to access the list.

Very important for external agents so we aren't rerequesting history on
every search or recent list update. Puts the reloading of history in one
place

Release Notes:

- N/A

Ben Brandt created

b5242ab vim: Fix subword motion near end of line (#45908)

Click to expand commit body
Fixes subword motion incorrectly jumping to next line when near end of
line. Updates boundary detection to use exclusive boundaries with
need_next_char parameter, matching regular word motion behavior.
Refactors word and subword motion to share boundary detection logic.

Closes #17780

Release Notes:

- Fixed subword motion incorrectly jumping to the next line when near
the end of a line

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>

Lionel Henry and dino created

1d366b3 agent_ui: Improve UX for discarding partial edits (#46752)

Danilo Leal created

c35bbaa Revert "Clean up image resources for the current window (#45969)" (#46779)

Click to expand commit body
This reverts commit 94faaebfec5e46afa6d3aee5372cbbdb33b97c33.

The logic changed in the [original
PR](https://github.com/zed-industries/zed/pull/45969) is either
misplaced or lacks a counterpart that reacts on `gpui::Image` drop one
way or another.

The change was dropping the texture out of the global rendering atlas
when an image preview tab was disposed of, while in reality, another
instance (agent panel or another image preview tab) could require the
very same atlas entry to be rendered meanwhile.

Currently, only `RetainAllImageCache` in Zed does any kind of image
cleanup, and any other image usages will leak memory.
What makes it harder is that the atlas entry needs to live as long as a
particular `Arc<Image>` lives, and some public `gpui` API expects this
type to stay:

https://github.com/zed-industries/zed/blob/e747cfc955e8cfd9327d8d6b8d617cf1d3a6bcaa/crates/gpui/src/platform.rs#L1851-L1866

For image viewer in particular, we need to consider why
`RetainAllImageCache` is not used there; for the global, normal fix, we
need to consider ways to have `cx` and `window` and a way to react on
`Image` drop.
As an option, we could break the `gpui` API (as it [happens
periodically](https://github.com/zed-industries/zed/issues/46183)
already) and use `Entity<Image>` instead of `Arc`, then react with
`cx.on_release_in` for each such image.

Closes https://github.com/zed-industries/zed/issues/46755
Closes https://github.com/zed-industries/zed/issues/46435

Release Notes:

- Fixed panics on concurrent image handling

Kirill Bulatov created

2127b8d remote: Fix ACP agents not working in docker (#46778)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/45165

Release Notes:

- Fixed external agents not working in docker remotes

Lukas Wirth created