Fixes issue 3mwixaxohhh2a (https://tangled.org/permadeath.com/didbot-claude/issues). On Python 3.9, macOS's system python3, the hook's complain() raised inside its own try, so no error was ever logged. tools/echo-receiver.py caught TimeoutError, which is not socket.timeout before 3.10, so it exited after 0.25 s idle. It also read socket.SO_PEERCRED, which macOS lacks.
The hook now calls traceback.format_exception with three arguments. The receiver catches socket.timeout, and skips the peer uid check where SO_PEERCRED is absent, relying on the 0700 directory it already makes. The hook-tests prek hook now runs on Python 3.9 (prek fetches it with uv), and the hook under test runs on the same interpreter. It failed on the answer-trouble fixture before this change. The receiver was checked by hand under 3.9: it stays up while idle and records a report.
🤖 Generated with Claude Code