Commit graph

63 commits

Author SHA1 Message Date
Antonio Scandurra
7c05136c28
acp: Use unstaged style for diffs (#36674)
Release Notes:

- N/A
2025-08-23 10:39:28 -04:00
Agus Zubiaga
7465f5c714
acp: Update to 0.0.30 (#36643)
See: https://github.com/zed-industries/agent-client-protocol/pull/20

Release Notes:

- N/A
2025-08-23 10:39:28 -04:00
Agus Zubiaga
ab3353b555
message editor: Only allow types of content the agent can handle (#36616)
Uses the new
[`acp::PromptCapabilities`](a39b7f635d/rust/agent.rs (L194-L215))
to disable non-file mentions and images for agents that don't support
them.

Release Notes:

- N/A
2025-08-23 10:39:27 -04:00
Bennet Bo Fenner
c11c971c44
agent2: Port feedback (#36603)
Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2025-08-23 10:39:26 -04:00
Antonio Scandurra
d01995b36c
Miscellaneous UX fixes for agent2 (#36591)
Release Notes:

- N/A
2025-08-23 10:39:26 -04:00
tidely
e9f0fcce50
Fix clippy::manual_map lint violations (#36584)
#36577

Release Notes:

- N/A
2025-08-23 10:39:26 -04:00
tidely
cae072e0a0
Fix clippy::redundant_clone lint violations (#36558)
This removes around 900 unnecessary clones, ranging from cloning a few
ints all the way to large data structures and images.

A lot of these were fixed using `cargo clippy --fix --workspace
--all-targets`, however it often breaks other lints and needs to be run
again. This was then followed up with some manual fixing.

I understand this is a large diff, but all the changes are pretty
trivial. Rust is doing some heavy lifting here for us. Once I get it up
to speed with main, I'd appreciate this getting merged rather sooner
than later.

Release Notes:

- N/A
2025-08-23 10:39:25 -04:00
Bennet Bo Fenner
9fbbfeb430
agent2: Port more Zed AI features (#36559)
Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-08-23 10:39:25 -04:00
Conrad Irwin
952dd9e45c
ACP history mentions (#36551)
- **TEMP**
- **Update @-mentions to use new history**

Closes #ISSUE

Release Notes:

- N/A
2025-08-23 10:39:25 -04:00
Cole Miller
d01291e988
Add version detection for CC (#36502)
- Render a helpful message when the installed CC version is too old
- Show the full path for agent binaries when the version is not recent
enough (helps in cases where multiple binaries are installed in
different places)
- Add UI for the case where a server binary is not installed at all
- Refresh thread view after installing/updating server binary

Release Notes:

- N/A
2025-08-23 10:39:24 -04:00
Agus Zubiaga
d6513d90f8
Improve claude tools (#36538)
- Return unified diff from `Edit` tool so model can see the final state
- Format on save if enabled
- Provide `Write` tool
- Disable `MultiEdit` tool
- Better prompting

Release Notes:

- N/A
2025-08-23 10:39:24 -04:00
Bennet Bo Fenner
5c9ccc390b
agent2: Token count (#36496)
Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-08-23 10:39:23 -04:00
Piotr Osiewicz
f61482151a
Fix a bunch of other low-hanging style lints (#36498)
- **Fix a bunch of low hanging style lints like unnecessary-return**
- **Fix single worktree violation**
- **And the rest**

Release Notes:

- N/A
2025-08-23 10:39:23 -04:00
Cole Miller
fa5ff2bd98
Fix Windows test failures not being detected in CI (#36446)
Bug introduced in #35926 

Release Notes:

- N/A
2025-08-23 10:39:22 -04:00
Antonio Scandurra
c65d113f5b
Lay the groundwork to support history in agent2 (#36483)
This pull request introduces title generation and history replaying. We
still need to wire up the rest of the history but this gets us very
close. I extracted a lot of this code from `agent2-history` because that
branch was starting to get long-lived and there were lots of changes
since we started.

Release Notes:

- N/A
2025-08-23 10:39:22 -04:00
Piotr Osiewicz
780d5c7d35
Auto-fix clippy::collapsible_if violations (#36428)
Release Notes:

- N/A
2025-08-23 10:39:22 -04:00
Bennet Bo Fenner
6ebd617d40
agent2: Fix agent location still being present after thread stopped (#36471)
Release Notes:

- N/A
2025-08-23 10:39:21 -04:00
Bennet Bo Fenner
0155488955
agent2: Port retry logic (#36421)
Release Notes:

- N/A
2025-08-23 10:39:21 -04:00
Cole Miller
4af757d578
agent2: Support directories in @file mentions (#36416)
Release Notes:

- N/A
2025-08-23 10:39:21 -04:00
Piotr Osiewicz
455a95c81d
Fix clippy::needless_borrow lint violations (#36444)
Release Notes:

- N/A
2025-08-23 10:39:20 -04:00
Agus Zubiaga
1b270842a3
Handle auth for claude (#36442)
We'll now use the anthropic provider to get credentials for `claude` and
embed its configuration view in the panel when they are not present.

Release Notes:

- N/A
2025-08-23 10:39:20 -04:00
Agus Zubiaga
e587ed5c6f
acp: Have AcpThread handle all interrupting (#36417)
The view was cancelling the generation, but `AcpThread` already handles
that, so we removed that extra code and fixed a bug where an update from
the first user message would appear after the second one.

Release Notes:

- N/A

Co-authored-by: Danilo <danilo@zed.dev>
2025-08-23 10:39:19 -04:00
Agus Zubiaga
9e0dd0c699
acp: Stay in edit mode when current completion ends (#36413)
When a turn ends and the checkpoint is updated, `AcpThread` emits
`EntryUpdated` with the index of the user message. This was causing the
message editor to be recreated and, therefore, lose focus.

Release Notes:

- N/A
2025-08-23 10:39:19 -04:00
Ben Brandt
7322916b15
Standardize on canceled instead of cancelled (#36385)
Release Notes:

- N/A
2025-08-23 10:39:18 -04:00
Ben Brandt
250fdcdbd3
Refactor ToolCallStatus enum to flat variants (#36356)
Replace nested Allowed variant with distinct statuses for clearer status
handling.

Release Notes:

- N/A
2025-08-23 10:39:17 -04:00
Ben Brandt
de3f7abfb0
Allow Permission Request to only require a ToolCallUpdate instead of a full tool call (#36319)
Release Notes:

- N/A
2025-08-23 10:39:17 -04:00
Agus Zubiaga
a70316d79b
acp thread view: Always use editors for user messages (#36256)
This means the cursor will be at the position you clicked:


https://github.com/user-attachments/assets/0693950d-7513-4d90-88e2-55817df7213a


Release Notes:

- N/A
2025-08-23 10:39:16 -04:00
Bennet Bo Fenner
eb1e6e6b73
agent2: Port Zed AI features (#36172)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-08-23 10:39:15 -04:00
Cole Miller
b9901a44a7
Support images in agent2 threads (#36152)
- Support adding ImageContent to messages through copy/paste and through
path completions
- Ensure images are fully converted to LanguageModelImageContent before
sending them to the model
- Update ACP crate to v0.0.24 to enable passing image paths through the
protocol

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-08-23 10:39:14 -04:00
Agus Zubiaga
03efb2ac3c
acp: Clean up entry views on rewind (#36197)
We were leaking diffs and terminals on rewind, we'll now clean them up.
This PR also introduces a refactor of how we mantain the entry view
state to use a `Vec` that's kept in sync with the thread entries.

Release Notes:

- N/A
2025-08-23 10:39:14 -04:00
Conrad Irwin
3b47c99785
Allow editing Agent2 messages (#36155)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-08-23 10:39:14 -04:00
Agus Zubiaga
b8887257f5
Fully support all mention kinds (#36134)
Feature parity with the agent1 @mention kinds:
- File
- Symbols
- Selections
- Threads
- Rules
- Fetch


Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2025-08-23 10:38:50 -04:00
Ben Brandt
971738b49e
agent2: Initial infra for checkpoints and message editing (#36120)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-08-23 10:38:45 -04:00
Ben Brandt
797dab40aa
Agent2 Model Selector (#36028)
Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2025-08-23 10:38:45 -04:00
Cole Miller
65f0dc7b7c
Add locations to native agent tool calls, and wire them up to UI (#36058)
Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
2025-08-23 10:38:41 -04:00
Cole Miller
151c71a0ce
Fix external agent still being marked as generating after error response (#35992)
Release Notes:

- N/A
2025-08-23 10:38:41 -04:00
Danilo Leal
359acef10a
agent2: Add custom UI for resource link content blocks (#36005)
Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-08-23 10:38:40 -04:00
Agus Zubiaga
5913bb8fc3
Include mention context in acp-based native agent (#36006)
Also adds data-layer support for symbols, thread, and rules.

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2025-08-23 10:38:40 -04:00
Antonio Scandurra
4679c43789
Support profiles in agent2 (#36034)
We still need a profile selector.

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2025-08-23 10:38:40 -04:00
Danilo Leal
fdfb0662c1
agent2: Refine terminal tool call display (#35984)
Release Notes:

- N/A
2025-08-23 10:38:39 -04:00
Cole Miller
c995fff875
Delay rendering tool call diff editor until it has a revealed range (#35901)
Release Notes:

- N/A
2025-08-23 10:38:19 -04:00
Antonio Scandurra
d6d28a53ce
Port terminal tool to agent2 (#35918)
Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2025-08-23 10:38:18 -04:00
Ben Brandt
6532d82d32
Pull action_log into its own crate (#35959)
Release Notes:

- N/A
2025-08-23 10:38:18 -04:00
Antonio Scandurra
581cbc3458
Lay the groundwork to create terminals in AcpThread (#35872)
This just prepares the types so that it will be easy later to update a
tool call with a terminal entity. We paused because we realized we want
to simplify how terminals are created in zed, and so that warrants a
dedicated pull request that can be reviewed in isolation.

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2025-08-23 10:38:16 -04:00
Agus Zubiaga
37187940e9
agent2: Port edit_file tool (#35844)
TODO:
- [x] Authorization
- [x] Restore tests

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2025-08-23 10:38:15 -04:00
Agus Zubiaga
377376ee4b
Fix acp generating status after stop (#35852)
Release Notes:

- N/A
2025-08-23 10:38:15 -04:00
Ben Brandt
a646f94565
Wire up find_path tool in agent2 (#35799)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-08-23 10:38:14 -04:00
Antonio Scandurra
948fd9c540
Add system prompt and tool permission to agent2 (#35781)
Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-08-23 10:38:11 -04:00
Agus Zubiaga
6f193d94d5
Fix interrupting ACP threads and CC cancellation (#35752)
Fixes a bug where generation wouldn't continue after interrupting the
agent, and improves CC cancellation so we don't display "[Request
interrupted by user]"

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2025-08-23 10:38:10 -04:00
Cole Miller
62554a978d
Fix flicker when agent plan updates (#35739)
Currently, when the agent updates its plan, there are a few frames where
the text after `Current:` in the plan summary is blank, causing a
flicker. This is because we treat that field as markdown, and the
`MarkdownElement` renders as blank until the raw text has finished
parsing in the background.

This PR fixes the flicker by changing `Markdown::new_text` to
optimistically render the source as a single `MarkdownEvent::Text` span
until background parsing has finished.

Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-08-23 10:38:10 -04:00