Commit Graph
162 Commits
Author SHA1 Message Date
Ben Kunkle df8bafdccf ep: Avoid including collaborator edits in edit history sent to model (#51343)
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 *or* Added/Fixed/Improved ...
2026-03-12 16:56:37 -04:00
Tom HouléandMarshall Bowers 9fb57b0daf language_model: Centralize LlmApiToken to a singleton (#51225)
The edit prediction, web search and completions endpoints in Cloud all
use tokens called LlmApiToken. These were independently created, cached,
and refreshed in three places: the cloud language model provider, the
edit prediction store, and the cloud web search provider. Each held its
own LlmApiToken instance, meaning three separate requests to get these
tokens at startup / login and three redundant refreshes whenever the
server signaled a token update was needed.

We already had a global singleton reacting to the refresh signals:
RefreshLlmTokenListener. It now holds a single LlmApiToken that all
three services use, performs the refresh itself, and emits
RefreshLlmTokenEvent only after the token is fresh. That event is used
by the language model provider to re-fetch models after a refresh. The
singleton is accessed only through `LlmApiToken::global()`.

I have tested this manually, and it token acquisition and usage appear
to be working fine.

Edit: I've tested it with a long running session, and refresh seems to
be working fine too.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2026-03-11 20:54:51 +01:00
Lukas WirthandBen Kunkle b21f4a3deb Prevent remote edits from triggering edit predictions when collaborating (#51196)
BufferEvent::Edited had no way to distinguish local edits from remote
(collaboration) edits. This caused edit prediction behavior to fire on
the guest's editor when the host made document changes.

Release Notes:

- Fixed edit predictions triggering on collaboration guests when the
host edits the document.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-03-10 15:23:49 +00:00
Ben Kunkle 147577496d ep: Include diagnostics in ZetaPromptInput (#51141)
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 *or* Added/Fixed/Improved ...
2026-03-09 20:24:41 -04:00
Max BrunsfeldandBen Kunkle 2bd5c21855 zeta: Allow the server to select the editable and context ranges more flexibly (#50975)
Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-03-09 19:58:31 -04:00
Oleksiy Syvokon b54716dac1 ep: Skip context retrieval when already performed (#51100)
Previously we didn't distinguish between an empty `.related_files[]` and
a case where context collection hadn't run yet. As a result, context
retrieval was always attempted for examples with empty `related_files`.

Release Notes:

- N/A
2026-03-09 14:42:15 +00:00
Ben Kunkle e9c691a1e1 ep: Add <|no-edit|> command to hashlines format (#51103)
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 *or* Added/Fixed/Improved ...
2026-03-09 13:33:42 +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
Oleksiy Syvokon 4b3660bc33 ep: Unify code in parse_output and zeta_prompt (#50958)
This also fixed `ep parse-output` for newer formats

Release Notes:

- N/A
2026-03-06 22:07:54 +02: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
61d969665b zeta: Add variable edit format (#50850)
Release Notes:

- N/A

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-03-05 16:23:36 -08:00
Ben Kunkle da9d5481e5 zeta2: Don't remove redundant excerpts on the client (#50886)
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 *or* Added/Fixed/Improved ...
2026-03-05 19:04:49 -05:00
Ben Kunkle c5f3a1d367 ep: Indicate active experiment (#50870)
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 *or* Added/Fixed/Improved ...
2026-03-05 21:19:49 +00:00
Ben KunkleandAgus 6c914add26 ep: Capture example as part of settled events (#50847)
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 *or* Added/Fixed/Improved ...

Co-authored-by: Agus <agus@zed.dev>
2026-03-05 15:38:34 -05:00
Oleksiy Syvokon 8e5356c9d6 ep: Fix infinite loop of EP requests in some cases (#50833)
When a diagnostic-triggered prediction returns no edits, don't fall back
to requesting another diagnostic prediction. This was causing an
infinite loop that burned through the API rate limit until hitting 429
errors.


Release Notes:

- N/A
2026-03-05 18:17:45 +00:00
Oleksiy Syvokon 27a9b60e47 ep: Fix race condition resulting in duplicate requests (#50830)
When multiple `queue_prediction_refresh` calls land in the same
synchronous frame, all spawned tasks would read the same throttle state
and each send an identical cloud request.

Now the second task would see that the first request has been sent and
would quit.

Release Notes:

- N/A
2026-03-05 17:20:04 +02:00
Max Brunsfeld 67c2c34b94 Include repo_url in edit prediction requests when data collection is enabled (#50745)
Release Notes:

- N/A
2026-03-04 13:14:44 -08:00
Oleksiy Syvokon 9b8ad01769 ep: Option to configure custom Baseten environment (#50706)
Release Notes:

- N/A
2026-03-04 14:56:56 +00:00
Tom Houlé a1d40370cf cloud_api_client: Send the organization ID in LLM token requests (#50517)
This is already expected on the cloud side. This lets us know under
which organization the user is logged in when requesting an llm_api
token.

Closes CLO-337

Release Notes:

- N/A
2026-03-04 15:45:33 +01:00
Max Brunsfeld 2772db8dcc Remove zeta2 feature flag (#50618)
Release Notes:

- N/A
2026-03-03 21:21:52 +00:00
Ben Kunkle dc7cbd3326 zeta2: Hashlines prompt format (#50623)
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 *or* Added/Fixed/Improved ...
2026-03-03 16:11:32 -05:00
Ben Kunkle a5a1977e98 ep: API keys for OpenAI compatible (#50615)
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:

- Added support for providing an API key to OpenAI-compatible edit
prediction providers
2026-03-03 15:28:48 -05:00
Max Brunsfeld 880b2e512b Remove Zeta1 logic, allow choosing zeta2 experiment (#50560)
Release Notes:

- N/A
2026-03-02 22:24:55 -08:00
Ben KunkleandMax ed3553491b ep: Include more context (#50533)
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 *or* Added/Fixed/Improved ...

---------

Co-authored-by: Max <max@zed.dev>
2026-03-02 17:23:30 -05:00
Kirill Bulatov 7ad524661d Remove Supermaven-related code from Zed (#50537)
Follow-up of https://github.com/zed-industries/zed/pull/49317

See also https://supermaven.com/blog/sunsetting-supermaven

- N/A
2026-03-02 22:18:49 +00:00
fb01b1953a ep: Replace snapshot events with settled event (#50356)
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-02-27 16:09:45 -08:00
Oleksiy Syvokon a759000b16 ep: Heuristic to apply patches to files without trailing newline (#50291)
This is a workaround for the fact that ep patches don't have the '\No
newline at end of file` marker.


Release Notes:

- N/A
2026-02-27 14:35:30 +02:00
Max Brunsfeld 9ff0b0206f Include optional model version with EP acceptance and rejection messages (#50262)
Release Notes:

- N/A
2026-02-27 01:07:37 +00:00
Ben Kunkle e439c295c5 zeta2: Send snapshot event (#50126)
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 *or* Added/Fixed/Improved ...
2026-02-25 17:25:49 -05:00
Max Brunsfeld 6111af76e8 Use a separate feature flag for EP jumps than for zeta2 (#50041)
This allows us to enable zeta2 for certain end users without opting them
into the still-in-development jumps feature.

Release Notes:

- N/A
2026-02-24 16:43:52 -08:00
Ben KunkleandMax 04db6c389c zeta2: Use editable range returned by cloud for prediction diffs (#50029)
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 *or* Added/Fixed/Improved ...

Co-authored-by: Max <max@zed.dev>
2026-02-24 18:04:57 -05:00
Max BrunsfeldandBen Kunkle 5ef898d61e Fix handling of excerpt regions in EP CLI (#49936)
Previously, we were not computing excerpt regions correctly for EP
examples captured from prod. This PR fixes that, and also simplifies the
data flow in the EP CLI. Examples either come from a concise spec (like
the markdown evals), or are collected from prod. Either way, we compute
from them a `ZetaPromptInput`, and the downstream steps like
prompt-formatting and scoring are derived from that.

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-02-23 17:08:09 -08:00
97a8fe7828 zeta: Consolidate logic for picking region sizes, use larger editable region (#49921)
This will not affect how Zeta 2 behaves in production until we update
Cloud to pull in the changes to the `zeta_prompt` crate. But from some
early testing, it seems to improve behavior, not worsen it, even though
the editable region size differs from the currently-deployed model's
training data.

Release Notes:

- N/A

---------

Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-23 12:52:33 -08:00
Ben Kunkle 556271bc13 zeta2: Try not to jump to collaborators as much (#49742)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-20 15:45:10 -05:00
Oleksiy Syvokon fb82b11f5d ep: Fix panic when switching to a non-store provider (#49698)
The `unreachable()` assumption at `queue_prediction_refresh` could be
violated by an async race condition:

1. `request_prediction_internal` spawns an async task
2. The task awaits a prediction request
3. If the prediction returns `None`, it calls `queue_prediction_refresh`
4. Between the time the prediction was initiated (when the provider was
an EP-store provider) and when the async callback runs, the user can
change their edit prediction provider setting to a non-EP-store provider
5. `queue_prediction_refresh` re-reads the settings and hits the
`unreachable!()

Release Notes:

- N/A
2026-02-20 11:46:28 +02:00
Lukas Wirth aa91fd4a96 Reduce amount of closure monomorphizations part 2 (#49688)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-20 08:32:45 +00:00
Ben Kunkle 85ca795977 ep_store: Don't handle project events for non-EditPredictionStore providers (#49678)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-20 03:24:59 +00:00
62af5b8105 Allow using Zeta through an arbitrary OpenAI-compatible self-hosted API (#49554)
Release Notes:

- Added the ability to use a self-hosted OpenAI-compatible server for
edit predictions.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-19 20:18:36 +00:00
Ben KunkleandZed Zippy 2a0a304249 Seperate throttles for jump and edit based predictions (#49499)
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 *or* Added/Fixed/Improved ...

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-19 09:56:10 -05:00
Oleksiy Syvokon 3129d7e6b5 ep: Parse "user accepted prediction" markers in evals (#49598)
Also:
- Add two evals
- Remove duplicated Example 6 from the teacher prompt 

Release Notes:

- N/A
2026-02-19 13:01:07 +00:00
Oleksiy Syvokon 5305c22223 ep: Encode cursor position in the predicted patch (#49450)
Release Notes:

- N/A
2026-02-18 09:55:26 +00:00
Max Brunsfeld 9743fe7dfd Put back logic for passing data collection choice to cloud (#49426)
Release Notes:

- N/A
2026-02-17 17:43:40 -08:00
Max Brunsfeld 717ea9e998 Filter collection of snowflake requests to those with latest schemas (#49424)
This allows us to just pull requests that have the latest EP request
schema with the `predicted` boolean on events in the edit history.

Release Notes:

- N/A
2026-02-17 16:37:28 -08:00
Marshall BowersandTom 671f818209 edit_prediction: Route edit prediction rating through Cloud (#49385)
This PR updates the `Edit Prediction Rated` event to be routed through
Cloud instead of the normal telemetry pipeline.

Closes CLO-224.

Release Notes:

- N/A

---------

Co-authored-by: Tom <tom@zed.dev>
2026-02-17 18:12:14 +00:00
Max Brunsfeld 806e944e25 Fix EP CLI issues found when generating new teacher predictions (#49327)
Release Notes:

- N/A
2026-02-17 09:33:34 +02:00
Oleksiy Syvokon c093590f2e ep: Fix panic when merging events from different buffers (#49097)
Release Notes:

- N/A
2026-02-13 13:26:03 +00:00
Oleksiy Syvokon c981245a72 ep: Don't run predictions for excerpts with special tokens (#49040)
Release Notes:

- N/A
2026-02-13 13:47:28 +02:00
aa4e1b47dc Separate accepted edit predictions in edit history (#49056)
Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-02-13 00:15:59 +00:00
Eric HolkandBen Kunkle 65027dd4aa Handle newlines better in parse_edits (#48960)
Release Notes:

- Fix a potential crash around multibyte characters in edit predictions

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-02-12 13:01:01 -08:00
25b1377d1d Unify zeta endpoints (#48900)
- [ ] Tests or screenshots needed?
- [ ] Code Reviewed
- [ ] Manual QA

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-02-12 15:24:24 -05:00