diff --git a/src/basic_memory/cli/commands/cloud/rclone_commands.py b/src/basic_memory/cli/commands/cloud/rclone_commands.py index dcf399d6..8b814956 100644 --- a/src/basic_memory/cli/commands/cloud/rclone_commands.py +++ b/src/basic_memory/cli/commands/cloud/rclone_commands.py @@ -471,6 +471,10 @@ def project_copy_file( f"{source_root}/{source_rel_path}", f"{dest_root}/{dest_rel_path}", *TIGRIS_CONSISTENCY_HEADERS, + # Matches _build_transfer_cmd: on pull this writes the conflict copy to + # the local filesystem, where this prevents NUL byte padding on virtual + # filesystems (e.g. Google Drive File Stream). See rclone/rclone#6801. + "--local-no-preallocate", ] if verbose: cmd.append("--verbose") diff --git a/tests/test_rclone_commands.py b/tests/test_rclone_commands.py index 52aae305..449681f1 100644 --- a/tests/test_rclone_commands.py +++ b/tests/test_rclone_commands.py @@ -721,6 +721,8 @@ def test_project_copy_file_pull_copyto_renames_on_dest(tmp_path): assert cmd[:2] == ["rclone", "copyto"] assert cmd[2] == "basic-memory-cloud:my-bucket/research/notes/dup.md" assert cmd[3] == "/tmp/research/notes/dup.conflict-S.md" + # pull writes the conflict copy locally → must guard virtual-FS NUL padding + assert "--local-no-preallocate" in cmd def test_project_transfer_keep_both_copies_conflicts_then_additive(tmp_path):