diff --git a/crates/cloud_llm_client/src/cloud_llm_client.rs b/crates/cloud_llm_client/src/cloud_llm_client.rs index eca725bef1..f0edef6e27 100644 --- a/crates/cloud_llm_client/src/cloud_llm_client.rs +++ b/crates/cloud_llm_client/src/cloud_llm_client.rs @@ -156,6 +156,9 @@ pub struct PredictEditsBody { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PredictEditsGitInfo { + /// Repo-relative path to the file that contains the input excerpt. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub input_file_path: Option, /// SHA of git HEAD commit at time of prediction. #[serde(skip_serializing_if = "Option::is_none", default)] pub head_sha: Option, @@ -165,13 +168,16 @@ pub struct PredictEditsGitInfo { /// URL of the remote called `upstream`. #[serde(skip_serializing_if = "Option::is_none", default)] pub remote_upstream_url: Option, + /// Recently active files that may be within this repository. #[serde(skip_serializing_if = "Option::is_none", default)] pub recent_files: Option>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PredictEditsRecentFile { - pub repo_path: String, + /// Path to a file within the repository. + pub path: String, + /// Milliseconds between the editor for this file being active and the request time. pub active_to_now_ms: u32, } diff --git a/crates/zeta/src/zeta.rs b/crates/zeta/src/zeta.rs index 6dbb8e317c..331949b9a2 100644 --- a/crates/zeta/src/zeta.rs +++ b/crates/zeta/src/zeta.rs @@ -1146,8 +1146,9 @@ and then another } let git_store = project.git_store().read(cx); - let (repository, _repo_path) = + let (repository, repo_path) = git_store.repository_and_path_for_project_path(&project_path, cx)?; + let repo_path_str = repo_path.to_str()?; let repository = repository.read(cx); let head_sha = repository @@ -1163,6 +1164,7 @@ and then another let recent_files = self.recent_files(&buffer_snapshotted_at, repository, cx); Some(PredictEditsGitInfo { + input_file_path: Some(repo_path_str.to_string()), head_sha, remote_origin_url, remote_upstream_url, @@ -1231,7 +1233,7 @@ and then another continue; }; results.push(PredictEditsRecentFile { - repo_path: repo_path_str.to_string(), + path: repo_path_str.to_string(), active_to_now_ms, }); } else {