Commit Graph
769 Commits
Author SHA1 Message Date
Danilo Leal 47cc0bac41 agent_ui: Add keybinding to cycle through new thread location options & settings (#51384)
This PR adds the ability to save in the settings whether new threads
should start in the current project or in a new Git worktree.
Additionally, it also adds a keybinding that allows cycling through the
menu options easily, with the ability to use cmd-click/enter to choose
which one is set as the default.

No release notes because this feature/settings depends on a feature flag
that isn't out yet.

Release Notes:

- N/A
2026-03-12 10:14:10 -03:00
Bennet Bo Fenner eeb034c31c agent: Fix race condition when loading threads (#51366)
This fixes a race condition that could occur when using the sidebar:
`Failed to launch: project state not found`

We were accessing/creating the project state before an await point,
meaning that we could remove the state if session/close was called in
the meantime.

- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-03-12 09:38:54 +00:00
Bennet Bo Fenner db9d9752c7 agent: Support providers streaming edits out of order (#51286)
Release Notes:

- N/A
2026-03-11 14:56:53 +01:00
Bennet Bo Fenner 8d4913168c acp: Update to 0.10.2 (#51280)
Updates to `0.10.2`, most notable change is implementing
`session/close`.

Release Notes:

- N/A
2026-03-11 12:52:03 +00:00
Bennet Bo Fenner f4b04af3dc agent: Allow NativeAgent to work with multiple projects (#51202)
This removes the assumption that one project <-> one native agent. The
native agent now maintains a project per session. We don't make use of
this right now, but it will come in handy once we start sharing ACP
connections globally.

Release Notes:

- N/A
2026-03-10 17:04:48 +01:00
Danilo Leal eae21de630 sidebar: Sort threads by created time (#51193)
Release Notes:

- N/A
2026-03-10 12:22:01 -03:00
f18567c1f0 git: Add the ability to resolve merge conflicts with the agent (#49807)
This PR adds a "Resolve with Agent" button in each merge conflict block,
as well as "Resolve Conflicts with Agents" button on a notification for
resolving conflicts across all the files that have any. When clicking on
either of these buttons, the agent panel opens up with a template prompt
auto-submitted. For the first case, the specific content of the merge
block is already attached as context for the agent to act quickly, given
it's a local and small context. For the second case (all conflicts
across the codebase), the prompt just indicates to the agent which files
have conflicts and then it's up for the agent to see them. This felt
like a simpler way to go as opposed to extracting the content for all
merge conflicts across all damaged files.

Here's how the UI looks like:

<img width="550" height="1964" alt="Screenshot 2026-02-21 at 11  04@2x"
src="https://github.com/user-attachments/assets/96815545-ba03-40e5-9cb0-db0ce9588915"
/>

---

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Git: Added the ability to quickly resolve merge conflicts with the
agent.

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-03-10 11:19:26 -03:00
Mikayla Maki aa5c1ff84e Optimize update_entries (#51122)
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-03-09 17:21:35 +00:00
Piotr Osiewicz 97421c670e Remove unreferenced dev dependencies (#51093)
This will help with test times (in some cases), as nextest cannot figure
out whether a given rdep is actually an alive edge of the build graph

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-03-09 13:22:12 +01:00
NeelandTom Houlé dc0e41f834 Refresh LLM API token on organization change (#50931)
Emit client-side organization changed events through
`RefreshLlmTokenListener` so it produces the same `RefreshLlmTokenEvent`
used for server-pushed `UserUpdated` messages.

This keeps token refresh fan-out in one place.

Closes CLO-383.

Release Notes:

- N/A

---------

Co-authored-by: Tom Houlé <tom@tomhoule.com>
2026-03-06 19:15:21 +00:00
Bennet Bo FennerandBen Brandt f69ab1d04e agent: Fail faster in case streaming tool call fails (#50834)
If a streaming tool call (e.g. edit file) returns an error during
streaming, we would wait until we received the whole input.

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-03-06 14:39:08 +00:00
Bennet Bo Fenner 3fe3776f52 agent: Update old_text docs for StreamingEditFileTool (#50921)
In the old edit agent tool we encouraged the LLM to respond with whole
lines, which we did not do in the new edit file tool.

Release Notes:

- N/A
2026-03-06 15:27:18 +01:00
Ben Brandt 5db8d6d1bc agent: Only use AgentSessionInfo in history (#50933)
Previously we required AgentSessionInfo all over the place, which meant
there were lots of unnecessary fake ones created all over the place.

Made the methods and functions only take the data they need so we only
use these in history contexts now, as intended.

Release Notes:

- N/A
2026-03-06 13:13:23 +00:00
Katie Geer f05d756913 agent: Add telemetry events for subagents (#50849)
Adds five telemetry events to track subagent lifecycle and user
interactions:

- **Subagent Started** — fires on creation or resumption, includes
parent session, subagent session, depth, and whether it was resumed
- **Subagent Completed** — fires when `SpawnAgentTool` finishes,
includes subagent session and status (completed/error)
- **Subagent Toggled** — fires when the user expands or collapses a
subagent card
- **Subagent Stopped** — fires when the user clicks Stop on a running
subagent
- **Subagent Maximized** — fires when the user clicks Maximize to
navigate into a subagent
 
Release Notes:
 - N/A
2026-03-05 12:46:53 -08:00
9afeb4e11d Implement new Multi Agent UI (#50534)
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Eric <eric@zed.dev>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: John Tur <john-tur@outlook.com>
2026-03-05 20:22:28 +00:00
Bennet Bo Fenner 35720710f2 agent: Add debug logging to StreamingEditFileTool (#50826)
Add some debug logging to the streaming edit file tool, to make it
easier to debug errors.

Can be enabled with 
```
"log": {
  "agent": "debug",
}
```

Release Notes:

- N/A
2026-03-05 13:48:44 +00:00
Bennet Bo Fenner 38e7f41c94 agent: Fix deadlock when LLM API returns an error while streaming tool input (#50813)
Nightly only since no tool is using streaming on Preview.

Tools that used streaming could deadlock when the upstream LLM API
stream exited early without ever sending a ToolUse with `input_complete`
set to `true`. This is now fixes by manually dropping the tool input
channels.

Release Notes:

- N/A
2026-03-05 11:19:47 +00:00
Bennet Bo Fenner df0b3de25f agent: Simplify EditPipeline state in StreamingEditFileTool (#50792)
Release Notes:

- N/A
2026-03-05 08:29:56 +00:00
Bennet Bo Fenner 3f1c833586 agent: Cleanup StreamingEditFileTool (#50725)
- Adds logging if tool fails
- Reduces boilerplate in test 
- Simplified code in a bunch of places

Release Notes:

- N/A
2026-03-04 21:02:54 +00:00
Bennet Bo Fenner 87bc2aac5c Add support for streaming tool input to more providers (#50682)
To test:
- [x] Bedrock
- [x] Copilot Chat
- [x] Deepseek
- [x] Open AI
- [x] Open Router
- [x] Vercel
- [x] Vercel AI Gateway
- [x] xAI
- [x] Mistral

Release Notes:

- N/A
2026-03-04 17:36:25 +01:00
90ddd58c35 agent: Move file_read_times logic to ActionLog instead of Thread (#50688)
Since the read times always correspond to an action log call anyway, we
can let the action log track this internally, and we don't have to
provide a reference to the Thread in as many tools.

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: MrSubidubi <dev@bahn.sh>
2026-03-04 10:31:29 +00:00
Eric Holk 832782f6b3 Persist token count and scroll position across agent restarts (#50620)
Release Notes:

- Token counts and scroll position are restored when loading a previous
agent thread
2026-03-03 22:20:12 +00:00
Ben Brandt 4dd42a0f77 agent: Fix subagent error display (#50638)
Since we were no longer just returning a string, we need to update the
content in both success and error modes to get a nice rendering
experience.

Release Notes:

- N/A
2026-03-03 21:32:11 +00:00
Bennet Bo Fenner e20905f284 Only use StreamingEditFileTool when streaming is available (#50616)
Release Notes:

- N/A
2026-03-03 17:16:42 +00:00
Tom Houlé 906f5a64e9 agent: Cancel retries when the turn is cancelled (#50580)
When a completion request fails with a retryable error (e.g. a 500 from
the upstream provider), the retry loop waits on a timer before trying
again. This timer did not race with the cancellation signal, so if the
user switched models and submitted a new message during the retry delay,
the old turn would continue retrying with the stale model for up to 15
seconds — making requests to the wrong provider and corrupting the
thread's message list with spurious Resume entries.

Now the retry delay races with the cancellation receiver, so the old
turn exits immediately when cancelled.

Release Notes:

- Fixed cancelled turns in a conversation that failed (e.g. 500 from the
LLM provider) bein retried even after cancellation
2026-03-03 11:16:49 +01:00
Bennet Bo Fenner 3bb5aec700 agent: Remove unused edit_agent_output from edit file tool (#50576)
Removes unused `edit_agent_output` from `EditFileTool`. This makes it
easier to maintain compatibility between the `EditFileTool` and
`StreamingEditFileTool`.

Release Notes:

- N/A
2026-03-03 09:24:07 +00:00
42ba961075 Persist unsent draft prompt across Zed restarts (#49541)
Store the user's unsent message editor text in DbThread so it survives
quitting and reloading Zed. The draft flows through Thread → AcpThread →
AcpThreadView on load, and back via a debounced observer on the message
editor for saves.

Currently works for native Zed agents only; external ACP agents will
pick this up once general ACP history persistence lands.

## Changes

- **`DbThread`** / **`Thread`**: New `draft_prompt: Option<String>`
field, included in `to_db()`/`from_db()`
- **`AcpThread`**: Bridge field with getter/setter, populated during
`register_session()`
- **`NativeAgent::save_thread()`**: Copies draft from `AcpThread` →
`Thread` before persisting
- **`AcpThreadView`**: Restores draft into `MessageEditor` on load;
syncs editor text → `AcpThread` via observer; debounced (500ms) Thread
notify triggers DB save

Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2026-03-03 00:57:15 +00:00
Bennet Bo Fenner 2879349b1e agent: Fix review experience for StreamingEditFileTool (#50518)
Release Notes:

- N/A
2026-03-02 18:46:25 +00:00
Ben Brandt 56ae09502a agent: Use correct subagent thread entity to get the entries list (#50515)
Was grabbing off the Thread not the AcpThead 🤦

Release Notes:

- N/A
2026-03-02 18:27:32 +00:00
Ben BrandtandBennet Bo Fenner 41a0c63c23 agent: Add linked action log support for subagent threads (#50500)
Subagents now forward buffer reads/writes/edits to a parent action log,
allowing the parent's review experience to track all file changes made
by subagents alongside its own.

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-02 18:00:12 +00:00
Ben Brandt a6106d2bfb agent: Add back in discouragement of useless subagents (#50512)
Release Notes:

- N/A
2026-03-02 17:29:22 +00:00
Ben BrandtandBennet Bo Fenner c6319d3e02 agent: Propagate model settings to running subagents (#50510)
When the model, summarization model, thinking settings, speed, or
profile are updated on a thread, apply the same settings to any
currently running subagents.

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-02 17:10:36 +00:00
Ben Kunkle bb6c52bd5e agent: Log thread title generation errors (#50504) 2026-03-02 17:27:00 +01:00
Ben BrandtandBennet Bo Fenner 12b786dffc agent: Remove subagents feature flag (#50493)
Release Notes:

- agent: Add new `spawn_agent` tool which allows the Zed Agent to
utilize subagents for doing tasks in parallel and better context
management.

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-02 15:30:03 +00:00
Ben BrandtandBennet Bo Fenner af5e26175a agent: Add subagent info to telemetry events (#50492)
- **Add parent_session_id to agent thread feedback submission**
- **Add more parent session ids to events**

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-02 15:17:05 +00:00
Ben BrandtandBennet Bo Fenner 5e9ee9ea4a agent: More subagent fixes (#50489)
- Skip agent location updates for subagent threads
- Hide edits summary for subagent thread
- Fix tool permission granularity selection from parent thread

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-03-02 14:42:01 +00:00
Bennet Bo FennerandBen Brandt ef60143e7a agent: Show full subagent output if no concurrent tool calls (#50478)
Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-03-02 13:21:26 +00:00
Bennet Bo FennerandBen Brandt e80a456eb0 agent: Do not include thinking blocks in subagent output (#50473)
Release Notes:

- N/A

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-03-02 10:05:00 +00:00
Danilo Leal 1123140e40 agent_ui: Add round of improvements to subagent UI (#50357) 2026-02-27 20:35:59 -03:00
Ben Brandt cabf189854 agent: Render subagent labels as they stream in (#50306)
Release Notes:

- N/A
2026-02-27 14:31:54 +00:00
Bennet Bo Fenner c9425f2a90 agent: Stream new_text in StreamingEditFileTool (#50240)
We now stream the new text into the buffer as soon as we receive partial
chunks of `new_text`. This is pretty much a full re-write of the way
streaming worked, which is now much closer to how the edit agent works:
- `ToolEditParser` buffers chunks as they stream in, and emits relevant
events (`OldTextChunk`,`NewTextChunk`, ...) that we use to power the
`EditSession` pipeline.
- `EditSession::process_events` takes care of consuming these events and
applying the edits incrementally as chunks stream in. `EditPipeline`
maintains the underlying state machine for each edit.
- We handle whitespace mismatches similar to the edit agent, the code is
shared by moving that logic to `reindent.rs`

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-02-27 13:24:57 +01:00
Mikayla Maki f1c5ed324b Add folder_paths for project grouping (#50249)
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-02-26 22:32:48 +00:00
Ben Brandt da2bed1930 agent: Rename run_turn to send in subagent handle (#50242)
Align better with naming in thread. I grabbed the wrong function name :D

Release Notes:

- N/A
2026-02-26 20:43:34 +00:00
Tom Houlé 6a749380aa Add fast mode toggle in agent panel (#49714)
This is a staff only toggle for now, since the consequences of
activating it are not obvious and quite dire (tokens costs 6 times
more).

Also, persist thinking, thinking effort and fast mode in DbThread so the
thinking mode toggle and thinking effort are persisted.

Release Notes:

- Agent: The thinking mode toggle and thinking effort are now persisted
when selecting a thread from history.
2026-02-26 21:19:41 +01:00
Ben Brandt 820774ac89 agent: Simplify subagent tool and handle (#50230)
Moves parent thread information into the environment, and also models it
as a turn on the handle rather than waiting for output.

Release Notes:

- N/A
2026-02-26 16:41:24 +00:00
f4e65d8988 agent_servers: Migrate all built-in agents to go via registry (#50094)
This has lots of benefits, but mainly allows users to uninstall agents.

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
2026-02-26 12:24:39 +00:00
Bennet Bo Fenner 10b33f81b7 agent: Stream content in StreamingEditFileTool (#50187)
Release Notes:

- N/A
2026-02-26 10:48:33 +00:00
Bennet Bo Fenner e4b827a7ec agent: Detect overlapping edits in StreamingEditFileTool (#50181)
Release Notes:

- N/A
2026-02-26 09:15:18 +00:00
Bennet Bo FennerandZed Zippy a2e34cb7bf agent: Implement streaming for edit file tool (#50004)
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-25 22:58:25 +00:00
Ben Brandt 046b173b87 agent: Improve SpawnAgentTool instructions for clarity (#50114)
Trying to keep it from reiterating instructions


Release Notes:

- N/A
2026-02-25 19:20:22 +01:00