Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions acp_adapter/edit_approval.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,15 @@ def should_auto_approve_edit(proposal: EditProposal, policy: str, cwd: str | Non
policy = str(policy or AUTO_APPROVE_ASK).strip()
if policy == AUTO_APPROVE_ASK or _is_sensitive_auto_approve_path(proposal.path):
return False
path = Path(proposal.path).expanduser().resolve(strict=False)
raw_path = Path(proposal.path).expanduser()
# resolve() follows symlinks — on macOS /tmp → /private/tmp, so the
# resolved form never starts with "/tmp/". Use raw_path for the /tmp
# check and the resolved form only for the cwd relative_to() test.
path = raw_path.resolve(strict=False)
if policy == AUTO_APPROVE_SESSION:
return True
if policy == AUTO_APPROVE_WORKSPACE:
if str(path).startswith("/tmp/"):
if str(raw_path).startswith("/tmp/"):
return True
if cwd:
root = Path(cwd).expanduser().resolve(strict=False)
Expand Down
Loading