Commit graph

20627 commits

Author SHA1 Message Date
Marshall Bowers
dc83f1ad38
Rename assistant2 to agent (#27887)
This PR renames the `assistant2` crate to `agent`.

Release Notes:

- N/A
2025-04-02 00:40:47 +00:00
Marshall Bowers
8e0f70f3c7
Bump revision for livekit-rust-sdks (#27886)
This PR bumps the revision of the `livekit-rust-sdks` crate.

I was running into issue where Cargo was stuck on "Updating git
submodule `https://chromium.googlesource.com/libyuv/libyuv`".

I resolved the issue by forking `libyuv` to
https://github.com/zed-industries/libyuv and updating our
`livekit-rust-sdks` fork to use it in
https://github.com/zed-industries/livekit-rust-sdks/pull/4.

Release Notes:

- N/A
2025-04-02 00:24:08 +00:00
Cole Miller
6262a4638b
Fix a bug that prevented repositories from being deduplicated (#27884)
Closes #ISSUE

Release Notes:

- Ensure that only one repository is shown in the git UI when two
subdirectories of a repository root are open in Zed
2025-04-01 22:41:01 +00:00
Julia Ryan
4110928314
nix: Clean up build (#27881)
- bump our livekit version to include a fix for a crane bug (TODO: add
link when an issue is filed on crane)
- switch to a clang stdenv for both linux and macos
- manually unify versions of our notify crate
- remove old linker flags which were only needed for livekit
- fix an issue where RUSTFLAGS shadowed the rustflags from cargo configs

Release Notes:

- N/A
2025-04-01 22:35:15 +00:00
Marshall Bowers
a1b53e91e7
git: Use doc comments for ResetMode variants (#27882)
This PR updates the `ResetMode` enum to use doc comments for its
variants instead of line comments.

Release Notes:

- N/A
2025-04-01 22:19:29 +00:00
Antonio Scandurra
4a252515b1
Improve tracking for agent edits (#27857)
Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-04-01 22:13:28 +00:00
Agus Zubiaga
d26c477d86
assistant2: Summarize threads in context and continue long ones (#27851)
We'll now prompt the user to start a new thread when the active one gets
too long.

<img width=500
src="https://github.com/user-attachments/assets/91445bc0-3e81-422f-aa4a-b8f0741f9d9a"></img>


When they click "Start New Thread", will create a new one with the
previous one added as context.

<img width=500
src="https://github.com/user-attachments/assets/c3b4223f-5bdd-4ba4-956f-5a5880d5e2c3"></img>

Instead of including the full thread text, we'll now add summarized
versions of threads to the context, allowing you to continue the
conversation even if it was near the token limit.

- Thread summaries are cached and persisted. 
- A cached summary is invalidated if the thread is continued.
- We start generating the thread summary as soon as it's selected from
the picker. Most times, the summary will be ready by the time the user
sends the message.
- If the summary isn't ready by the time a message is sent, the user
message will be displayed in the thread immediately, and a "Summarizing
context..." indicator will appear. After the summaries are ready, we'll
start generating the response and show the usual "Generating..."
indicator.

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-04-01 21:48:56 +00:00
KyleBarton
16f625bd07
Add persistence to command palette history (#26948)
Closes #20391

### Summary
This adds a persistence layer to the command palette so that usages can
persist after Zed is closed and re-opened.

The current "usage" algorithm is unchanged, e.g.:
- Sorts by number of usages descending (no recency preference)
- Once a user's query is active, removes these suggestions in favor of
fuzzy matching

There are some additional considerations in order to keep the DB from
growing uncontrollably (and to make long-term use ergonomic):
- The "invocations" count handles max values (though at u16, it seems
unlikely a user will deal with this)
- If a command is un-invoked for more than a month, it stops being
considered a recent usage, and its next update will update its usages
back to 1

### Future Considerations
- Could make the "command expiry" configurable in settings, so the user
can decide how long to hold onto recent usages
- Could make a more sophisticated algorithm which balances recency and
total invocations - e.g. if I've used COMMAND_A 100 times in the last
month, but COMMAND_B 10 times today, should COMMAND_B actually be
preferred?
- Could do preferential fuzzy-matching against these matches once the
user starts a query.

Release Notes:

- Added persistent history of command palette usages.

---------

Co-authored-by: Peter Finn <mastion11@gmail.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-04-01 15:46:35 -06:00
Conrad Irwin
9bc4697a33
Use new multibuffer excerpts in find-all-references and friends (#27876)
Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2025-04-01 15:42:32 -06:00
Cole Miller
e7290df02b
Finish removing git repository state and scanning logic from worktrees (#27568)
This PR completes the process of moving git repository state storage and
scanning logic from the worktree crate to `project::git_store`.

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
2025-04-01 17:41:20 -04:00
Marshall Bowers
8f25251faf
assistant2: Rename assistant2 actions to agent (#27877)
This PR renames the `assistant2` actions to `agent`.

Note that any `assistant` actions have been left as-is for now so that
there aren't any changes to users not in the feature flag.

Release Notes:

- N/A
2025-04-01 21:25:30 +00:00
Agus Zubiaga
2d05537b59
assistant2: Fix notification max width (#27872)
<img width=400
src="https://github.com/user-attachments/assets/4132e075-3f2a-4c65-8c06-c3428f3ad477">

<img width=400
src="https://github.com/user-attachments/assets/95908b32-a9b9-45c3-9db9-dcbeedffc5e7">

Release Notes:

- N/A
2025-04-01 18:16:53 -03:00
5brian
95b963c87b
vim: Add :Git (#27874)
Just adding to the existing https://zed.dev/docs/vim#ex-commands

Captial G is not used by vim commands.

Release Notes:

- N/A
2025-04-01 15:12:36 -06:00
Marshall Bowers
5d1695ed1d
assistant2: Add affordances for when the selected model does not support tools (#27870)
This PR adds some affordances for when the currently-selected model does
not support tools.

We disable the profile selector and put it into a "No Tools" state:

<img width="1394" alt="Screenshot 2025-04-01 at 3 58 00 PM"
src="https://github.com/user-attachments/assets/de6ecb0f-7657-4e16-9d5d-7bbfbc2b0a5c"
/>

We will also only attach tools to the request to the model if the model
supports it.

Release Notes:

- N/A
2025-04-01 20:13:06 +00:00
Danilo Leal
192097f58f
assistant2: Ensure errors are also displayed in populated new thread view (#27869)
Follow-up to https://github.com/zed-industries/zed/pull/27812

This PR makes sure these errors cases also show up in the panel's empty
state even when there is past data.

| No ToS | Missing Provider |
|--------|--------|
| ![CleanShot 2025-04-01 at 4  49
36@2x](https://github.com/user-attachments/assets/6da6bdc9-daa6-4a7b-a224-989eb845e205)
| ![CleanShot 2025-04-01 at 4  50
04@2x](https://github.com/user-attachments/assets/bddf62cb-3727-44b5-b115-9a88313c6d85)
|

Release Notes:

- N/A
2025-04-01 17:06:34 -03:00
Agus Zubiaga
92059803fb
find-replace tool: Return diff in output (#27868)
This should help the model maintain an accurate picture of the file as
it makes changes

Release Notes:

- N/A
2025-04-01 19:57:32 +00:00
Marshall Bowers
5880271b11
language_model: Add supports_tools method to LanguageModel (#27867)
This PR adds a new `supports_tools` method to the `LanguageModel` trait
to indicate whether a given model supports tool use.

Release Notes:

- N/A
2025-04-01 19:56:05 +00:00
Cole Miller
4ff07bf789
Fix restore button (#27866)
ID collision!

Release Notes:

- N/A
2025-04-01 19:33:30 +00:00
Max Brunsfeld
b59967bbdf
Don't allow open excerpts in commit view for now (#27862)
Follow-up to https://github.com/zed-industries/zed/pull/27636

Release Notes:

- N/A
2025-04-01 11:40:45 -07:00
Marshall Bowers
133d3f052f
assistant2: Update some text to use "agent" nomenclature (#27864)
This PR updates some text in the Agent Panel to use the "agent"
nomenclature.

Release Notes:

- N/A
2025-04-01 18:33:28 +00:00
Cole Miller
0934cb58c4
Don't prompt twice when trashing added files from git panel (#27863)
Closes #ISSUE

Release Notes:

- N/A
2025-04-01 18:25:58 +00:00
Peter Finn
bda33ec436
vim: Fix space forward bug with non-ASCII characters at EOL (#27860)
Closes https://github.com/zed-industries/zed/issues/27619

Fixes issue with right wrapped movement when a multi-byte character is
at the end of the line. This is done by grabbing the last character on
the current row and using that characters size to calculate the
`max_column` variable, which is used to decide if the next right
movement should move down the line or not.

We did notice a bit of code that could be an issue that we wanted to
call out.
[Here](https://github.com/zed-industries/zed/blob/main/crates/editor/src/display_map.rs#L1070)
inside of `clip_at_line_end` it also does a saturating_sub(1), assuming
a single byte character. We didn't run into any issues due to this line
but felt like a similar bug. We can apply a similar fix if wanted to
pose the question first.

Test case: Moving to next line when eol is a multi-byte character


https://github.com/user-attachments/assets/1021ab1f-f49d-4986-8f9a-8cfc7e5c91bc


Release Notes:

- Fixed issue in vim forward spacing when a multi-byte character is at
the eol

---------

Co-authored-by: KyleBarton <kjbarton4@gmail.com>
2025-04-01 18:21:41 +00:00
Danilo Leal
64ef3ab09d
ui: Introduce Banner component (#27853)
This PR adds a new, generic `Banner` component so that we can
potentially replace the multiple, isolated implementations of it
throughout some places of the app.

<img
src="https://github.com/user-attachments/assets/a268f745-1747-48e6-9461-2732eb7c0be4"
width="750"/>

Release Notes:

- N/A
2025-04-01 14:36:38 -03:00
Elvis Pranskevichus
ac5a2b2122
python: Add recognition of worktree -> venv links (#26759)
Python envs created with virtualenvwrapper have the ability to link to
the project directory (via the `.project` file in the virtualenv).
`python-environment-tools` supports this and reports the project path.

Additionally, some tools (e.g virtualfish) recognize special
"environment activation" files in project directories (`.venv` by
default)
[1].

Use the above information to sort reported Python toolchains so that the
correct env for a given worktree is at the top.

[1]
https://virtualfish.readthedocs.io/en/latest/plugins.html#auto-activation-auto-activation

Release Notes:

- python: Improved detection of virtualenvwrapper environments in work
trees
2025-04-01 19:12:16 +02:00
Max Brunsfeld
ada8b0f822
Show commit author, not committer (#27856)
Release Notes:

- Fixed a bug where the git panel displayed a commit's committer in
place of its author.
2025-04-01 09:55:56 -07:00
Antonio Scandurra
76871056f5
Preserve cursor position when resetting excerpts (#27850)
Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-04-01 16:55:10 +00:00
Marshall Bowers
f859b328f0
assistant2: Use "Agent Panel" nomenclature for panel tooltip (#27858)
This PR updates the Agent Panel tooltip in the status to use "Agent
Panel" instead of "Assistant Panel".

Also changes the name we use in workspace serialization.

Release Notes:

- N/A
2025-04-01 16:54:40 +00:00
Marshall Bowers
e63df58adc
assistant2: Rename key context to AgentPanel (#27859)
This PR renames the key context for the Agent Panel from
"AssistantPanel2" to "AgentPanel".

Release Notes:

- N/A
2025-04-01 16:42:31 +00:00
Marshall Bowers
0ad4656489
assistant_settings: Show JSON schema for profile settings (#27855)
This PR makes it so we include the `default_profile` and `profiles`
settings in the JSON schema.

This provides completions when editing the `settings.json`.

Release Notes:

- N/A
2025-04-01 16:34:48 +00:00
Piotr Osiewicz
992831ceb6
workspace: Do not call set_active when deserializing a dock if that dock was not visible (#27852)
This unblocks work on new debugger UI, where we don't want the
set_active function to be called unconditionally.

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-04-01 16:33:52 +00:00
Bennet Bo Fenner
feb1d37798
assistant2: Allow clicking on @mentions (#27846)
https://github.com/user-attachments/assets/f6f7c115-5c40-48f9-a099-2b691993967b

Release Notes:

- N/A
2025-04-01 15:44:20 +00:00
Marshall Bowers
12037dc2c6
assistant2: Allow profiles to enable all context servers (#27847)
This PR adds a new `enable_all_context_servers` field to agent profiles
to allow them to enable all context servers without having to opt into
them individually.

The "Write" profile will now have all context servers enabled out of the
box.

Release Notes:

- N/A
2025-04-01 15:25:23 +00:00
Danilo Leal
ab31eb5d51
edit prediction: Show display mode options just for Zed (#27844)
Eager and Subtle modes are only supported for Zed as an edit prediction
provider and they were visible if your provider is Copilot, which is
misleading.

Release Notes:

- N/A
2025-04-01 11:07:24 -03:00
Danilo Leal
7d67bd480b
assistant2: Remove check icon from successful tool calls (#27840)
Just to streamline the UI more.

Release Notes:

- N/A
2025-04-01 10:02:21 -03:00
Stanislav Alekseev
0079771e34
Use symmetric padding in signature popovers (#27734)
Release Notes:

- Fixed padding issue with the signature popovers

------

Before:
<img width="372" alt="Screenshot 2025-03-29 at 20 30 39"
src="https://github.com/user-attachments/assets/36d1555d-bccb-4fca-b6ad-514cf11d024f"
/>

After:
<img width="375" alt="Screenshot 2025-03-29 at 20 31 13"
src="https://github.com/user-attachments/assets/6566d0e9-9dae-47dc-bfa0-526bf35f3cf0"
/>
2025-04-01 14:14:33 +02:00
Bennet Bo Fenner
d1db6d6782
assistant2: Fix issue with included directories in context picker (#27833)
Release Notes:

- N/A
2025-04-01 09:44:06 +00:00
Bennet Bo Fenner
5509e0141a
Return language model events when using Google model via zed.dev (#27831)
Release Notes:

- N/A
2025-04-01 08:58:17 +00:00
Smit Barmase
8be5ed22f6
workspace: Fix SSH remote restore on second open + Fix panel not opening automatically on new SSH remote (#27830)
Closes #26902

- We used to serialize SSH remote only when opened via recent entries,
and not on first time. This broke restore, when opening same folder for
second time from recent entries. Once opened for second time, restoring
used to. work correctly. This PR fixes this by serializing when opened
for first time.

- We didn't handle window replace post worktree creation in first time
flow, this resulted in project panel not opening automatically like it
does with recent entries, or local projects. This PR fixes it by
following same flow as recent entries.

Release Notes:

- Fixed SSH remote not restoring when opening for second time.
- Fixed project panel not opening when opening new SSH remote folder.
2025-04-01 14:05:28 +05:30
Michael Sloan
5343f1cdaf
Undo a refactor of buffer_path_log_err (#27828)
Accidentally included this in #27822

Release Notes:

- N/A
2025-04-01 07:43:40 +00:00
Anthony Eid
8075c2458f
Debugger: Fix breakpoint serialization (#27825)
This PR fixes two bugs that cause unexpected behavior with breakpoints.

The first bug made it impossible to delete the last breakpoint in a file
in the workspace's database. This caused deleted breakpoints to remain
in the database and added to new projects.

The second bug was an edge case in the breakpoint context menu where
disabling/enabling a breakpoint would sometimes set a new breakpoint on
top of the old breakpoint.


Release Notes:

- N/A
2025-04-01 05:40:05 +00:00
Michael Sloan
d0276e6666
Remove assistant ContextSnapshot (#27822)
Motivation for this is to simplify the context types and make it cleaner
to add image context.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2025-03-31 21:57:09 -06:00
Agus Zubiaga
c729842804
assistant2: Exclude deleted files from stale list (#27821)
Release Notes:

- N/A
2025-04-01 03:26:29 +00:00
Agus Zubiaga
715e23a491
assistant2: Do not mention diagnostics until done (#27820)
Release Notes:

- N/A
2025-04-01 00:12:04 -03:00
Anthony Eid
63f0fda350
Fix code actions tooltip overlapping with action context menu (#27809)
Closes #27728

This stops code actions tooltip from being added when there's a visible
Editor::context_menu

Release Notes:

- Fix code actions tooltip opening on top of code actions menu
2025-03-31 21:56:03 -04:00
5brian
7984f0f11c
vim: Update :set (#27805)
Update VimSet commands to better match the other commands by displaying
the leading `:`:

|Before|After|
|--|--|

|![image](https://github.com/user-attachments/assets/1bc21a06-e71f-4e40-90a7-ffdd903fd7b5)|![image](https://github.com/user-attachments/assets/df59279f-d454-4701-8330-2529506850cd)|


Release Notes:

- N/A
2025-03-31 19:00:11 -06:00
Conrad Irwin
37ebb47238
Don't use dbg! in test input (#27811)
It confuses me when I grep for dbg! 🤦

Release Notes:

- N/A
2025-03-31 18:59:52 -06:00
Max Brunsfeld
8546dc101d
Allow viewing past commits in Zed (#27636)
This PR adds functionality for loading the diff for an arbitrary git
commit, and displaying it in a tab. To retrieve the diff for the commit,
I'm using a single `git cat-file --batch` invocation to efficiently load
both the old and new versions of each file that was changed in the
commit.

Todo

* Features
* [x] Open the commit view when clicking the most recent commit message
in the commit panel
  * [x] Open the commit view when clicking a SHA in a git blame column
  * [x] Open the commit view when clicking a SHA in a commit tooltip
  * [x] Make it work over RPC
  * [x] Allow buffer search in commit view
* [x] Command palette action to open the commit for the current blame
line
* Styling
* [x] Add a header that shows the author, timestamp, and the full commit
message
  * [x] Remove stage/unstage buttons in commit view
  * [x] Truncate the commit message in the tab
* Bugs
  * [x] Dedup commit tabs within a pane
  * [x] Add a tooltip to the tab

Release Notes:

- Added the ability to show past commits in Zed. You can view the most
recent commit by clicking its message in the commit panel. And when
viewing a git blame, you can show any commit by clicking its sha.
2025-03-31 23:26:47 +00:00
Danilo Leal
33912011b7
assistant2: Adjust icons for some tools (#27814)
Picking more specific icons for a few tools.

Release Notes:

- N/A
2025-03-31 20:12:51 -03:00
Danilo Leal
dce824f095
assistant2: Refine empty states design (#27812)
| No LLM provider | Fresh Start | No ToS |
|--------|--------|--------|
| ![CleanShot 2025-03-31 at 7  04
17@2x](https://github.com/user-attachments/assets/aab5987c-1530-401d-acc6-65e4f2fc13b8)
| ![CleanShot 2025-03-31 at 7  04
39@2x](https://github.com/user-attachments/assets/b2c7a2e0-5178-4bcb-a917-da7bf8e6246c)
| ![CleanShot 2025-03-31 at 7  05
10@2x](https://github.com/user-attachments/assets/4a656e82-0e1d-4d11-8d34-8eeeadd4814c)
|

Release Notes:

- N/A
2025-03-31 19:31:56 -03:00
Ben Kunkle
a1bef28da3
keymap: Allow upper-case keys in keybinds (#27813)
Reverts the error behavior introduced in #27558. Upper-case keys in
keybindings no longer generate errors, instead they are transformed into
`shift-{KEY}`
e.g. `ctrl-N` becomes `ctrl-shift-n`

The behavior introduced in #27558 where "special" keys such as function
keys, `control`, `shift`, etc. Are parsed case-insensitively is
preserved.

Release Notes:
- Improved how upper-case characters are handled in keybinds. "special"
keys such as the function keys, `control`, `shift`, etc. are now parsed
case-insensitively, so for example `F8`, `CTRL`, `SHIFT` are now
acceptable alternatives to `f8`, `ctrl`, and `shift` when declaring
keybindings. Additionally, upper-case (ascii) characters will now be
converted explicitly to `shift` + the lowercase version of the
character, to match the Vim behavior.
NOTE: Release notes above should replace the release notes from #27558
2025-03-31 22:31:01 +00:00