From 87609557f008e31c31f164512b3824ed9ccd74a5 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Mon, 25 Aug 2025 22:47:00 -0600 Subject: [PATCH] Filter out excessively long paths --- crates/zeta/src/zeta.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/zeta/src/zeta.rs b/crates/zeta/src/zeta.rs index 73c6cfb914..a415c95d3b 100644 --- a/crates/zeta/src/zeta.rs +++ b/crates/zeta/src/zeta.rs @@ -75,6 +75,9 @@ const MAX_EVENT_COUNT: usize = 16; /// Maximum number of recent files to track. const MAX_RECENT_PROJECT_ENTRIES_COUNT: usize = 16; +/// Maximum file path length to include in recent files list. +const MAX_RECENT_FILE_PATH_LENGTH: usize = 512; + /// Maximum number of edit predictions to store for feedback. const MAX_SHOWN_COMPLETION_COUNT: usize = 50; @@ -1184,6 +1187,10 @@ and then another self.recent_project_entries.remove(ix); continue; }; + if repo_path_str.len() > MAX_RECENT_FILE_PATH_LENGTH { + self.recent_project_entries.remove(ix); + continue; + } if let Some(file_status) = repository.status_for_path(&repo_path) { if file_status.is_ignored() || file_status.is_untracked() { // entry not removed because it may belong to a nested repository