Skip to content

Fix: copy workspace files with correct claude ownership #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jnchman
Copy link

@jnchman jnchman commented May 28, 2025

📝 Summary

This PR ensures that every file copied into /workspace inside the sandbox container has a UID/GID 1000:1000 (the claude user).

🌟 Key Changes

File Change
src/ContainerManager.ts
  • Adds constant TAR_OWNER_FLAGS = "--numeric-owner --owner=1000 --group=1000"
  • Creates a single archive of tracked + untracked files with those flags
  • Applies the same flags when archiving .git history

jnchman and others added 2 commits May 28, 2025 15:00
…oid container-side chown

refactor(container.ts): replace separate git archive and untracked file append with single tar command using UID/GID 1000:1000
refactor(container.ts): apply ownership flags to .git archive to ensure consistent file ownership inside container
chore(container.ts): remove redundant comments and cleanup temporary file list after tar creation
@osolmaz
Copy link
Contributor

osolmaz commented May 28, 2025

I have tested this, an for some reason, it causes MacOS metadata files with ._ prefix to end up in the container. This is despite the exclude arguments

I also can't reproduce this in every repo, so I don't know whether you can reproduce on your end

Here is my fix attempt:

8ab669f

Open to other ideas. Also, if you can elaborate the main goal here, maybe we can find an alternative solution without introducing this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants