Skip to content

fix(acp): workspace auto-approve fails for /tmp paths on macOS (#28063)#28320

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3ad7d98a
May 19, 2026
Merged

fix(acp): workspace auto-approve fails for /tmp paths on macOS (#28063)#28320
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3ad7d98a

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #28063 by @EloquentBrush0x.

What: should_auto_approve_edit() called Path.resolve() before checking whether the path was under /tmp/. On macOS /tmp is a symlink to /private/tmp, so after resolve() the resolved form never starts with "/tmp/" and the workspace policy never auto-approved /tmp paths.

How: Keep the raw (un-resolved) path for the /tmp/ startswith check; use the resolved form only for the relative_to(cwd) test, which is what actually needs symlink resolution.

Original PR: #28063

… macOS

Path.resolve() follows the /tmp -> /private/tmp symlink on macOS, so
str(path).startswith("/tmp/") is always False for temp-dir paths.
The "Accept Edits" (workspace_session) mode silently refused to
auto-approve every /tmp write on macOS, breaking the documented
behaviour and making the existing test fail on this platform.

Fix: keep the raw expanded path (pre-resolve) for the /tmp prefix
check and continue using the resolved form only for the cwd
relative_to() call where symlink resolution is correct behaviour.
@teknium1 teknium1 merged commit 5cbf86f into main May 19, 2026
4 checks passed
@teknium1 teknium1 deleted the hermes/hermes-3ad7d98a branch May 19, 2026 02:36
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-3ad7d98a vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8814 on HEAD, 8814 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4631 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/acp Agent Communication Protocol adapter labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants