Closes: https://github.com/zed-industries/zed/issues/20582
Allows users to select a specific model for each AI-powered feature:
- Agent panel
- Inline assistant
- Thread summarization
- Commit message generation
If unspecified for a given feature, it will use the `default_model`
setting.
Release Notes:
- Added support for configuring a specific model for each AI-powered
feature
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This PR adds new granular tokens per minute columns to the `models`
table in preparation for more fine-grained rate limits.
The following columns have been added:
- `max_input_tokens_per_minute`
- `max_output_tokens_per_minute`
These mirror the "Maximum input tokens per minute (ITPM)" and "Maximum
output tokens per minute (OTPM)" [rate limits from
Anthropic](https://docs.anthropic.com/en/api/rate-limits#rate-limits).
Release Notes:
- N/A
Use the `NSOperatingSystemVersion` struct provided by the cocoa crate
instead of our own. Additionally we can directly use
`isOperatingSystemAtLeastVersion` instead of manually implementing
version comparison logic.
The `isOperatingSystemAtLeastVersion` instance method has been available
since MacOS 10.10, which released a decade ago.
Documentation for `isOperatingSystemAtLeastVersion `:
https://developer.apple.com/documentation/foundation/nsprocessinfo/1414876-isoperatingsystematleastversion
Release Notes:
- N/A
Changes default keymaps to more closely match the behavior of VSCode.
New Zed behavior:
`cmd-k w` / `ctrl-k w` -- Closes all buffers in the current pane
`cmd-k cmd-w` / `ctrl-k ctrl-w` -- Closes all buffers in all panes
VScode:
`cmd-k cmd-w` is workbench.action.closeAllEditors (close all buffers in
all splits)
`cmd-k w` is workbench.action.closeEditorsInGroup (close all buffers in
current split)
Both leave pinned tabs untouched.
Release Notes:
- Improved keybindings for close all tabs to better match VSCode
behavior
This is a follow up to https://github.com/zed-industries/zed/pull/14821,
which escaped `$` but not `^`.
This is fine for `bash`, but causes issues with `zsh`. This change
escapes the `^`. I tested this against `bash`, `zsh` and `fish`
I suspect such escaping would probably need to be done at some
shell-specific layer of the code, but for now it seems like the tasks
provided by the `ContextProvider` are supposed to be shell agnostic.
To reproduce the original issue:
1. Create a Go test file in a module that just contains a single test
`TestABC`.
2. Run `zsh -i -c "go test -run ^TestABC\$"` which is what Zed tries to
run when the task for a specific Go test is executed.
3. An error that there are no tests to run will be produced even though
there is a test.
4. Run `zsh -i -c "go test -run \^TestABC\$"` (note the backslash before
^).
5. The test will run successfully.
Example:
``` go
package bar
import "testing"
func TestABC(t *testing.T) {}
```
Release Notes:
- fix: Escape the ^ in the Go test -run regex to improve shell
compatibility (notably with zsh).
Release Notes:
- Fixed an issue causing "robot voice" when enabling the microphone on
some bluetooth headphones (hopefully).
Co-authored-by: Zed AI <ai+claude-3.7@zed.dev>
With the recent deprecation of `rustPlatform.fetchCargoTarball` +
migration to using `fetchCargoVendor` by default in `buildRustPackage`
(NixOS/nixpkgs#394012), the `cargo-bundle` override strategy used here,
as prescribed by the
[nixos asia wiki](https://nixos.asia/en/buildRustPackage) no longer
works:
c6e2d20a02/nix/build.nix (L100-L116)
[`fetchCargoTarball` produced a single derivation][tarball-drv] but
`fetchCargoVendor` [produces two][vendor-drvs]:
- `${name}-vendor-staging` (inner; FoD)
- `${name}-vendor` (outer)
[tarball-drv]:
36fd87baa9/pkgs/build-support/rust/fetch-cargo-tarball/default.nix (L79)
[vendor-drvs]:
10214747f5/pkgs/build-support/rust/fetch-cargo-vendor.nix (L52-L103)
`overrideAttrs` here is setting `outputHash` on the latter (which isn't
a fixed-output-derivation and does not have `outputHashMode` set which
implies `outputHashMode = "flat"`) instead of the inner; this results in
errors like this:
```console
❯ nix develop
error: output path '/nix/store/cb57w05zvsqxshqjl789kmsy9pbqjn06-cargo-bundle-0.6.1-zed-vendor.tar.gz' should be a non-executable regular file since recursive hashing is not enabled (outputHashMode=flat)
error: 1 dependencies of derivation '/nix/store/k3azmxljgjn26hqyhg9m1y3lhx32y939-cargo-bundle-0.6.1-zed.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8ag4v0m90m4kcaq1ypp7f85pp8s6fxgc-nix-shell-env.drv' failed to build
```
> [!NOTE]
> you will need to remove
`/nix/store/cb57w05zvsqxshqjl789kmsy9pbqjn06-cargo-bundle-0.6.1-zed-vendor.tar.gz`
> from your nix store in order to be able to reproduce this
We want to be setting `outputHash` on the [first derivation][first-drv]
instead. This change has us just do the call to `fetchCargoTarball`
manually instead of using overrides.
[first-drv]:
10214747f5/pkgs/build-support/rust/fetch-cargo-vendor.nix (L85)
---
I suspect CI/other machines didn't catch this due to a store path
matching the name + `outputHash` already being present but I'm not
entirely sure how this happened...
`sha256-Q49FnXNHWhvbH1LtMUpXFcvGKu9VHwqOXXd+MjswO64=` is actually a
`fetchCargoTarball` hash, not a `fetchCargoVendor` hash (and upstream
`cargo-about`'s `cargoDeps` [has been using `cargoVendor`][ups] since
before the nixpkgs bump in 50ad71a630)
[ups]:
1d09c579c1/pkgs/by-name/ca/cargo-about/package.nix (L22)
---
> [!NOTE]
> eventually we'll be able to just have `.overrideAttrs (_: { cargoHash
= "..."; })` work as expected [^2]
---
Release Notes:
- N/A
[^2]:
[now that
`buildRustPackage`](https://github.com/NixOS/nixpkgs/pull/382550) uses
[`lib.extendMkDerivation`](bbdf8601bc/doc/build-helpers/fixed-point-arguments.chapter.md)
(NixOS/nixpkgs/#234651) the groundwork is in place; a follow PR [needs
to use `cargoHash` and friends from
`finalAttrs`](10214747f5/pkgs/build-support/rust/build-rust-package/default.nix (L104))
Previously, when comparing a block with an empty range to an empty query
range in non-inclusive mode, our binary search logic could end up
computing an inverted range, causing a panic.
This commit adds special casing when comparing empty blocks with empty
ranges.
cc @as-cii: I'm realizing that the approach to searching for the
intersecting replacement blocks makes some invalid assumptions about the
ordering of replace decorations. They aren't ordered at all by their end
range. @maxbrunsfeld and I are wondering if long term, we should remove
replace decorations and find another solution for folding buffers in
multi buffers.
Release Notes:
- Fixed an occasional panic that would occur when navigating to the next
change hunk with a pending inline transformation present.
Co-authored-by: Peter Tripp <petertripp@gmail.com>
This PR disables `parallel_tool_calls` for the models that support it,
as the Agent currently expects at most one tool use per turn.
It was a bit of trial and error to figure this out. OpenAI's API
annoyingly will return an error if passing `parallel_tool_calls` to a
model that doesn't support it.
Release Notes:
- N/A
This adds a nix CI job to build the flake in debug mode for
aarch64-darwin and x86-linux. For now this job will only run when the
`run-nix` label is added to a PR.
The CI job doesn't push to cachix for now, so every build is a clean
build.
I also added a condition to the garbage collection step so it only runs
when the nix store is >50GB.
Release Notes:
- N/A
Follow-up of https://github.com/zed-industries/zed/pull/26410
The action does not sort the items the way Vim does, but still better
than the previous state.
Release Notes:
- N/A
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This makes context essentially work the same way as `read-file`,
increasing the likelihood of cache hits.
Just like with `read-file`, we'll notify the model when the user makes
an edit to one of the tracked files. In the future, we want to send a
diff instead of just a list of files, but that's an orthogonal change.
Release Notes:
- agent: Improved caching of files in context
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Same as `editor::RestartLanguageServer`, now there's an
`editor::StopLanguageServer` action that stops all language servers,
related to the currently opened editor.
Opening another singleton editor with the same language or changing
selections in a multi buffer will bring the servers back up.
Release Notes:
- Added a way to temporarily stop LSP servers
---------
Co-authored-by: Michael Sloan <mgsloan@gmail.com>
This PR adds the token count to the active thread view. It doesn't
behaves quite like Assistant 1 where it updates as you type, though; it
updates after you submit the message.
<img
src="https://github.com/user-attachments/assets/82d2a180-554a-43ee-b776-3743359b609b"
width="700" />
---
Release Notes:
- agent: Add token count in the thread view
---------
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Release Notes:
- Fixed a rendering bug that caused context in the agent to not wrap
properly.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Zed AI <ai+claude-3.7@zed.dev>
### Context
The Anthropic API fails if a request message contains a tool use and no
`Text` segments or it only contains empty `Text` segments. These are
cases that the model itself produces, but the API doesn't support
sending them back.
#27917 fixed this by appending "Using tool..." in the thread's message,
but this causes the actual conversation to include it, so it would
appear in the UI (we would actually display a gap because we never
rendered its markdown, but "Using tool..." would show up when the thread
was restored).
### Solution
We'll now only append this placeholder when we build the request, so the
API still sees it, but the UI/Thread doesn't.
Another issue we found is that the model starts mimicking these
placeholders in later tool uses which is undesirable. So unfortunately,
we had to add logic to filter them out.
Release Notes:
- agent: Improved rendering of tool uses without text
---------
Co-authored-by: Bennet <bennet@zed.dev>
Previously the "Thinking..." step would show up as pending, even though
the user cancelled the generation:
<img width="672" alt="image"
src="https://github.com/user-attachments/assets/c9cdce0a-d827-4e23-96f5-b150465911a7"
/>
Release Notes:
- Fixed an issue where the thinking step would show up as pending even
when the generation was cancelled
This happened because of two reasons:
- `Workspace::recent_navigation_history` didn't include the current file
- The context picker added the current file to a exclude list
The latter was actually intentional because we already show the file in
the suggested context, but now that we actually have mentions, it's just
inconvenient not to have it there.
Release Notes:
- N/A
This was accidentally getting added due to increased feature
unification. We've manually excluded reqwest to go back to the desired
behavior: remote_server, doesn't depend on openssl.
Release Notes:
- N/A
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This PR adds the `Cargo.toml` for the `workspace-hack` crate to the
ignore list for Renovate, as it is opening a number of PRs against it
that will interfere with it.
Release Notes:
- N/A
This PR adds the ability to edit previous user messages in the thread.
Release Notes:
- Agent: Added the ability to edit previous user messages
(Preview-only).
Release Notes:
- Fixed a bug where Zed sometimes added multiple redundant FS watchers
when language servers requested to watch paths. This could cause saves
and git operations to fail if Zed exceeded the file descriptor limit.
---------
Co-authored-by: Piotr <piotr@zed.dev>