diff --git a/openhands/storage/s3.py b/openhands/storage/s3.py index 3823db17c705..207751e98129 100644 --- a/openhands/storage/s3.py +++ b/openhands/storage/s3.py @@ -30,6 +30,8 @@ def read(self, path: str) -> str: raise FileNotFoundError(f'Failed to read from S3 at path {path}: {e}') def list(self, path: str) -> list[str]: + if path and path != "/" and not path.endswith("/"): + path += "/" try: return [ obj.object_name for obj in self.client.list_objects(self.bucket, path)