diff --git a/src/command/agent/import.rs b/src/command/agent/import.rs index 162390dce..5a8579a81 100644 --- a/src/command/agent/import.rs +++ b/src/command/agent/import.rs @@ -799,7 +799,7 @@ fn discover_codex(since: Option, deadline: Instant) -> Result Result<(), InstallDirError> { if name.is_empty() || name == "." || name == ".." || name.contains('/') || name.contains('\0') { return Err(InstallDirError::BadEntryName(name.to_string())); @@ -423,6 +424,50 @@ impl InstallDir { pub fn open_validated(_path: &Path) -> Result { Err(InstallDirError::UnsupportedPlatform) } + + /// The canonical directory path (diagnostics only). + pub fn path(&self) -> &Path { + &self.path + } + + // Keep the Unix-only upgrade callers type-checking on unsupported + // platforms while failing closed before any filesystem operation. + pub fn stat_entry(&self, _name: &str) -> Result, InstallDirError> { + Err(InstallDirError::UnsupportedPlatform) + } + + pub fn read_file(&self, _name: &str) -> Result>, InstallDirError> { + Err(InstallDirError::UnsupportedPlatform) + } + + pub fn write_file_atomic( + &self, + _name: &str, + _bytes: &[u8], + _mode: u32, + ) -> Result<(), InstallDirError> { + Err(InstallDirError::UnsupportedPlatform) + } + + pub fn rename_entry(&self, _from: &str, _to: &str) -> Result<(), InstallDirError> { + Err(InstallDirError::UnsupportedPlatform) + } + + pub fn remove_file(&self, _name: &str) -> Result { + Err(InstallDirError::UnsupportedPlatform) + } + + pub fn fsync_dir(&self) -> Result<(), InstallDirError> { + Err(InstallDirError::UnsupportedPlatform) + } + + pub fn try_lock(&self) -> Result, InstallDirError> { + Err(InstallDirError::UnsupportedPlatform) + } + + pub fn lock_blocking(&self) -> Result { + Err(InstallDirError::UnsupportedPlatform) + } } #[cfg(all(test, unix))]