Commit Graph
40610 Commits
Author SHA1 Message Date
richerfu 484bcbfea6 feat(gpui): Allow building gpui against ohos (#64579)
# Objective

This PR will allow to develop and use gpui ohos platform's crate.We need
to use ohos instead of linux logic.

## Solution

- Avoid linux logic when target is ohos.
- Add gesture for ohos.

## Testing

I've already test it in HarmonyOS emulator and physical HarmonyOS
device.

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

I made a gpui backend crate for OpenHarmony
[gpui-ohos](https://github.com/ohos-rs/gpui-ohos) and Using it to
develop an application which already publish into Huawei store for a
long time.

Here is [source code](https://github.com/richerfu/nearsend/pull/14)

Here is a video to show it.



https://github.com/user-attachments/assets/26efe4f7-d5ef-473f-8dbd-e30ab14ec186


---

Release Notes:

- [GPUI] N/A
2026-10-26 15:29:14 +00:00
Smit Barmase bed9563afc gpui_apple: Keep the checkout path out of compiled Metal shaders (#66166)
After #65994, `corgi run` started failing on my machine with Xcode 27
because the compiled Metal shader library contained the checkout path,
which corgi rejects.

My setup:
- macOS 27.0.1 on Apple Silicon
- Xcode 27.0 (27A266a)
- corgi 0.1.83, with the repository's `corgi.toml`

The shader source is already staged in `OUT_DIR`, but Metal builds can
also embed the tools' working directories. Run both `metal` and
`metallib` from `OUT_DIR` instead of the crate directory.

A before/after check with a minimal shader on Xcode 27 confirmed that
compilation and linking succeed in both cases, and this change removes
the checkout path from the generated library. I haven't tested Xcode 26.

Release Notes:

- N/A
- [GPUI] N/A
2026-10-26 14:21:35 +00:00
Xin Zhao bd9aa0ac05 title_bar: Fix missing Git information for repository subfolders on Windows remotes (#66142)
## Summary

Fixed a bug where the title bar failed to show the Git repository,
worktree, and branch names when the opened folder was a subfolder of a
Git repository in a Windows remote project accessed from a Unix client.

The example below shows `vaspin` as the Git repository and
`vaspin/src/vaspin` as the opened folder:

|Local and Unix Remote|Windows remote before|Windows remote after|
|:--:| :--: | :--: |
|<img width="284" height="120" alt="image"
src="https://github.com/user-attachments/assets/0c499807-1399-434b-8154-a7fdcaa1087d"
/>|<img width="298" height="146" alt="image"
src="https://github.com/user-attachments/assets/0b9f716b-0ce2-4cf5-bfc0-e9d5e20f29ea"
/>|<img width="352" height="161" alt="image"
src="https://github.com/user-attachments/assets/7c7eb179-fec7-4dfd-bf6d-c288ac285e00"
/>|


## Testing

Tested locally; the comparison is shown above.

## Self-review

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

Release Notes:

- Fixed missing Git repository, worktree, and branch names in the title
bar for Windows remote projects opened in a repository subfolder.
2026-10-26 13:51:27 +00:00
Agus Zubiaga 182d15a629 icons: Add SquareR icon (#66168)
## Summary

Adds a `SquareR` icon to `IconName`, matching the existing `SquarePlus`,
`SquareDot`, and `SquareMinus` status badges. It's meant for marking
renamed files in diff and changes lists. The artwork is by Danilo.

No Zed code uses it yet; this only adds the icon.

## Testing

- `cargo check -p icons`
- Rendered the SVG to confirm the artwork.

## Self-review

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

Release Notes:

- N/A
2026-10-26 13:46:57 +00:00
Smit Barmase 60919b0248 workspace: Don't let focus follows mouse steal focus from single-line inputs (#66167)
Closes #62822
Closes #63437
Closes #63795
Closes #59181

With `focus_follows_mouse` on, renaming or creating a file in the
project panel cancels itself as soon as the mouse rests on the panel or
a pane. Focus moves away and the rename field treats that as "done".
Terminal tab rename and a few other inline inputs have the same problem.

Now focus follows mouse leaves focus alone while a single-line editor is
focused, until you press Enter or Escape or click elsewhere.

Approaches considered:
- Skip when the hovered area already contains focus: fixes hovering the
project panel itself, but not when the context menu closes over a pane.
- Have the project panel opt out while editing: works, but every other
inline input would need the same.
- Only react to real mouse movement: still breaks as soon as you nudge
the mouse.

Release Notes:

- Fixed renaming files, creating files and renaming terminal tabs being
cancelled when `focus_follows_mouse` is enabled and the mouse moves.
2026-10-26 13:45:26 +00:00
Kunall Banerjee 4d7b2d05ea language: Refresh diagnostic endpoints on every seek (#56003)
Hoists the call out of the `highlights` branch so it always runs after a
seek (it’s [already internally
guarded](https://github.com/zed-industries/zed/blob/5dd9082d05/crates/language/src/buffer.rs#L5633-L5636)
on `diagnostic_endpoints` being `Some`, so it’s a no-op when diagnostics
are off). This keeps diagnostic state fresh across seeks triggered by
`BlockChunks::advance` past code-lens blocks, so short `Unnecessary`
regions wholly inside the post-block range now dim correctly.

Self-Review Checklist:

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

Closes #55975.

Release Notes:

- Fixed unnecessary-code dim sometimes disappearing when `code_lens` and
`semantic_tokens: "full"` are both enabled
2026-10-26 13:30:51 +00:00
Lukas Wirth 979cd3fdf0 gpui: Keep Unicode separators on one line on Windows (#66159)
## Summary

DirectWrite treats U+2028 (line separator) and U+2029 (paragraph
separator) as mandatory line breaks even with word wrapping disabled.
GPUI expects no line breaks in its shaping, and our windows
implementation actually errors due to this, which causes a follow up
assertion to fail.

Adapt the segment-and-join approach already used by the Cosmic Text
backend for Windows: shape segments ending in these separators, then
concatenate their glyphs horizontally.

Closes DELTA-1WR
Closes DELTA-1WS

Release Notes:

- [GPUI] Fixed a Windows text-shaping crash caused by Unicode line and
paragraph separators.
2026-10-26 13:23:46 +00:00
Ben Brandt 23973bd49f agent: Number ACP tool call location lines from 1 (#66110)
ACP numbers lines from 1, and agents send tool call locations that way.
For example, Claude's adapter sends a Read's `offset ?? 1` and an Edit
hunk's `newStart`. Zed read a location's `line` as a 0-based row, so
following an external agent, or opening a location from a tool call,
landed one line below the reported line.

Zed's own Edit, Grep, and Read tools sent 0-based location lines to
match, which was off by one for every other location.

This PR:

- Reads a location's line as 1-based when resolving it (`acp_thread`)
and when opening it from the thread view (`agent_ui`).
- Sends 1-based location lines from the native Edit, Grep, and Read
tools.

Only the ACP `ToolCallLocation` changes. What the model sees and sends
was already 1-based: Read's `start_line`/`end_line` inputs, its numbered
output, and Grep's `#L` links. Locations aren't persisted for native
threads, so there is no stored data to migrate.

Release Notes:

- Fixed external agents' tool call locations opening one line below the
line the agent reported.
2026-10-26 12:42:33 +00:00
Smit Barmase 3318784374 workspace: Fix docks ignoring focus_follows_mouse changes until restart (#66161)
Found while investigating
[#62822](https://github.com/zed-industries/zed/issues/62822).

If you turned on `focus_follows_mouse` while Zed was already running,
docks wouldn't pick it up until you restarted. Panes worked fine right
away, but hovering a dock (like the project panel) did nothing.

The dock read the setting once when it was created and never updated it
after that. Now it just reads the setting when it renders, which is what
the project panel already does for its blank area.

Release Notes:

- Fixed changes to `focus_follows_mouse` not applying to docks until Zed
was restarted.
2026-10-26 12:41:20 +00:00
Danilo Leal e0f4f28001 ui: Make submenus steadier and more reliable (#66066)
This PR adds some refactoring to the submenu implementation mainly to
make it feel more reliable and steady. We were previously doing a few
unnecessary calculations that'd make the submenu feel finicky
particularly when it opened on the right. Now, we're essentially better
calculating the trigger's bounds and using that as the main point of
reference, without having to calculate the entire parent menu to find
the trigger.

Release Notes:

- N/A
2026-10-26 11:40:46 +00:00
yaroslavandSmit Barmase 5e548b8ad9 workspace: Fix panel buttons not working while a dock panel is zoomed (#66119)
## Summary

I use Claude Code in a terminal thread with the agent panel zoomed, and
I couldn't get back to the project panel by clicking its button in the
status bar: the button flickers and I stay in the agent panel. The
keybinding for the same action (`cmd-1` in the JetBrains keymap) works
fine. It happens with any two panels in the same dock, not only the
agent panel.

The cause: before dispatching its action, a panel button focuses the
dock's focus handle (added in #34590 so the action works when nothing is
focused yet). But when a panel is zoomed, the dock isn't rendered,
because the panel is drawn in the zoom layer instead. So the dock's
focus handle isn't in the rendered frame, the action is dispatched from
the window root, and it never reaches the workspace's handlers.

The fix: when the dock has a zoomed panel, the button focuses that panel
instead, since it's on screen. Otherwise nothing changes.

AI helped me find the cause and write the tests; I've reviewed and
tested the change myself.

## Testing

Tested manually on macOS:

1. Open the agent panel in the left dock (the project panel is in the
same dock).
2. Zoom the agent panel.
3. Click the Project Panel button in the status bar.

Before: nothing happens. After: the project panel opens and gets focus.

I also added two tests that switch from a zoomed panel to another panel
in the same dock: one through the panel button path and one through the
action. The button test fails without the fix.

## Self-review

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

Release Notes:

- Fixed status bar panel buttons doing nothing when another panel in the
same dock is zoomed

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-10-26 11:29:16 +00:00
Kirill Bulatov 087340e2d7 Fix panic on cmd-q (#66158)
Closes https://github.com/zed-industries/zed/issues/57664

Updates `crash-context` transitive dependency (ergo the `patch` section)
to include https://github.com/rust-minidump/minidump-writer/pull/249
fix: given the latest release was a few months ago, decided to use the
git SHA pointer.

Release Notes:

- Fixed "Zed quit unexpectedly" when quitting via ⌘ + Q
2026-10-26 11:26:43 +00:00
Kirill Bulatov 96b617fa37 Cleanup history items for deleted entries (#65972)
Follow-up to
https://github.com/zed-industries/zed/pull/65660#issuecomment-6268647871

Release Notes:

- N/A
2026-10-26 11:20:26 +00:00
Kirill Bulatov f14592c4a5 Require macOS 12 and SDK 26 (#65994)
Closes https://github.com/zed-industries/zed/issues/9307

Use SDK 26 and require newer macOS.
The latter allows to remove a few deprecated API usages.

Release Notes:

- [GPUI] BREAKING: bumped minimum macOS version to 12 (Monterey)
2026-10-26 11:20:07 +00:00
Kirill Bulatov 1808df02c0 Remove block dependency from the tree (#65942)
Closes https://github.com/zed-industries/zed/issues/22408

See also
https://github.com/zed-industries/scap/commit/b5c86ec58dd4b6b7732bf6ac8be03d6b1f190a82
that makes all macOS dependencies optional: we do not use these in Zed
anyway, and have `default-features = false` that allow to remove all
transitive `block` dependencies from the tree.

Adjust the test to ensure no such dependencies can appear later.

Release Notes:

- [GPUI] Removed `block` dependecy from the tree
2026-10-26 11:20:06 +00:00
Lukas Wirth 2a74c8dff6 gpui: Remove unused hash-based text layout cache (#66152)
The hash-based text layout interface was introduced for an earlier Delta
editor prototype, but neither Zed nor Delta has any remaining callers.
Let's remove it and re-introduce it proper when needed.

Release Notes:

- [GPUI] Removed an unused hash-based text layout cache interface.
2026-10-26 10:49:55 +00:00
Lukas Wirth 772a8a9100 gpui: Remove synchronization from window text layout (#66147)
## Summary

There isn't really any reason for us to use synchronization here at this
layer. `WindowTextSystem` gains little from being `Send`, allowing us to
simplify this a bit.


Release Notes:

- [GPUI] Improved per-window text layout performance by removing
unnecessary synchronization.
2026-10-26 10:17:00 +00:00
Smit Barmase eee7501970 agent: Remove checkpoints (#65989)
Closes #62283
Closes #58444
Follow-up #65304
Supersede #64000, #62301

Before every message, the agent snapshotted every Git repo in the
project and waited for it before sending the prompt, and every Git
status change during a turn took another one. In large workspaces this
took tens of seconds, and on Windows it could hang forever. #65304
already skipped it for external agents and subagents.

The snapshot only exists for "Restore Checkpoint", which very few people
use, so this removes checkpoints entirely. Putting them behind a setting
would keep the snapshot code and its maintenance around for a feature
few people use.

- Removed:
  - "Restore Checkpoint" button
  - Snapshots before, during and after each turn
  - Git, remote and proto code behind them (proto ids reserved)
  - Checkpoints docs section

- Stays:
  - Editing an earlier message
  - Rejecting the agent's edits
  - Worktree archive snapshots

Release Notes:

- Removed agent checkpoints and the "Restore Checkpoint" button. Taking
a checkpoint before every message made the agent slow to respond, or
hang, in large Git repositories. To undo the agent's changes, reject its
edits or use Git.
2026-10-26 10:10:32 +00:00
Lukas Wirth e645f02245 askpass: Skip the GPG wrapper when GPG is missing (#66143)
A missing binary shouldn't warn.

Release Notes:

- N/A
2026-10-26 09:53:33 +00:00
Manoj skandRemco Smits 08104dc649 git_ui: Add missing tooltips to Git Graph commit details (#66016)
## Summary

- **Close button**: "Close Details Panel" with its keybinding
(`menu::Cancel`). It uses
`Tooltip::for_action_in` with the Git Graph's focus handle, so the
keybinding shown doesn't
change depending on what else is focused (e.g. with the terminal
focused, `Tooltip::for_action`
  showed a different binding than the one that works in the Git Graph).
- **Commit message disclosure**: "Show Commit Message" / "Hide Commit
Message", matching the
  existing "Show/Hide Commit Details" disclosure in the same panel.
- **"View on <provider>" button**: "Open in Browser". The label is
truncated when the panel is
  narrow, so the tooltip also makes the action clear in that case.


**Close button**
<img width="538" height="236" alt="image"
src="https://github.com/user-attachments/assets/524103cc-91ba-4357-974e-23c47d681b74"
/>

**Commit message disclosure**
<img width="316" height="249" alt="image"
src="https://github.com/user-attachments/assets/b9ab5379-29f2-4010-9d7f-7610966d50dc"
/>

 **View on GitHub**
<img width="349" height="114" alt="image"
src="https://github.com/user-attachments/assets/84aabae0-8f84-43d8-9c2a-b4b123ea52f7"
/>
 

Release Notes:

- Improved Git Graph commit details panel by adding missing tooltips to
the close, commit message, and "View on" buttons.

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
2026-10-26 08:10:49 +00:00
Remco Smits 08cbb88a15 git_ui: Fix git graph lagging when toggling commit details panel (#66132)
## Summary

Currently the git graph canvas and ref-label gutter widths were computed
in `render` from `RedistributableColumnsState::cached_container_width`,
which is only updated during prepaint and doesn't notify. When the
commit details panel opened or closed, the graph column was rendered
with the previous frame's container width and stayed stale until
something else triggered a re-render, such as the commit diff finishing
loading or hovering a row.

We now size the canvas and gutter through layout instead, the canvas
fills the graph column with a minimum of its content width, and the
gutter is capped at half the graph column via `max_w(relative(0.5))`.

**Before**:


https://github.com/user-attachments/assets/ee3fcfc6-e392-491c-bd3c-827eb64ecb37

**After**:


https://github.com/user-attachments/assets/518f0c3f-603d-4f99-a391-1ff546ccaf7e

## Testing

You can test this by opening the Git graph for the Zed repository and
scrolling down to a section with a lot of graph lines.

Click a commit to open the commit details panel. You may already notice
some lag, but it's less visible because loading the commit details
triggers several re-renders.

Then close the commit details panel. This is where the lag is most
noticeable. Closing the panel triggers only a single re-render, and that
render still uses the previous frame's cached container width. Updating
the cached width doesn't trigger another re-render, so the graph stays
at its old size until something else does, such as hovering a row.

I also tested that adding/removing columns still works the same, and
shrinking/growing the graph will works.

## Self-review

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

Release Notes:

- Fixed git graph draw lagging behind when opening/closing the commit
view
2026-10-25 21:19:54 +00:00
zhujiatao 876c1b0c5f Fix removal of unloaded project groups (#66127)
## Summary

- Remove project group rows even when no retained workspace backs them.
- Add a regression test for removing an unloaded project group.

## Testing

- `cargo test -p workspace
test_remove_unloaded_project_group_removes_its_row --lib`
- `cargo fmt --check`

## Self-review

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

Release Notes:

- Fixed project entries reappearing in Recent Projects after removal.
2026-10-25 19:22:38 +00:00
Ben Brandt a5c4ca8bf6 agent_servers: Offer ACP v1 subagents behind acp-beta (#66078)
With the `acp-beta` flag on, Zed's ACP v1 `initialize` request
advertises the unstable
[subagents](https://agentclientprotocol.com/rfds/subagents) capability
(`clientCapabilities.subagents: {}`). v1 agents that support it, such as
claude-agent-acp, then report their subagents as child sessions, which
Zed shows as inline cards. Without the flag nothing changes. v2 is
already behind the same flag and has subagents in its baseline.

Release Notes:

- N/A
2026-10-25 08:55:58 +00:00
Ben Brandt c5efa10ddd acp_thread: Use a subagent's latest run for its titlebar status (#66092)
A native subagent that's resumed gets one `spawn_agent` tool call per
run. `AcpThread::tool_call_for_subagent` returned the first, so the
subagent's titlebar showed the first run's failed or canceled marker
instead of the current run's. It now returns the latest. The titlebar is
its only caller.

`test_tool_call_for_subagent_is_its_latest_run` covers a failed first
run followed by a running one, and fails without the change. `cargo
nextest run -p acp_thread -p agent_ui -p agent` (1668 tests),
`./script/clippy` and `cargo fmt` pass locally.

Release Notes:

- N/A
2026-10-25 08:55:49 +00:00
Ben Brandt 78f5a535a3 agent_ui: Keep inline review on the root thread when subagents appear (#66093)
Every thread view made its thread the inline review target when it was
built (`AgentDiff::set_active_thread` in
`ConversationView::new_thread_view`). A subagent's view is built when
the subagent is spawned or announced, not when it's opened. So as soon
as a native or ACP subagent started, inline review in the editor
switched to that subagent's action log and showed only its edits. The
parent's earlier edits disappeared from review.

A subagent's action log is linked to its parent's, and every edit it
records is also recorded there. So only root thread views set the review
target now, and the root's log covers the whole conversation.

`test_subagent_views_keep_the_root_thread_under_review` registers a
subagent and then navigates to its view. Review stays on the root thread
both times. The test fails without the change, and uses a new test-only
`AgentDiff::reviewed_thread`. `cargo nextest run -p agent_ui -p agent -p
sidebar` (1526 tests), `./script/clippy` and `cargo fmt` pass locally.

Release Notes:

- Fixed inline review switching to a subagent's edits when the subagent
started.
2026-10-25 08:55:39 +00:00
Ben Brandt c8995a085a agent_ui: Don't load tool-call-referenced sessions where the subagents RFD applies (#66095)
A tool call carrying Zed's private `_meta.subagent_session_info` makes
the conversation `load_session` the referenced session. That's how Zed
restores native subagents. Some external agents send the same key,
according to #65120, so that path stays for them.

Where the ACP subagents RFD applies, though, subagents are discovered
only through their parent's announcements, and loading one is forbidden.
Loading a referenced child before its announcement would also make the
connection reject the announcement, because the connection already
routes that session.

- `AgentConnection::announces_subagents` says whether the RFD applies:
always on v2, on v1 when Zed advertised `subagents` (behind `acp-beta`),
and never for the native agent.
- `ConversationView::load_subagent_session` does nothing where it
applies.

Without `acp-beta` nothing changes, because no connection announces
subagents.

`test_referenced_subagents_load_only_without_the_subagents_rfd` checks
both cases with a stub connection that supports loading, and fails
without the guard. Existing v1 and v2 tests now assert each connection's
answer. `cargo nextest run -p acp_thread -p agent_servers -p agent_ui -p
agent -p sidebar` (2010 tests), `./script/clippy` and `cargo fmt` pass
locally.

Release Notes:

- N/A
2026-10-25 08:55:28 +00:00
Ben Brandt ad8a62df82 agent_servers: Treat replayed ACP subagent outcomes as history too (#66098)
After a load or resume with replay, #66061 cleared each subagent's
replayed `cancel` grant and running state but kept a replayed idle
outcome (completed, canceled, failed). That exception was there because
claude-agent-acp sent no current state after the response.

claude-agent-acp now sends each replayed subagent's current state after
the response (agentclientprotocol/claude-agent-acp#1423, merged), as the
subagents RFD requires. So Zed now follows the RFD as written: every
replayed work state, outcomes included, is history. Each subagent's
state is unconfirmed until the agent reports a current one. Titles and
transcripts stay.


Release Notes:

- N/A
2026-10-25 08:55:17 +00:00
Ben Brandt 035e6ac2f3 agent_servers: Keep ACP v2 subagent traffic sent before a session/new response (#66096)
An ACP v2 agent can send updates before its `session/new` response; Zed
holds them until the response names the session
(`PendingSessionUpdates`). Only the new session's own updates were
handed over. A subagent it announced in that window was created, but the
subagent's own traffic was discarded when the creation ended.

- `PendingSessionUpdates::take` now also hands over traffic for sessions
the new session announced, and for the sessions those announced, in
arrival order. The subagents RFD requires a child's announcement to come
before its traffic.
- The `new_session` apply loop delivers each held update to its own
session's thread. It used to apply all of them to the new session.

Traffic for a session nobody announced is still dropped. v1 has no
pre-response staging and is unchanged.

`v2_new_session_keeps_subagent_traffic_sent_before_its_response` sends a
child, a nested grandchild announced on the child's stream, traffic for
both, and traffic for an unannounced session, all before the response.
It fails without the change. `cargo nextest run -p acp_thread -p
agent_servers -p agent_ui -p agent -p sidebar` (2010 tests),
`./script/clippy` and `cargo fmt` pass locally.

Release Notes:

- N/A
2026-10-25 08:55:04 +00:00
Kirill Bulatov 18f9d7e731 Fix pwsh-related issues with local and remote env variables detection (#66097)
Closes https://github.com/zed-industries/zed/issues/65931
Closes https://github.com/zed-industries/zed/issues/66021
Closes https://github.com/zed-industries/zed/issues/66094

Follow-up to https://github.com/zed-industries/zed/pull/65065

Release Notes:

- Fixed pwsh-related issues with local and remote env variables
detection
2026-10-25 08:21:37 +00:00
347f171a3f util: Preserve path separators when parsing file positions (#66089)
## Summary

Fix Windows file links into WSL projects, including Agent links and `zed
path:line`. Preserve the original path prefix in
`PathWithPosition::parse_str` instead of rebuilding it with the host
platform's separator.

Closes #65323. Fixes a regression introduced in #64748.

Windows regression test output before the fix:

```text
 left: "/home/user/project/src\\main.rs"
right: "/home/user/project/src/main.rs"
```

The test passes after the fix. It compares raw `OsStr` values because
Windows `Path` equality hides separator differences.

## Testing

- Manually tested the patched Windows client connected to WSL: clicking
the previously failing Agent link opens the correct file as expected.
- Verified that the development CLI opens `llm_engine.py:49:7` at line
49, column 7 in the Windows GUI.
- Utility tests: **122 passed** on Linux; path-position tests: **7
passed** with each Windows GNU/MSVC target.
- Windows client, CLI, and matching WSL server builds passed, along with
Clippy, formatting, and `git diff --check`.

To verify, connect a patched Windows client to a WSL project. Have the
Agent produce a Markdown link to an existing file using its absolute WSL
path with `:line` or `:line:column`. Click it and verify the file and
cursor position. Also check the same path through the matching
development CLI.

## Self-review

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

Release Notes:

- Fixed file links with line numbers failing to open WSL files when
using Zed on Windows.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-10-24 18:06:50 +00:00
Ben Brandt af4948a164 agent_servers: Fix ACP v2 subagent config being hidden instead of read-only (#66088)
Fixes the `main` failure in `v2_subagent_config_options_are_read_only`
(Linux, macOS and Windows `run_tests` since #66058).

#66059 and #66058 passed CI separately, but together they disagree.
`AcpV2Connection::session_config_options` returned `None` for a subagent
before reaching #66058's read-only provider. So that provider was never
used: subagents showed no configuration, and the #66058 test failed.

- Subagents now get `ReadOnlyConfigOptions`, which refuses
`set_config_option`. That's what #66059's early return was there to
guarantee.
- The provider is chosen with the same `is_subagent` check that close
and reopen use, instead of a second rule reading the thread's
`parent_session_id`.
- #66059's test now expects a read-only provider instead of none.

`cargo nextest run -p acp_thread -p agent_servers -p agent_ui -p agent
-p sidebar` (2009 tests, including both subagent config tests),
`./script/clippy` and `cargo fmt` pass locally.

Release Notes:

- N/A
2026-10-24 17:19:26 +00:00
Ben Brandt d93bf74085 agent_ui: Show ACP subagents as inline cards (#66040)
ACP subagents now get the same inline card as native subagents. The
anchor is the parent's outgoing session message to the subagent, which
claude-agent-acp now reports when it launches one
(agentclientprotocol/claude-agent-acp#1405). The card replaces that
message's "To …" row.

- **One card per subagent for now.** The first message the parent sends
to one of its own subagents becomes the card; later messages to the same
subagent stay rows. Until session messages can name each other
(agentclientprotocol/agent-client-protocol#2465), nothing links a
message to its part of the subagent's transcript or to its outcome, so
the card covers the whole subagent. claude-agent-acp sends one such
message per subagent, at the launch.
- **Status** comes from the subagent's reported state:

  | Reported state | Card |
  |---|---|
  | running, requires action | Running |
| idle, with no stop reason, `end_turn`, or one this version doesn't
know | Completed |
  | idle, `cancelled` | Canceled |
| idle, `error`, `refusal`, `max_tokens`, `max_turn_requests` | Failed,
with the error text |
  | no state yet, `unknown` | Unknown (new status) |

- **Title:** the parent's label for the subagent wins over the
subagent's own title, as on the permission row.
- **Stop** is offered only while the subagent runs and only when its
parent advertises `cancel` for it. The subagent's own titlebar now
follows the same rule. It also showed a failed or canceled ACP subagent
with a green check, because it read the outcome from a native tool call
that ACP subagents don't have.
- **Expansion** is keyed by a new `SubagentCardId` (a tool call or a
session message), so cards no longer need a tool-call ID.
- **Thread search** skips a message drawn as a card, since the card
doesn't show its text.
- **Redraw fix:** `update_subagent_association` only notified the
subagent's thread, so views that read the association from the parent's
side (the card, the permission row's label) didn't redraw when it
changed. It now emits `AcpThreadEvent::SubagentAssociationUpdated`.

Release Notes:

- N/A
2026-10-24 13:25:58 +00:00
Ben Brandt a8acb01f21 agent_ui: Show read-only ACP subagent configuration (#66058)
Show the actual configuration reported by exposed ACP subagents without
offering controls their sessions do not support.

- Register an empty config provider when a child is announced, so the
first asynchronous snapshot reaches the UI in both ACP versions.
- Expose a read-only provider that rejects configuration mutations
before sending a wire request.
- Render child settings as labels below the transcript, including
boolean values, while leaving the message composer unavailable.
- Block picker/cycling actions and stale controls from changing child
settings or saving defaults.
- Test snapshot replacement, watcher updates, parent isolation, and
read-only behavior.

Protocol clarification:
https://github.com/agentclientprotocol/agent-client-protocol/pull/2468

Claude adapter implementation:
https://github.com/agentclientprotocol/claude-agent-acp/pull/1417

Release Notes:

- N/A
2026-10-24 13:25:45 +00:00
Ben Brandt c07b87624c acp_thread: Follow the subagents RFD when ACP subagents are cancelled (#66057)
The RFD distinguishes two cases:

1. **Zed cancels a session's work.** Zed must answer that session's
pending permission requests with `cancelled`.
2. **A descendant's work stops because an ancestor was cancelled.** Its
requests stay answerable until it reports idle with `cancelled`; then
Zed cleans them up as if it had cancelled the descendant directly. Idle
with another stop reason does not withdraw requests, which may belong to
background work that continues.

Changes, all limited to ACP subagents (threads with a subagent
association):

- **Cancel needs permission.** `AcpThread::cancel` refuses an ACP
subagent unless its parent advertises `cancel` for it. The UI already
hides Stop without it (#66040); this makes the rule hold for any caller.
- **Direct cancel answers every request.** Cancelling an ACP subagent
now also answers its tool-call permission requests, which only a v1
subagent makes; before, only generic requests were answered. Other
sessions with reported activity keep their current behavior:
`test_reported_activity_survives_rejection_and_idle_keeps_unrelated_actions`
relies on a receipt session keeping tool-call requests.
- **Cleanup on a reported cancellation.** When an ACP subagent reports
idle with `cancelled`, Zed answers its pending permission requests,
dismisses its elicitations, and marks its unfinished tool calls
cancelled (`cancel_local_actions`). Zed never cascades a cancel to
subagents itself; it learns which ones stopped from their reported
state.

Release Notes:

- N/A
2026-10-24 13:25:33 +00:00
Ben Brandt 536ec0ea9d agent_servers: Refuse config changes and reopening for ACP v2 subagents (#66059)
The v2 connection already refused to close a subagent. It now also:

- **Offers no config options for a subagent.** A `config_option_update`
for a subagent session used to create config options on its
`AcpSession`, and `session_config_options` then handed them out. Nothing
reached the wire: subagent views have no message editor, where the
selectors are drawn, and setting an option through the config keyboard
actions failed validation because subagents have no `session_owners`
entry. This makes the refusal explicit instead of relying on that.
- **Refuses load and resume for a subagent it routes.** `open_session`
only checked root sessions, so it would have sent `session/resume` for a
known subagent.

`AcpSession` gains `is_subagent`, set only when a parent announces the
session. All three checks (close, config, open) read it through one
helper. The previous close check read the thread's association instead,
but `open_session` can run while the session's thread is being updated
(`v2_resume_sdk_shares_compatible_opens_and_rejects_context_or_history_changes`
reopens from inside the thread's update), and reading the thread there
panics.

Release Notes:

- N/A
2026-10-24 13:25:10 +00:00
Ben Brandt b0cac499da agent_servers: Order ACP v1 load responses and treat replayed subagent state as history (#66064)
ACP v1 awaited `session/load` and `session/resume` responses with
`block_task`, so the SDK kept delivering the agent's later messages
before Zed had applied the response. A subagent's current state sent
right after a load response could be applied first and then overwritten
by the response.

- **Ordered responses:** load and resume now use `ordered_response`.
Once the response arrives, the agent's later messages wait until
`open_or_create_session` has applied it, as v1 `new_session` and v2
already do. An abandoned load releases them before closing its session,
which needs the agent's reply.
- **Replay boundary:** a successful v1 load, which replays history, ends
with `invalidate_replayed_subagent_state`, as a v2 resume with replay
does. v1 resume doesn't replay, so it's unchanged.

Release Notes:

- N/A
2026-10-24 13:24:57 +00:00
Ben Brandt 02a04e06e2 agent_servers: Treat replayed ACP v2 subagent state as history (#66061)
When a load or resume replays history, its successful response is the
freshness boundary for subagents. Work state and `cancel` grants
reported during the replay are history: they may stay visible, but must
not confirm current activity or allow cancelling until the agent reports
them again after the response. Before this change, a replayed
`subagent_update` with `capabilities.cancel` and a replayed
`state_update: running` for the subagent left Zed showing it as running
and cancellable.

- **Boundary:** when a v2 resume with `replayFrom: start` succeeds,
`AcpThread::invalidate_replayed_subagent_state` clears every subagent's
`cancel` grant, recursively for nested subagents. A replayed running or
requires-action state becomes unconfirmed; a replayed outcome
(completed, canceled, failed) stays, since it confirms no activity.
claude-agent-acp replays each subagent's outcome and sends nothing after
the response. Titles, descriptions and transcripts stay.
- **Ordering:** the call sits in the ordered response handler, next to
the existing check that the agent reported the parent's current state.
That handler applies after the replay and before any update sent after
the response, so fresh snapshots are kept.
- **Resume without replay is unchanged:** the RFD treats updates sent
before its response as current.

Release Notes:

- N/A
2026-10-24 13:24:56 +00:00
Oleksiy Syvokon 79fe6a645f gpui: Add a way to write credentials only if none exist (#66062)
Apps that keep a shared secret in the system keychain, such as an
encryption key, create it on first use. With only `read_credentials` and
`write_credentials`, two processes can both find no secret, and the
second write then replaces the first. Data encrypted with the replaced
secret can no longer be read.

Add `write_credentials_if_not_exists`, which returns `true` if it wrote
the credentials and `false` if they already existed. It never replaces
an existing secret.

On macOS this is a single atomic `SecItemAdd`: an existing item with the
same URL and username makes it return `false`. Other platforms and
providers get a default that reads and then writes. That default never
overwrites credentials it can see, but two concurrent callers can still
race. A failed read, including a cancelled Keychain prompt, never
writes.

`write_credentials` keeps its update behavior.



Release Notes:

- [GPUI] Added `write_credentials_if_not_exists`, which never replaces
existing credentials and is atomic on macOS
2026-10-23 21:59:20 +00:00
Oleksiy Syvokon abd9b3cbd2 gpui_apple: Distinguish missing creds from a cancelled prompt (#66060)
On macOS and iOS, `read_credentials()` returned same value both when no
credentials were saved and when the user cancelled the Keychain access
prompt. Callers treated a cancelled prompt as missing credentials and
stored new ones, which can overwrite a shared secret such as an
encryption key.

The fix is to return `KeychainError::UserCanceled` instead. This matches
Linux, where a dismissed unlock prompt is already an error. Existing Zed
callers already treat read errors as missing credentials, so their
behavior is unchanged.

Release Notes:

- [GPUI] Fixed a cancelled macOS Keychain prompt being reported as
missing credentials
2026-10-23 21:59:19 +00:00
Bennet Bo Fenner 9f305aaf88 gpui_macos: Handle null open and save panels (#66042)
AppKit can return nil from `+[NSOpenPanel openPanel]` despite its
nonnull annotation. The generated objc2 binding treats that as a fatal
Rust panic, crashing the application before callers can handle the
failure. So far we have seen 134 crashes in stable Zed.

Use nullable retained return values for the open and save panel factory
messages. If panel creation fails, return a descriptive error through
the existing result channel. Zed workspace callers already display these
errors and fall back to the built-in picker.

Closes ZED-C1J
Closes ZED-C15
Closes ZED-CAR

Release Notes:

- [GPUI] Fixed a crash when macOS fails to create a native open or save
dialog.
2026-10-23 15:02:03 +00:00
Bennet Bo Fenner 604a0ff023 open_ai: Preserve typed chat completion stream errors (#66038)
Keep provider rejections, decode errors, and read failures typed instead
of boxing them into anyhow errors, so callers retain their
classification for retries and error reporting.

Release Notes:

- Fixed error classification for OpenAI-compatible chat streams so
retryable provider failures remain recognizable.
2026-10-23 13:16:35 +00:00
Ben Brandt e96ffb0fd3 acp_thread: Show ACP session messages in the transcript (#66028)
The RFD reports messages between sessions, such as a parent delegating
work to its subagent, as `session_message` and `session_message_chunk`
updates. Each transcript gets its own view: the parent's outgoing
message, the subagent's incoming one. Zed dropped both.

- **Transcript entry.** Session messages are a new
`AgentThreadEntry::SessionMessage`, kept separate from user and
assistant messages. They reuse the keyed-message path: an upsert
replaces content, a chunk appends, and a message can start with a chunk.
Participants come only from `session_message` upserts: one that an
upsert omits keeps its earlier value, and a known participant cannot
change. Chunks carry only content, so the participant fields that schema
1.12.0 still has on chunks are ignored, following the RFD revision in
agentclientprotocol/agent-client-protocol#2465. v1 replaces message
metadata where v2 patches it by key.
- **Row.** It reads "To <recipient>" or "From <sender>". A subagent is
named with its parent's title for it, as on its permission card, and the
root session as "Main Agent". The name opens that session's thread; a
session the conversation never learned about shows as "Unavailable
Session" without a link.
- **v1 stays off.** Like `subagent_update`, v1 session messages are only
applied when Zed advertised the `subagents` client capability, which it
does not do yet.
- **Resume replay test.** A separate commit adds
`v2_resume_replay_delivers_subagent_history`. It confirms that a
subagent's history replayed during a v2 resume reaches the subagent.
#65976's description said this wasn't handled; resume registers the
parent before sending `session/resume`, so it works.

Follow-up: the same RFD revision adds optional `senderMessageId` and
`recipientMessageId` so each view can name the other. Once a schema
release includes them, the row will jump to the linked entry instead of
opening the thread, and per-delegation subagent cards can build on the
same links.

Release Notes:

- N/A
2026-10-23 12:43:26 +00:00
Bennet Bo Fenner 91d3b962ae gpui_linux: Use the patched oo7 0.6 branch (#66035)
Use the Zed-maintained `oo7` 0.6 fork pinned to commit
`731c1215edb6905876c6137ab300428c7b8d7c13` for GPUI's Linux credential
backend. The commit is based on upstream `0.6.0` and returns
`Error::IO(UnexpectedEof)` when the Secret Service `Completed` signal
stream ends before yielding a message, instead of panicking.

## Validation

- `cargo check --locked -p gpui_linux` — passed.
- On the `oo7` `0.6` branch: `cargo check -p oo7 --lib` passed; `cargo
test -p oo7 --lib` passed (27 tests).

## Suggested .rules additions

- Treat `None` from D-Bus signal streams as stream termination and
handle it as an error rather than unwrapping.

Release Notes:

- [GPUI] Fixed a Linux keyring panic when the Secret Service prompt
stream ends unexpectedly.
2026-10-23 12:24:10 +00:00
nchendri 1e1f5d7628 Run sandboxed Linux terminals non-interactively (#64439)
Fixes #62449 and #64486

## Summary

- Run Linux sandboxed agent terminal commands with a non-interactive
shell.
- Preserve existing interactive shell behavior for unsandboxed and
non-Linux terminal commands.

## Validation

- cargo fmt --all -- --check
- cargo check -p acp_thread
- git diff --check

Release Notes:

- Fixed Linux agent sandbox terminal commands incorrectly reporting
failure under dash.
2026-10-23 12:15:49 +00:00
Kirill Bulatov b36b283021 Do not read LLM credentials when disable_ai is true (#66029)
Closes https://github.com/zed-industries/zed/issues/65735

Release Notes:

- Fixed LLM credentials being read despite disable_ai being true
2026-10-23 10:32:56 +00:00
Piotr Osiewicz 2214d0a92e debugger: Fix auto-updates for Delve (#66025)
Fixes #63697

## Summary

What problem does this solve, how, and why does this change matter?
Use "Closes #123" for each issue resolved.
Include artifacts produced when testing: before/after screenshots, GIFs,
videos, benchmarks.

## Testing

Manually test your changes; report results, mention platforms if
relevant.
How can reviewers test this easily? Include setup and steps.

## Self-review

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

Release Notes:

- Zed's debugger for Go (delve) will now correctly update to latest
version when there's no user-provided install (previously it'd install
the latest version of Delve and fail to update from there on).
2026-10-23 10:24:23 +00:00
Finn Evers 4f862ffbc6 Cleanup unused workflows and script files (#66024)
Removes a lot of dead code we have floating around here that is no
longer used and has not been for ages.

If we ever need to check something out here again, we can just revert
parts of these. Currently, these just trigger security warnings if
anything and thus are dead weight. Hence removing here.

Drive-by fix of our collab staging deploys as well.

Release Notes:

- N/A
2026-10-23 09:30:55 +00:00
Finn Evers e841324d0d Remove unused GitHub action files (#66019)
We currently do not use nor maintain those files and thus their
dependencies can get outdated fast.

Hence, removing here to keep the repo cleaner.

Release Notes:

- N/A
2026-10-23 09:11:13 +00:00
John D. Swanson 27ea42bf01 Update dependencies to address security vulnerabilities (#65997)
## Summary

Update locked dependencies to incorporate upstream security and
correctness fixes.

## Testing

- macOS arm64: Zed build passed; application launch confirmed.
- Focused dependency-consumer tests and optional QUIC compilation
passed.
- Formatting and diff whitespace checks passed.
- Linux and Windows were not tested locally.

## Self-review

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

Release Notes:

- Updated dependencies to address recent software ecosystem
vulnerabilities.
2026-10-23 08:37:00 +00:00
Smit Barmaseandzed-zippy[bot] fda552edce agent: Fix reading the entire threads database after every thread save (#66015)
Part of #64897. Also fixes the `threads.db` read traffic and lock stalls
reported in [this comment on
#59107](https://github.com/zed-industries/zed/issues/59107#issuecomment-5781374977).

During long agent sessions, Zed kept reading the whole `threads.db` file
in the background. The reporter saw about 150 MB/s of reads.

After every save, we reload the thread list. That only needs small
fields like the title and dates. But some of those fields were added to
the table later, so SQLite stores them after each thread's large `data`
blob, and has to go through the whole blob to reach them. On a 148 MB
test database with 120 threads, one reload read 37,958 pages, which is
the entire file.

This adds an index that holds just the fields the thread list needs.
SQLite now reads the list from the index and skips the blobs, and the
same reload reads 7 pages. The index starts with the dates, so SQLite
also gets the threads in newest-first order without sorting, but that
part is minor. A test checks that SQLite actually uses the index.

Moving `data` to the end of the table would fix it too. But `threads.db`
has no migration tracking, and that change would copy every thread's
blob on first launch. I went with the index since it's safer and doesn't
touch any existing rows.

Saving a thread 200 times in a row on that database (release build):

| | Before | After |
|---|---|---|
| Time per save | 22.2 ms | 2.4 ms |
| CPU time for 200 saves | 4.4 s | 0.47 s |

Memory use stays the same. The index takes about 24 KB, and Zed builds
it once on first launch, in the background. That took about 0.1 s for
148 MB.

Next, I'd like to update only the saved thread in the list, so we don't
reload the whole list after every save. That'll be a follow-up PR.

Release Notes:

- Improved CPU usage and disk reads while the agent is working,
especially with a long thread history.

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-10-23 08:23:02 +00:00