mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 07:21:37 +08:00
_install_tirith() uses shutil.move() to place the binary from tmpdir to ~/.hermes/bin/. When these are on different filesystems (common in Docker, NFS), shutil.move() falls back to copy2 + unlink, but copy2's metadata step can raise PermissionError. This exception propagated past the fail_open guard, crashing the terminal tool entirely. Additionally, a failed install could leave a non-executable tirith binary at the destination, causing a retry loop on every subsequent terminal command. Fix: - Catch OSError from shutil.move() and fall back to shutil.copy() (skips metadata/xattr copying that causes PermissionError) - If even copy fails, clean up the partial dest file to prevent the non-executable retry loop - Return (None, 'cross_device_copy_failed') so the failure routes through the existing install-failure caching and fail_open logic Closes #10127
25 KiB
25 KiB