Commit log

ebdb755 Surface upstream rate limits from Anthropic (#16118)

Click to expand commit body
This PR makes it so hitting upstream rate limits from Anthropic result
in an HTTP 429 response instead of an HTTP 500.

To do this we need to surface structured errors out of the `anthropic`
crate.

Release Notes:

- N/A

Marshall Bowers created

fbb533b assistant: Require user to accept TOS for cloud provider (#16111)

Click to expand commit body
This adds the requirement for users to accept the terms of service the
first time they send a message with the Cloud provider.

Once this is out and in a nightly, we need to add the check to the
server side too, to authenticate access to the models.

Demo:


https://github.com/user-attachments/assets/0edebf74-8120-4fa2-b801-bb76f04e8a17



Release Notes:

- N/A

Thorsten Ball created

98f314b assistant: Add debug inspector (#16105)

Click to expand commit body
I went with inline approach directly within the panel.
First, enable workflow debugging in the hamburger menu (this works
retroactively as well):


![image](https://github.com/user-attachments/assets/d2ab8edf-bb7b-49a4-8f70-9a6fe94dc7dd)

This enables debug buttons in the header of each step:

![image](https://github.com/user-attachments/assets/3b5d479f-7473-4c41-a2e7-8c10bb71f0ff)
Enabling one pretty-prints the workflow step internals:

![image](https://github.com/user-attachments/assets/e651e826-1270-49ff-8bb6-046c07c006bf)


Release Notes:

- N/A

Piotr Osiewicz created

b6b0815 assistant: Show tooltips on workflow step buttons only when cursor is in step (#16108)

Click to expand commit body
Release Notes:

- N/A

Piotr Osiewicz created

fc64843 Enhance HTTP API for extensions (#16067)

Click to expand commit body
# HTTP Client Improvements for Extension API

This PR enhances the HTTP client functionality in the Zed extension API,
providing more control over requests and allowing for streaming
responses.

## Key Changes

1. Extended `HttpRequest` struct:
   - Added `method` field to specify HTTP method
   - Added `headers` field for custom headers
   - Added optional `body` field for request payload

2. Introduced `HttpMethod` enum for supported HTTP methods

3. Updated `HttpResponse` struct:
   - Added `headers` field to access response headers
- Changed `body` type from `String` to `Vec<u8>` for binary data support

4. Added streaming support:
   - New `fetch_stream` function to get a response stream
   - Introduced `HttpResponseStream` resource for chunked reading

5. Updated internal implementations to support these new features

6. Modified the Gleam extension to use the new API structure

## Motivation

These changes provide extension developers with more flexibility and
control over HTTP requests. The streaming support is particularly useful
for handling large responses efficiently or ideally streaming into the
UI.

## Testing

- [x] Updated existing tests
- [ ] Added new tests for streaming functionality

## Next Steps

- Consider adding more comprehensive examples in the documentation
- Evaluate performance impact of streaming for large responses

Please review and let me know if any adjustments are needed.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>

Nathan Sobo and Marshall Bowers created

f952126 collab: Remove LLM completions over RPC (#16114)

Click to expand commit body
This PR removes the LLM completion messages from the RPC protocol, as
these now go through the LLM service as of #16113.

Release Notes:

- N/A

Marshall Bowers created

f992cfd Update provider logos (#16115)

Click to expand commit body
- Updates provider logos for Anthropic, Google and Ollama
- Increases the size of icons in the model selector

Release Notes:

- N/A

Nate Butler created

6389c61 Always stream completions through the LLM service (#16113)

Click to expand commit body
This PR removes the `llm-service` feature flag and makes it so all
completions are done via the LLM service when using the Zed provider.

Release Notes:

- N/A

Marshall Bowers created

bab4da7 Fix corner radius when doing `rounded_full` (#15663)

Click to expand commit body
Release Notes:

- Fixed issue when doing `rounded_full`, it should render a pill-shape
rect instead of current eye-shape.

For example with this code
`div().h_4().w_16().bg(rgb(0xffffff)).rounded_full()`

Current:

<img width="144" alt="image"
src="https://github.com/user-attachments/assets/f8b20c7c-d91f-4c20-9f38-d435f59e72b7">

Fixed:

<img width="172" alt="image"
src="https://github.com/user-attachments/assets/ff8bbe26-2b31-4ef1-a2fb-25b458386ffb">

Son created

a15a956 Accept finished inline transformations only if the user saves manually (#16112)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/16042

This commit modifies the behavior of inline transformations to only
accept finished transformations when the user manually saves the file.
Previously, transformations were automatically accepted on any save
event, including autosaves.

This was achieved by updating the `Pane` and `Workspace` structs to emit
a new `UserSavedItem` event when a manual save occurs, and modifying the
`InlineAssistant` to register and handle this new event (instead of
`editor::Saved`).

Release Notes:

- N/A

Antonio Scandurra created

48f6193 Improve workflow step pruning and symbol similarity matching (#16036)

Click to expand commit body
This PR improves workflow step management and symbol matching. We've
optimized step pruning to remove any step that intersects an edit and
switched to normalized Levenshtein distance for more accurate symbol
matching.

Release Notes:

- N/A

Antonio Scandurra created

355aebd Introduce prompt override script and adjust names (#16094)

Click to expand commit body
This PR introduces a new script for iterative development of prompt
overrides in Zed.

Just `script/prompts link` and your running Zed should start using
prompts from `zed/assets/prompts`. Use `script/prompts unlink` to undo.
You can also link with `script/prompts link --worktree` to store the
prompts to a `../zed_prompts` worktree that's a sibling of your repo, in
case you don't want to mess with your working copy. Just don't forget
about it!

Key changes:
- Add new `script/prompts` for managing prompt overrides
- Rename `prompt_templates_dir` to `prompt_overrides_dir` for clarity
- Update paths to use `~/.config/zed/prompt_overrides` instead of
`~/.config/zed/prompts/templates`
- Adjust `PromptBuilder` to use the new `prompt_overrides_dir` function

These changes simplify the process of customizing prompts and provide a
more intuitive naming convention for override-related functionality.

Release Notes:

- N/A

Nathan Sobo created

10937c6 Fetch staff members from GitHub org

Joseph T Lyons created

4818e0b Don't thank staff members in release notes

Joseph T Lyons created

2490b05 Fix warning message

Joseph T Lyons created

e99113e Fix warning message

Joseph T Lyons created

3140d6c collab: Temporarily bypass LLM rate limiting for staff (#16089)

Click to expand commit body
This PR makes it so staff members will be exempt from rate limiting by
the LLM service.

This is just a temporary measure until we can tweak the rate-limiting
heuristics.

Staff members are still subject to upstream LLM provider rate limits.

Release Notes:

- N/A

Marshall Bowers created

492f6b9 Update issue-detection RegEx

Joseph T Lyons created

36a560d Update the dangerfile to check for issue links

Joseph T Lyons created

6f104fe Copy `extension_api` Rust files to `OUT_DIR` when building `extension` to work around rust-analyzer limitation (#16064)

Click to expand commit body
Copies rust files from extension_api/wit to the OUT_DIR to allow
including them from within the crate, which is supported by
rust-analyzer. This allows rust-analyzer to deal with the included
files. It doesn't currently support files outside the crate.

Release Notes:

- N/A

Nathan Sobo created

550e139 repl: Set the default lines ✖️ columns for the REPL to 32x128 (#16061)

Click to expand commit body
![image](https://github.com/user-attachments/assets/dce938ef-bdfd-4412-a074-90c883286263)

Release Notes:

- Improved visuals of repl stdout/stderr by reducing default line count
to 32

Kyle Kelley created

33e120d Capture telemetry data on per-user monthly LLM spending (#16050)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

8688b2a Add telemetry for LLM usage (#16049)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

423c7b9 Larger rate limit integers (#16047)

Click to expand commit body
Tokens per day may exceed the range of Postgres's 32-bit `integer` data
type.

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

0932818 zed_extension_api: Release v0.0.7 (#16048)

Click to expand commit body
This PR releases v0.0.7 of the Zed extension API.

Support for this version of the extension API will land in Zed v0.149.0.

Release Notes:

- N/A

Marshall Bowers created

fbebb73 Use LLM service for tool call requests (#16046)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

d96afde Avoid `insert ... on conflict` on startup (#16045)

Click to expand commit body
These queries advance the id sequence even when there's nothing to
insert

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

b1c69c2 Fix usage recording in llm service (#16044)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

eb3c4b0 Docs Party 2024 (#15876)

Click to expand commit body
Co-authored-by: Raunak Raj <nkray21111983@gmail.com>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Joseph T Lyons <JosephTLyons@gmail.com>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Jason <jason@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Jason Mancuso <7891333+jvmncs@users.noreply.github.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>

Peter Tripp , Raunak Raj , Thorsten Ball , Bennet , Marshall Bowers , Joseph T Lyons , Mikayla , Jason , Antonio Scandurra , Max Brunsfeld , Marshall , Nathan Sobo , Jason Mancuso , and Piotr Osiewicz created

c633fa5 assistant: Improve quote selection (#16038)

Click to expand commit body
https://github.com/user-attachments/assets/fe283eec-169f-4dfd-bae2-cc72c1c3f223



Release Notes:

- Include more context when using `assistant: Quote selection` to insert
text into the assistant panel

---------

Co-authored-by: Thorsten <thorsten@zed.dev>

Bennet Bo Fenner and Thorsten created

46a4dd3 Update Rust crate prometheus to v0.13.4 (#15941)

Click to expand commit body
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [prometheus](https://togithub.com/tikv/rust-prometheus) | dependencies
| patch | `0.13.3` -> `0.13.4` |

---

### Release Notes

<details>
<summary>tikv/rust-prometheus (prometheus)</summary>

###
[`v0.13.4`](https://togithub.com/tikv/rust-prometheus/blob/HEAD/CHANGELOG.md#0134)

[Compare
Source](https://togithub.com/tikv/rust-prometheus/compare/v0.13.3...v0.13.4)

- Improvement: Add PullingGauge
([#&#8203;405](https://togithub.com/tikv/rust-prometheus/issues/405))

- Improvement: Let cargo know which example requires which features
([#&#8203;511](https://togithub.com/tikv/rust-prometheus/issues/511))

- Bug fix: Prevent `clippy::ignored_unit_patterns` in macro expansions
([#&#8203;497](https://togithub.com/tikv/rust-prometheus/issues/497))

- Internal change: Add CI job for minimum toolchain (MSRV)
([#&#8203;467](https://togithub.com/tikv/rust-prometheus/issues/467))

- Internal change: Update CI to `actions/checkout@v4`
([#&#8203;499](https://togithub.com/tikv/rust-prometheus/issues/499))

-   Internal change: Update dependencies

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

renovate[bot] and renovate[bot] created

49f760e collab: Set `LLM_DATABASE_MAX_CONNECTIONS` (#16035)

Click to expand commit body
This PR updates the collab template to set the
`LLM_DATABASE_MAX_CONNECTIONS` environment variable for the LLM service.

Release Notes:

- N/A

Marshall Bowers created

225726b Remove code paths that skip LLM db in prod (#16008)

Click to expand commit body
Release Notes:

- N/A

Max Brunsfeld created

c1872e9 vim: Fix ctrl-u/ctrl-d with high `vertical_scroll_margin` (#16031)

Click to expand commit body
This makes sure that the `vertical_scroll_margin` doesn't leave the
cursor out of screen or somewhere it shouldn't go when it's higher than
the visible lines on screen.

So we cap it to `visible_line_count / 2`, similar to nvim:


https://github.com/neovim/neovim/blob/5aa1a9532cbac835ad027ebdf04311c7e8fb7007/src/nvim/window.c#L6560

Fixes #15101

Release Notes:

- Fixed `ctrl-u`/`ctrl-d` in Vim mode not working correctly when
`vertical_scroll_margin` is set to a really high value.

Co-authored-by: Bennet <bennet@zed.dev>

Thorsten Ball and Bennet created

09c9ed4 vim: Fix panic due to overflow when scrolling (#16029)

Click to expand commit body
When setting `"vertical_scroll_margin": 99` or other high values this
can lead to a panic that crashes Zed.

Release Notes:

- vim: Fixed a possible panic that could happen when using a very high
value for `vertical_scroll_margin` that exceeded the number of visible
lines on the screen.

Co-authored-by: Bennet <bennet@zed.dev>

Thorsten Ball and Bennet created

19d8422 stories: Get OverflowScrollStory to scroll again (#15982)

Click to expand commit body
This makes it at least scroll again, but it doesn't scroll down to the
last element yet. We haven't figured out why yet.


Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>

Thorsten Ball , Bennet , and Antonio created

173f6e7 assistant panel: Make configuration view scrollable (#16022)

Click to expand commit body
We had to resort to this "hack" to get it to work, since nothing else we
tried (changing the `Pane`, changing the `ConfigurationView`, changing
the `AssistantPanel`, ...) worked.

Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>

Thorsten Ball , Antonio , and Bennet created

e783142 Fix `vertical_scroll_margin` not being capped for large `vertical_scroll_margin` values (#15473)

Click to expand commit body
When switching to function definitions in a new buffer the
`AutoscrollStrategy::Focused` being emitted to scroll to the found
location.
If a large value `vertical_scroll_margin` (e.g.: 99) is set, this leads
to an incorrectly calculated position and the new buffer opens in the
wrong place.

In `autoscroll_vertically()` there is a margin calculated to cap the
value of `vertical_scroll_margin` for certain AutoscrollStrategies. This
margin is being used in `AutoscrollStrategy::Fit` and
`AutoscrollStrategy::Newest` but was probably forgotten for
`AutoscrollStrategy::Focused`.

- Might fix [#15101](https://github.com/zed-industries/zed/issues/15101)

Release Notes:

- N/A

Massimo Mund created

06833d7 Support MSbuild row-column format in PathWithPosition (#15589)

Click to expand commit body
This implements #15412. Row-column parsing is changed into a regex to
support more complex patterns like the MSBuild diagnostics. Terminal
`word_regex` is also relaxed to match those suffixes.

Release Notes:

- N/A

Santeri Salmijärvi created

7a60041 Add injections for tagged template literals (#15984)

Click to expand commit body
This PR adds syntax highlighting support for `css`, `html`, `js`,
`json`, `sql`, `ts`, `yaml` and `yml` in `javascript`, `typescript` and
`tsx` languages where the contents of tagged template literals are now
highlighted.

This does not actually enable language features (like LSP support), it
only does syntax highlighting.

Before this change:
<img width="561" alt="image"
src="https://github.com/user-attachments/assets/74bace1b-5ce1-4b17-8a97-035bba152d9c">


After this change:
<img width="607" alt="image"
src="https://github.com/user-attachments/assets/f227145b-3f4a-4c27-b14f-7143bb19b4cf">

/cc @mrnugget 

Release Notes:

- Added syntax highlighting for tagged template literals in
`javascript`, `typescript` and `tsx` languages for `css`, `html`, `js`,
`json`, `sql`, `ts`, `yaml` and `yml`.
([#15984](https://github.com/zed-industries/zed/issues/15984))

Robin Malfait created

240b7c6 Fix llm queries (#16006)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

06625bf Apply rate limits in LLM service (#15997)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>

Max Brunsfeld , Marshall , and Marshall Bowers created

2bc5037 assistant: Show an error when `/fetch` returns no content (#16001)

Click to expand commit body
This PR makes it so the `/fetch` slash command will display an error
when the URL does not have any textual content:

<img width="308" alt="Screenshot 2024-08-08 at 4 51 55 PM"
src="https://github.com/user-attachments/assets/bf4cbc18-c65b-48a2-aedd-26b50f47f018">

Release Notes:

- N/A

Marshall Bowers created

5b8ce91 Fix isStaff boolean logic

Joseph T Lyons created

abb6d40 Put `/docs` behind a feature flag (#16000)

Click to expand commit body
This PR puts the `/docs` slash command behind a feature flag.

Release Notes:

- N/A

Marshall Bowers created

bd59af1 vim: Support ranges in command (#15985)

Click to expand commit body
The most requested feature here is "search and replace in visual mode",
but as a happy side effect we can now support things like :2,12j to join
those lines, and much much more.



Release Notes:

- vim: Added support for range syntax in command
([#9428](https://github.com/zed-industries/zed/issues/9428)).
- vim: Prefill command with `:'<,'>` from visual mode
([#13535](https://github.com/zed-industries/zed/issues/13535)).

Conrad Irwin created

b7d6b0a Filter out staff members from thanks line

Joseph T Lyons created

b28507d Link to pull requests in changelog notes (#15996)

Click to expand commit body
This PR changes how we ask users to draft up PRs and how release note
generation happens.

We no longer force the user to create the markdown URL link, but we do
ask them to use the `closes` [GitHub magic
word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
to link the PR to an issue, so that the issue is closed automatically
when closing the PR.

As for the changelog release notes, we are no longer linking to the
issues, but the PR itself, which should contain the issue if a reader
wants to dive further back. This makes our output more consistent, as
every line will have a link, even if there is no issue associated, and
it removes the need for us to try to parse the issue url in the body to
try to correct mistakes in how they were forming Markdown urls - the PR
url is always returned in the request, which makes it easy. **Lastly,
it's just a lot less annoying to make the release notes.**

The new PR format will be:

```
Closes #ISSUE

Release Notes:

- Added/Fixed/Improved ...
```

The new script output format will be:

```
PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background`
Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant))
Release Notes:

- linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value.
--------------------------------------------------------------------------------
PR Title: Skip over folded regions when iterating over multibuffer chunks
Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz))
Release Notes:

- Fixed poor performance when editing in the assistant panel after inserting large files using slash commands
--------------------------------------------------------------------------------
```

This still requires us to manually apply the credit line, but the line
is already fully formed, so this should still be faster than having to
manually create that line / fix any line where someone messed it up
(which was all the time). I would just automatically apply it to the
release notes, but sometimes we have multiple bullet points in a single
PR and no real structure is enforced, so I foresee doing anything
automatic breaking and needing manual adjustment.

Release Notes:

- N/A

Joseph T. Lyons created

a39f1f5 Fix Windows build in CI (#15990)

Click to expand commit body
This PR fixes the Windows build in CI, which was failing due to Clippy
warnings.

Release Notes:

- N/A

Marshall Bowers created

fbc629d assistant: Put `/search` behind a feature flag (#15987)

Click to expand commit body
This PR puts the `/search` slash command behind a feature flag.

Release Notes:

- N/A

Marshall Bowers created