Commit Graph
72 Commits
Author SHA1 Message Date
Oleksiy Syvokon 9a97c5c3db ep: Add a prompt with git-style merge markers (#47215)
Release Notes:

- N/A
2026-01-20 13:33:43 +00:00
Max Brunsfeld 50a90d35b2 Add a 'rejected patch' field to example specs, for DPO examples (#47043)
The `capture example` action now populates the markdown file with a noop
"Rejected Patch", so that you can easily specify the good and bad
output.

Release Notes:

- N/A
2026-01-18 20:25:23 -08:00
afaccf9c67 Fix edit history clearing bug in ep (#47017)
We were including changes due to Buffer.reload in the edit history.

Release Notes:

- N/A

---------

Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-01-16 15:44:38 -08:00
Ben Kunkle d1e4ef09ee Fix not sending file_chunks parameter to Sweep in evals (#46999)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-16 11:56:33 -05:00
Ben Kunkle 73458a074c Fix context enabled race condition in edit prediction cli (#46997)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-16 15:55:39 +00:00
Max Brunsfeld 780a87dd98 Introduce new predict_edits/v3 endpoint (#46960)
Release Notes:

- N/A
2026-01-16 02:16:34 +00:00
3ce386a118 ep: Add 180 token editable region experiment (#46945)
Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-01-15 17:46:22 -03:00
Lukas Wirth 3d0222a5af remote: Support opening builtin host files in remote workspaces on wsl (#46910)
Release Notes:

- Opening bundled files, keymap, and local release notes now opens in
remote windows instead of opening a new local zed window
- Opening the settings files, keymap files, task files, debug files and
logs will now open within wsl windows instead of opening a new local zed
window
2026-01-15 15:21:57 +00:00
Max BrunsfeldandAgus Zubiaga 445c95aa3c Fix issues processing captured edit prediction examples (#46773)
Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2026-01-14 14:32:42 -08:00
Max BrunsfeldandAgus Zubiaga 14e05ccb78 Allow passing custom access token to zeta2 models via env var (#46830)
Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2026-01-14 12:37:51 -08:00
Piotr Osiewicz ca23fa7c7c copilot: Un-globalify copilot + handle it more directly with EditPredictionStore (#46618)
- **copilot: Fix double lease panic when signing out**
- **Extract copilot_chat into a separate crate**
- **Do not use re-exports from copilot**
- **Use new SignIn API**
- **Extract copilot_ui out of copilot**

Closes #7501

Release Notes:

- Fixed Copilot providing suggestions from different Zed windows.
- Copilot edit predictions now support jumping to unresolved
diagnostics.
2026-01-14 14:44:13 +00:00
20284e4f21 Introduce zeta2 format with cursor content in original order (#46732)
This one does `fim_prefix`, `fim_middle`, and `fim_suffix` in that
order, in the prompt, instead of putting the current middle last.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-01-13 21:53:44 +00:00
Max BrunsfeldandBen Kunkle d67c8f2884 Prevent stale related excerpts by avoiding storing their contents as strings (#46666)
This fixes an issue that we noticed in particular with Mercury edit
predictions.

* [x] fix storage to not go stale
* [x] exclude excerpts that intersect the cursor excerpt
* [x] see if string representation of excerpts can be cached, to avoid
rebuilding it on every prediction

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-01-13 13:31:23 -08:00
Agus Zubiaga 79c69dc622 ep: Fix raw request shape (#46711)
Release Notes:

- N/A
2026-01-13 15:27:31 +00:00
Max Brunsfeld 6b1eb25370 Fix a missing newline in the zeta prompt (#46677)
Release Notes:

- N/A
2026-01-12 23:27:06 -08:00
Agus ZubiagaandMax Brunsfeld 90ec58836e ep: Use FIM-like prompt for zeta2 (#46657)
Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-01-13 00:16:24 +00:00
7853589033 ep: Use non-chat completions for /predict/raw (#46633)
Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
2026-01-12 17:42:50 +00:00
Oleksiy SyvokonandAgus Zubiaga cbb6e2f563 ep: Fix applying patch to text without a trailing newline (#46471)
Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2026-01-12 14:59:25 +00:00
Max Brunsfeld 0afe91ff24 Prepopulate empty patch in example capture (#46480)
This makes it a smoother workflow to capture an edit prediction example
from Zed and then write what you'd expect the patch to be.

Release Notes:

- N/A
2026-01-09 13:58:07 -08:00
Oleksiy SyvokonandAgus Zubiaga e6467fc47a ep: Fix editable region for teacher models (#46459)
Editable region was different for Zeta2 and Teacher, leading to "Edits
outside of editable region" errors.

Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2026-01-09 16:01:19 +00:00
0f75c079a5 Edit prediction: teacher prompt improvements (#46392)
Release Notes:

- N/A

---------

Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-01-08 22:12:32 +00:00
Agus ZubiagaandBen Kunkle 23f571d64c ep: Enable workspace test-support (#46395)
Some code got added to `workspace` that prevents us from running tests
for the `edit_prediction(cli)` crates specifically without the
`test-support` feature flag.

Release Notes:

- N/A

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-01-08 18:30:07 -03:00
Oleksiy Syvokon a87d4c84c9 ep: Allow matching patches against files without trailing newlines (#46357)
A proper fix would be to add `\No trailing newline` marker and handle
it. For now, we do a simpler workaround

Release Notes:

- N/A
2026-01-08 11:54:26 +00:00
Agus Zubiaga 42af91ddee ep cli: Resume from output file (#46293) 2026-01-07 21:50:46 -03:00
Ben Kunkle 6758732a4f mercury: Fix spurious newline removal (#46289)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-07 21:10:07 +00:00
Mikayla MakiandClaude Opus 4.5 97c35c084b gpui: Actually remove the Result from AsyncApp (#45809)
Depends on: https://github.com/zed-industries/zed/pull/45768

Refactor plan:
https://gist.github.com/mikayla-maki/6c4bf263fd80050715ba01f45478796e
Overall plan:
https://gist.github.com/mikayla-maki/7bb5078e4385a2e683e1e1eb40d17d38

This is the big one.

Release Notes:

- N/A

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 12:48:24 -08:00
Oleksiy SyvokonandAgus Zubiaga 76fed22668 ep: Add file deletion support in unified diff parsing (#46279)
- Replace `is_new_file: bool` with `FileStatus` enum
(Created/Modified/Deleted) in udiff.rs to properly track file status
through diff operations
- Handle deleted files in `apply_diff` by calling
`project.delete_file()`
- Fix diff serialization in reorder_patch.rs to output `+++ /dev/null`
for file deletions and parse both `--- /dev/null` and `+++ /dev/null`
correctly
- Add bounds check for edit ranges exceeding buffer length

Also includes edit_prediction_cli improvements:
- Track `context_range` and `editable_range` in ExampleBuffer for more
precise prompt formatting
- Export MAX_CONTEXT_TOKENS and MAX_REWRITE_TOKENS from zeta2
- Wait for buffer parsing before computing ranges
- Respect NO_COLOR env var and enable info-level logging


Release Notes:

- N/A

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2026-01-07 18:54:22 +00:00
Agus Zubiaga f119b978f5 ep cli: Make the udiff parsing more resilient (#46264)
We will now properly handle `\ No newline at the end of file` after
context lines and repeated occurrences. Also, when line numbers are
present in hunk headers, we will use them to disambiguate the location
when the context is not unique enough.

Release Notes:

- N/A
2026-01-07 15:14:17 +00:00
Ben Kunkle 7fa65ea5b1 Add action tracking to enable token healing for Sweep (#46212)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-07 09:58:24 -05:00
Agus Zubiaga 134c5e6bf9 ep cli: Handle opening buffers from files created by the edit history (#46254)
Since we don't persist new files to disk, they don't have entries, so we
have to look them up in memory first.

Release Notes:

- N/A
2026-01-07 13:52:42 +00:00
Max Brunsfeld 67e2a23cba Fix coalescing of multi-line edits (#46220)
I was seeing some surprising un-coalesced edits in the edit history when
looking at captured examples. I realized that we were only coalescing
based on the *ends* of edit ranges, but I think we want to combine hunks
where there are 8 or less unchanged lines in between changes. This PR
implements that.

Release Notes:

- N/A
2026-01-07 02:04:43 +00:00
Max Brunsfeld ff73a91e63 Make all paths relative in captured EP examples (#46213)
I also added debug events for Sweep edit predictions so that we can see
the API response for "no prediction" events when running evals.

Release Notes:

- N/A
2026-01-06 17:27:57 -08:00
Ben Kunkle f3c02086e4 Add sweep acceptance tracking (#46199)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-06 17:20:25 -05:00
Max Brunsfeld 8ca638150a Fix some issues with edit prediction CLI (#46197)
* Added `--repo` and `--name` flags for running only examples with a
specific name, or repo (substring matching)
* Fixed a race condition that caused hangs when running multiple
examples at the same repo and sha
* Fixed a bug where scoring was completely wrong because I had passed
the arguments to `apply_diff_to_string` in the wrong order
* The current evals now run quickly and without errors.

Release Notes:

- N/A
2026-01-06 14:11:19 -08:00
Agus Zubiaga 6070b30524 ep cli: Create entries from new files in edit history (#46196)
Release Notes:

- N/A
2026-01-06 18:56:55 -03:00
Agus Zubiaga 5be7d6f641 ep cli: Refresh cursor path entry (#46195)
Release Notes:

- N/A
2026-01-06 21:41:58 +00:00
114bc699a8 ep: Support both full paths and relative paths in examples (#46177)
Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
2026-01-06 15:14:36 -03:00
61175fceb6 ep: Always collect for staff (#46176)
Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
2026-01-06 15:14:20 -03:00
Oleksiy SyvokonandAgus Zubiaga efeea7973e Edit prediction changes (#46169)
1. Handle diffs with no trailing new lines 
2. ep: Don't assume workdir name in edit history paths
3. Fix `imitate_human_edits()` for pure insertions

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2026-01-06 16:49:26 +00:00
Oleksiy Syvokon 92b0f144c0 Changes to make ep split-commits work (#46160)
1. `apply_diff` will create a file if the diff says so (by starting with
`--- /dev/null`)
2. Update examples format to match recent changes
3. `ep split-commits` can work with a stream of inputs and generate `n`
samples per input
4. Unicode handling fixes

Release Notes:

- N/A
2026-01-06 14:38:44 +00:00
Ben Kunkle 93c447e874 zeta2: Fix double lease panic in event capture (#46096)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-05 18:51:00 +00:00
Max Brunsfeld 0549689eee Improve collection of edit prediction examples (#46010)
Release Notes:

- N/A
2026-01-04 21:53:02 +00:00
Max Brunsfeld 9a79cb8ba1 Improve support for collecting edit prediction training and eval examples (#45914)
* Fix some bugs in capture of EP examples from running app
* Tweak markdown format for EP examples
    * Store repo and revision in TOML front matter
    * Represent cursor position using a comment line
* Allow multiple expected patches in evals
* Remove line-based scoring criteria for evals
* Add a `synthesize` subcommand to the EP cli that generates examples
from git commits

Release Notes:

- N/A
2026-01-03 16:08:35 -08:00
Max Brunsfeld 07ada58466 Improve edit prediction example capture (#45536)
This PR improves the `edit prediction: Capture Example` in several ways:
* fixed bugs in how the uncommitted diff was calculated
* added a `edit_predictions.examples_dir` setting that can be set in
order to have the action automatically save examples into the given
folder
* moved the action into the `edit_predictions` crate, in preparation for
collecting this data passively from end users, when they have opted in
to data sharing, similar to what we did for Zeta 1

Release Notes:

- N/A
2025-12-22 20:40:02 +00:00
Ben Kunkle 07538ff08e Make sweep and mercury API tokens use cx.global instead of OnceLock (#45176)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-12-18 00:32:46 +00:00
Piotr Osiewicz 9ad059d3be copilot: Add support for Next Edit Suggestion (#44486)
This PR introduces support for Next Edit Suggestions while doing away
with calling legacy endpoints. In the process we've also removed support
for cycling completions, as NES will give us a single prediction, for
the most part.

Closes #30124

Release Notes:

- Zed now supports Copilot's [Next Edit
Suggestions](https://code.visualstudio.com/blogs/2025/02/12/next-edit-suggestions).
2025-12-17 21:43:42 +01:00
f084e20c56 Fix stale pending keybinding indicators on focus change (#44678)
Closes #ISSUE

Problem:

- The status bar’s pending keystroke indicator (shown next to --NORMAL--
in Vim mode) didn’t clear when focus moved to another context, e.g.
hitting g in the editor then clicking the Git panel. The keymap state
correctly canceled the prefix, but observers that render the indicator
never received a “pending input changed” notification, so the UI kept
showing stale prefixes until a new keystroke occurred.

Fix:

- The change introduces a `pending_input_changed_queued` flag and a new
helper `notify_pending_input_if_needed` which will flushes the queued
notification as soon as we have an App context. The
`pending_input_changed` now resets the flag after notifying subscribers.

Before:


https://github.com/user-attachments/assets/7bec4c34-acbf-42bd-b0d1-88df5ff099aa

After:



https://github.com/user-attachments/assets/2264dc93-3405-4d63-ad8f-50ada6733ae7



Release Notes:

- Fixed: pending keybinding prefixes on the status bar now clear
immediately when focus moves to another panel or UI context.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-12-17 16:51:16 +00:00
Dominic BurkartandAgus Zubiaga 0d891bd3e5 Enable Zeta edit predictions with custom URL without authentication (#43236)
Enables using Zeta edit predictions with a custom
`ZED_PREDICT_EDITS_URL` without requiring authentication to Zed servers.
This is useful for:

- Development and testing workflows
- Self-hosted Zeta instances
- Custom AI model endpoints

Prior context on this usage of `ZED_PREDICT_EDITS_URL`:
https://github.com/zed-industries/zed/pull/30418

Release Notes:
- Improved self-hosted zeta UX. Users no longer have to log into Zed to
use custom or self-hosted zeta backends.

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-12-15 17:59:40 +00:00
Ben Kunkle 0a5955a464 Ensure Sweep and Mercury keys are loaded for Edit Prediction button (#44894)
Follow up for #44505 

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-12-15 11:43:29 -05:00
Max Brunsfeld b8e40e6fdb Add an action for capturing your last edit as an edit prediction example (#44841)
This PR adds a staff-only button to the edit prediction menu for
capturing your current editing session as edit prediction example file.

When you click that button, it opens a markdown tab with the example. By
default, the most recent change that you've made is used as the expected
patch, and all of the previous events are used as the editing history.

<img width="303" height="123" alt="Screenshot 2025-12-14 at 6 58 33 PM"
src="https://github.com/user-attachments/assets/600c7bf2-7cf4-4d27-8cd4-8bb70d0b20b0"
/>

Release Notes:

- N/A
2025-12-14 20:50:48 -08:00