# edit_prediction: Report patch apply failures \(\#60637\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7828463fcb6917a344d26edf46b271442bdbc375)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7828463fcb6917a344d26edf46b271442bdbc375

Requested commit: 7828463fcb6917a344d26edf46b271442bdbc375

Commit: 7828463fcb6917a344d26edf46b271442bdbc375

Tree: b93a13c4ffc5721ea9ef3c8b722c063f0f0caf52

Author: Ben Kunkle

Committer: GitHub

## Message

```
edit_prediction: Report patch apply failures (#60637)

# Objective

- Report V4 edit prediction patch apply failures as cloud rejection
events.
- Closes EP-210

## Solution

- Added `PatchApplyFailed` as an edit prediction rejection reason.
- Converted `prediction_edits_for_single_file_diff` errors into rejected
prediction results so the existing rejection pipeline posts them to
`/predict_edits/reject`.
- Kept interpolation failures reported as `InterpolateFailed`.

## Testing

- Ran `cargo fmt --check && cargo check -p edit_prediction`.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
```

## Parents

- [3e976e89bc3767a776965ee4589266b63caac23d](https://git.cafe/gitcafe/zed/commit/3e976e89bc3767a776965ee4589266b63caac23d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7828463fcb6917a344d26edf46b271442bdbc375?format=markdown)
