mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-02 13:30:26 +01:00
agent_ui: Route agent thread feedback through Cloud (#49324)
This PR updates the `Agent Thread Rated` event to be routed through Cloud instead of the normal telemetry pipeline. Closes CLO-223. Release Notes: - N/A
This commit is contained in:
@@ -181,6 +181,31 @@ impl CloudApiClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn submit_agent_feedback(&self, body: SubmitAgentThreadFeedbackBody) -> Result<()> {
|
||||
let request = self.build_request(
|
||||
Request::builder().method(Method::POST).uri(
|
||||
self.http_client
|
||||
.build_zed_cloud_url("/client/feedback/agent_thread")?
|
||||
.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 agent feedback.\nStatus: {:?}\nBody: {body}",
|
||||
response.status()
|
||||
)
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
fn build_request(
|
||||
|
||||
Reference in New Issue
Block a user