-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
When the canonical repository contains files not owned by the current
user (e.g. files created by the agent user or by root),
prepare_canonical fails silently or with a generic CommandError
because chgrp -R cannot change the group on those files.
The consequence for sucoder collaborate (which calls bootstrap →
prepare_canonical → ensure_clone) is:
prepare_canonicalrunschgrp -R coder <canonical>— this
partially fails (exit code 1) on files not owned by the user.- Because
check=True,CommandErroris raised with a generic
"Command failed with exit code 1: chgrp -R coder …" message.
Thechgrpstderr (e.g.chgrp: changing group of '…': Operation not permitted) is logged but not surfaced clearly. - The
MirrorErrorhandler in the CLI prints the error and exits,
but the user is left without a clear diagnosis or remediation path.
In practice this presents as an opaque failure (or, in some
configurations, a loop where prepare_canonical keeps retrying).
Expected behavior
When chgrp/chmod fails due to file ownership, prepare_canonical
should:
- Detect the specific "Operation not permitted" failure.
- List the offending files (or at least the first few).
- Suggest a concrete fix, e.g.:
Cannot change group on 3 files not owned by you:
src/data/cache.pkl (owner: coder)
.git/objects/pack/pack-abc123.idx (owner: root)
.git/objects/pack/pack-abc123.pack (owner: root)
Fix with:
sudo chown ligon:ligon <files…>
# then re-run sucoder collaborate
Where to fix
mirror.py:prepare_canonical(line ~203–205): catchCommandError
from thechgrp -Rcall, parse stderr for "Operation not permitted"
lines, extract the failing paths, and raise aMirrorErrorwith
actionable guidance.
Reproducer
# Create a file owned by root inside the canonical repo
sudo touch /path/to/canonical/root-owned-file
# Now try to collaborate
sucoder collaborate
# → opaque "Command failed" error🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels