fix: Strip .local suffix from hostname in coord message hook

Problem: macOS hostname command returns 'Mikes-MacBook-Air.local' but
coord messages are addressed to 'Mikes-MacBook-Air/claude-main'. Hook
script was querying for wrong session ID, so messages never displayed.

Fix: Strip .local suffix using bash parameter expansion before building
session ID.

Result: Coord messages now display correctly on macOS machines.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 13:18:27 -07:00
parent d74a726484
commit c5f7c73381

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
# UserPromptSubmit hook — injects unread coord messages and (in dev mode) active locks.
SESSION="$(hostname)/claude-main"
# Strip .local suffix if present (macOS convention)
HOSTNAME_RAW="$(hostname)"
SESSION="${HOSTNAME_RAW%.local}/claude-main"
API="http://172.16.3.30:8001"
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
MODE_FILE="${SCRIPT_DIR}/current-mode"