You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ops: add startup-cleanup.sh for stale socket cleanup + Slack bridge restart
- New script: startup-cleanup.sh removes stale .sock files by comparing
against live session UUIDs, cleans dangling .alias symlinks, and
restarts the slack-bridge tmux session with the correct control-agent UUID
- Updated SKILL.md: replaced vague pseudo-code in Step 0 with concrete
instructions to run the script, simplified the startup checklist,
and condensed the Slack bridge section since it's now automated
- Removes any `.sock` file whose UUID is NOT in the live set
161
+
- Cleans stale `.alias` symlinks pointing to removed sockets
162
+
- Kills and restarts the `slack-bridge` tmux session with the current `control-agent` UUID
163
+
- Verifies the bridge is responsive (HTTP 400 from the API = healthy)
164
+
163
165
**WARNING**: Do NOT use `socat` or any socket-connect test to check liveness — pi sockets don't respond to raw connections and deleting a live socket is **unrecoverable** (the socket is only created at session start). Only remove sockets for sessions that are confirmed dead via `list_sessions`.
164
166
165
167
### Checklist
166
168
167
-
-[ ]Clean stale sockets (Step 0 above)
168
-
-[ ]Verify session name shows as `control-agent` in `list_sessions`
169
+
-[ ]Run `list_sessions` — note live UUIDs, confirm `control-agent` is listed
170
+
-[ ]Run `startup-cleanup.sh` with live UUIDs (cleans sockets + restarts Slack bridge)
-[ ] Send role assignment to the `sentry-agent` session
184
-
-[ ] Start Slack bridge (see below)
185
186
186
187
### Spawning sentry-agent
187
188
@@ -197,27 +198,19 @@ The sentry-agent operates in **on-demand mode** — it does NOT poll. Sentry ale
197
198
198
199
### Starting the Slack Bridge
199
200
200
-
The Slack bridge (Socket Mode) receives real-time Slack events and forwards them to this session. It also provides an outbound HTTP API on port 7890.
201
+
The Slack bridge (Socket Mode) receives real-time Slack events and forwards them to this session via port 7890.
201
202
202
-
**Always run the bridge in its own tmux session** — never inline. Running inline blocks your session while waiting for agent responses.
203
+
**The `startup-cleanup.sh` script handles bridge (re)start automatically** — it reads the control-agent UUID from the `.alias` symlink and launches the bridge in a `slack-bridge` tmux session.
"set -a && source ~/.config/.env && set +a && export PATH=\$HOME/opt/node-v22.14.0-linux-x64/bin:\$PATH && export PI_SESSION_ID=$MY_UUID && cd ~/hornet/slack-bridge && exec node bridge.mjs"
212
211
```
213
212
214
-
**Important**: Always set `PI_SESSION_ID` explicitly to your control-agent UUID. Without it, the bridge tries to auto-detect from socket files and will fail if multiple sessions exist.
0 commit comments