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:
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# UserPromptSubmit hook — injects unread coord messages and (in dev mode) active locks.
|
# 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"
|
API="http://172.16.3.30:8001"
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
MODE_FILE="${SCRIPT_DIR}/current-mode"
|
MODE_FILE="${SCRIPT_DIR}/current-mode"
|
||||||
|
|||||||
Reference in New Issue
Block a user