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>
This commit is contained in:
Marshall Bowers
2026-02-17 13:12:14 -05:00
committed by GitHub
parent 7620c684eb
commit 671f818209
4 changed files with 70 additions and 11 deletions
@@ -206,6 +206,34 @@ impl CloudApiClient {
Ok(())
}
pub async fn submit_edit_prediction_feedback(
&self,
body: SubmitEditPredictionFeedbackBody,
) -> Result<()> {
let request = self.build_request(
Request::builder().method(Method::POST).uri(
self.http_client
.build_zed_cloud_url("/client/feedback/edit_prediction")?
.as_ref(),
),
AsyncBody::from(serde_json::to_string(&body)?),
)?;
let mut response = self.http_client.send(request).await?;
if !response.status().is_success() {
let mut body = String::new();
response.body_mut().read_to_string(&mut body).await?;
anyhow::bail!(
"Failed to submit edit prediction feedback.\nStatus: {:?}\nBody: {body}",
response.status()
)
}
Ok(())
}
}
fn build_request(