Commit fd63a6f
refactor: use baudbot- prefix for scalable tmux cleanup
Replace per-session cleanup with prefix-based pattern. Now adding new
tmux sessions requires zero cleanup code.
## Changes
1. Rename session: slack-bridge → baudbot-slack-bridge
2. Kill all 'baudbot-*' sessions instead of individual session names
## Scalability
Before (not scalable):
• Add new tmux session → add new kill-session command
• O(n) cleanup code per session
After (scalable):
• Add new tmux session with baudbot- prefix
• Zero additional cleanup code needed
• O(1) regardless of number of sessions
## Pattern
All agent tmux sessions use 'baudbot-' prefix:
- baudbot-slack-bridge (Slack integration)
- baudbot-metrics (future: metrics collection)
- baudbot-health-monitor (future: health checks)
- etc.
One command kills them all:
tmux list-sessions -F '#{session_name}' | grep '^baudbot-' | xargs tmux kill-session -t
## Hybrid Approach
- Most services: killed via PGID (automatic, zero code)
- Tmux sessions: killed via prefix pattern (scalable, minimal code)
This combines the best of both: automatic cleanup for regular processes,
convention-based cleanup for tmux (which escapes PGID due to setsid).1 parent b366a29 commit fd63a6f
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| |||
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
0 commit comments