@devo-bmad-custom/agent-orchestration 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -133,18 +133,25 @@ fi
|
|
|
133
133
|
|
|
134
134
|
### 3. `tmux_kill_agent` — Gracefully close an agent pane
|
|
135
135
|
|
|
136
|
+
**Trigger:** Coordinator sees a pane with status `ready-to-close` in the session file Pane Lifecycle table.
|
|
137
|
+
|
|
138
|
+
**Pre-conditions (verify all before killing):**
|
|
139
|
+
- [ ] Agent's report-back received (STEP COMPLETE message seen in this pane or session file updated)
|
|
140
|
+
- [ ] Task marked `done` in session file Tasks section
|
|
141
|
+
- [ ] Claude session ID saved to session file
|
|
142
|
+
|
|
136
143
|
```bash
|
|
137
|
-
# Inputs: TARGET_PANE_ID, MASTER_PANE,
|
|
144
|
+
# Inputs: TARGET_PANE_ID, MASTER_PANE, SESSION_FILE
|
|
138
145
|
TARGET_PANE_ID="%31"
|
|
139
146
|
MASTER_PANE="%0"
|
|
140
147
|
|
|
141
|
-
# 1. Verify pane exists
|
|
148
|
+
# 1. Verify pane exists
|
|
142
149
|
sleep 10
|
|
143
|
-
VERIFIED=$(tmux list-panes -a -F "#{pane_id}
|
|
144
|
-
| grep "^$TARGET_PANE_ID ")
|
|
150
|
+
VERIFIED=$(tmux list-panes -a -F "#{pane_id}" | grep -Fx "$TARGET_PANE_ID")
|
|
145
151
|
if [ -z "$VERIFIED" ]; then
|
|
146
|
-
echo "
|
|
147
|
-
exit
|
|
152
|
+
echo "WARN: pane $TARGET_PANE_ID already gone — marking closed in session file"
|
|
153
|
+
# Update session file status to closed and exit
|
|
154
|
+
exit 0
|
|
148
155
|
fi
|
|
149
156
|
|
|
150
157
|
# 2. Send /exit (lets Claude flush writes and exit cleanly)
|
|
@@ -152,17 +159,24 @@ sleep 10
|
|
|
152
159
|
tmux send-keys -t "$TARGET_PANE_ID" "/exit" Enter
|
|
153
160
|
sleep 10
|
|
154
161
|
|
|
155
|
-
# 3.
|
|
156
|
-
tmux
|
|
157
|
-
|
|
162
|
+
# 3. Verify pane closed on its own (Claude exits after /exit)
|
|
163
|
+
STILL_ALIVE=$(tmux list-panes -a -F "#{pane_id}" | grep -Fx "$TARGET_PANE_ID")
|
|
164
|
+
if [ -n "$STILL_ALIVE" ]; then
|
|
165
|
+
# Force kill if still up after /exit
|
|
166
|
+
tmux kill-pane -t "$TARGET_PANE_ID"
|
|
167
|
+
sleep 10
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
# 4. Update session file — mark pane as closed
|
|
171
|
+
# Edit Pane Lifecycle row: change status to `closed`, check off remaining boxes
|
|
158
172
|
|
|
159
|
-
#
|
|
173
|
+
# 5. Rebalance remaining panes
|
|
160
174
|
tmux select-pane -t "$MASTER_PANE"
|
|
161
175
|
sleep 10
|
|
162
176
|
tmux select-layout main-vertical
|
|
163
177
|
sleep 10
|
|
164
178
|
|
|
165
|
-
echo "
|
|
179
|
+
echo "Closed pane $TARGET_PANE_ID — session file updated, layout rebalanced"
|
|
166
180
|
```
|
|
167
181
|
|
|
168
182
|
### 4. `tmux_rebalance` — Equalize pane sizes with master awareness
|
|
@@ -265,8 +279,13 @@ tmux send-keys -t "$SPAWNER_PANE" Enter
|
|
|
265
279
|
sleep 10
|
|
266
280
|
|
|
267
281
|
# 4. Check for more pending tasks for this role
|
|
268
|
-
# 5. If found: claim next task
|
|
269
|
-
# 6. If none:
|
|
282
|
+
# 5. If found: claim next task and continue
|
|
283
|
+
# 6. If none:
|
|
284
|
+
# a. Set status to `ready-to-close` in Pane Lifecycle table (NOT Active Agents)
|
|
285
|
+
# b. Check all close-down boxes in Pane Lifecycle row:
|
|
286
|
+
# ☑ report-back sent · ☑ session ID saved · ☑ task marked done · ☑ ready-to-close set
|
|
287
|
+
# c. The COORDINATOR is responsible for executing /exit + kill-pane.
|
|
288
|
+
# Do NOT self-exit unless you are the coordinator or explicitly told to.
|
|
270
289
|
```
|
|
271
290
|
|
|
272
291
|
---
|