Send up Zed version with edit prediction and completion requests (#30136)

This PR makes it so we send up an `x-zed-version` header with the
client's version when making a request to llm.zed.dev for edit
predictions and completions.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-05-07 11:44:30 -04:00 committed by GitHub
parent 5ca114be24
commit a34fb6f6b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 26 additions and 9 deletions

View file

@ -55,7 +55,7 @@ use workspace::notifications::{ErrorMessagePrompt, NotificationId};
use worktree::Worktree;
use zed_llm_client::{
EXPIRED_LLM_TOKEN_HEADER_NAME, MINIMUM_REQUIRED_VERSION_HEADER_NAME, PredictEditsBody,
PredictEditsResponse,
PredictEditsResponse, ZED_VERSION_HEADER_NAME,
};
const CURSOR_MARKER: &'static str = "<|user_cursor_is_here|>";
@ -754,6 +754,7 @@ and then another
let request = request_builder
.header("Content-Type", "application/json")
.header("Authorization", format!("Bearer {}", token))
.header(ZED_VERSION_HEADER_NAME, app_version.to_string())
.body(serde_json::to_string(&body)?.into())?;
let mut response = http_client.send(request).await?;